Skip to content

Commit d1e64bb

Browse files
authored
Merge pull request #24 from krupan/grammar-fixes
some lesson 7 grammar fixes
2 parents 2e155bf + 874944a commit d1e64bb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tutorial/en/7-Statements.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
We have to concept in C: statement and expression. Basically statements won't
1+
We have two concepts in C: statement and expression. Basically statements won't
22
have a value as its result while expressions do. That means you cannot assign
3-
an statement to a variable.
3+
a statement to a variable.
44

55
We have 6 statements in our interpreter:
66

@@ -34,8 +34,8 @@ if (...) <statement> [else <statement>]
3434
The flow of assembly code is:
3535

3636
1. execute `<cond>`.
37-
2. If the condition fail, jump to positino `a`, i.e. `else` statement.
38-
3. Cause assembly is executed sequentially, if `<true_statement>` is executed,
37+
2. If the condition fails, jump to position `a`, i.e. `else` statement.
38+
3. Because assembly is executed sequentially, if `<true_statement>` is executed,
3939
we need to skip `<false_statement>`, thus a jump to `b` is needed.
4040

4141
Corresponding C code:
@@ -104,7 +104,7 @@ Nothing worth mention. C code:
104104

105105
## Return
106106

107-
Once we met `return`, it means the function is about to end, thus `LEV` is
107+
Once we meet `return`, it means the function is about to end, thus `LEV` is
108108
needed to indicate the exit.
109109

110110
```c
@@ -165,7 +165,7 @@ functions. You can challange yourself to fill them out first.
165165

166166
As you can see, implementing parsing for an interpreter is not hard at all.
167167
But it did seems complicated because we need to gather enough knowledge during
168-
parsing in order to generate target code(assembly in our case). You see, that
168+
parsing in order to generate target code (assembly in our case). You see, that
169169
is one big obstacle for beginner to start implementation. So instead of
170170
"programming knowledge", "domain knowledge" is also required to actually
171171
achieve something.

0 commit comments

Comments
 (0)