Skip to content

Commit 1dcc6ef

Browse files
committed
remove tab characters
1 parent 5e5f999 commit 1dcc6ef

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

tutorial/en/2-Virtual-Machine.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -319,37 +319,37 @@ int callee(int, int, int);
319319

320320
int caller(void)
321321
{
322-
int i, ret;
322+
int i, ret;
323323

324-
ret = callee(1, 2, 3);
325-
ret += 5;
326-
return ret;
324+
ret = callee(1, 2, 3);
325+
ret += 5;
326+
return ret;
327327
}
328328
```
329329
330330
The compiler will generate the following assembly instructions:
331331
332332
```
333333
caller:
334-
; make new call frame
335-
push ebp
336-
mov ebp, esp
334+
; make new call frame
335+
push ebp
336+
mov ebp, esp
337337
sub 1, esp ; save stack for variable: i
338-
; push call arguments
339-
push 3
340-
push 2
341-
push 1
342-
; call subroutine 'callee'
343-
call callee
344-
; remove arguments from frame
345-
add esp, 12
346-
; use subroutine result
347-
add eax, 5
348-
; restore old call frame
338+
; push call arguments
339+
push 3
340+
push 2
341+
push 1
342+
; call subroutine 'callee'
343+
call callee
344+
; remove arguments from frame
345+
add esp, 12
346+
; use subroutine result
347+
add eax, 5
348+
; restore old call frame
349349
mov esp, ebp
350-
pop ebp
351-
; return
352-
ret
350+
pop ebp
351+
; return
352+
ret
353353
```
354354
355355
The above assembly instructions cannot be achieved in our VM due to several

tutorial/en/4-Top-down-Parsing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ calculator can be converted into:
120120
<expr_tail> ::= + <term> <expr_tail>
121121
| - <term> <expr_tail>
122122
| <empty>
123-
123+
124124
<term> ::= <factor> <term_tail>
125125
126126
<term_tail> ::= * <factor> <term_tail>
127127
| / <factor> <term_tail>
128128
| <empty>
129-
129+
130130
<factor> ::= ( <expr> )
131131
| Num
132132
```
@@ -211,13 +211,13 @@ void next() {
211211
while (*src == ' ' || *src == '\t') {
212212
src ++;
213213
}
214-
214+
215215
token = *src++;
216-
216+
217217
if (token >= '0' && token <= '9' ) {
218218
token_val = token - '0';
219219
token = Num;
220-
220+
221221
while (*src >= '0' && *src <= '9') {
222222
token_val = token_val*10 + *src - '0';
223223
src ++;
@@ -231,7 +231,7 @@ void match(int tk) {
231231
printf("expected token: %d(%c), got: %d(%c)\n", tk, tk, token, token);
232232
exit(-1);
233233
}
234-
234+
235235
next();
236236
}
237237
```

tutorial/en/7-Statements.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ if (...) <statement> [else <statement>]
2626
JZ a
2727
<true_statement> ===> <true_statement>
2828
else: JMP b
29-
a: a:
30-
<false_statement> <false_statement>
31-
b: b:
29+
a: a:
30+
<false_statement> <false_statement>
31+
b: b:
3232
```
3333

3434
The flow of assembly code is:

0 commit comments

Comments
 (0)