missing newlines
This commit is contained in:
parent
d2588c4be4
commit
9cbc2c4413
1 changed files with 3 additions and 3 deletions
6
c4.c
6
c4.c
|
|
@ -128,7 +128,7 @@ expr(int lev)
|
|||
{
|
||||
int t, *d;
|
||||
|
||||
if (!tk) { printf("%d: unexpected eof in expression", line); exit(-1); }
|
||||
if (!tk) { printf("%d: unexpected eof in expression\n", line); exit(-1); }
|
||||
else if (tk == Num) { *++e = IMM; *++e = ival; next(); ty = INT; }
|
||||
else if (tk == '"') {
|
||||
*++e = IMM; *++e = ival; next();
|
||||
|
|
@ -162,7 +162,7 @@ expr(int lev)
|
|||
if (tk == Int || tk == Char) {
|
||||
t = (tk == Int) ? INT : CHAR; next();
|
||||
while (tk == Mul) { next(); t = t + PTR; }
|
||||
if (tk == ')') next(); else { printf("%d: bad cast", line); exit(-1); }
|
||||
if (tk == ')') next(); else { printf("%d: bad cast\n", line); exit(-1); }
|
||||
expr(Inc);
|
||||
ty = t;
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ expr(int lev)
|
|||
*++e = (t == Inc) ? ADD : SUB;
|
||||
*++e = (ty == CHAR) ? SC : SI;
|
||||
}
|
||||
else { printf("%d: bad expression %c\n", line, tk); exit(-1); }
|
||||
else { printf("%d: bad expression\n", line); exit(-1); }
|
||||
|
||||
while (tk >= lev) { // "precedence climbing" or "Top Down Operator Precedence" method
|
||||
t = ty;
|
||||
|
|
|
|||
Loading…
Reference in a new issue