diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-06-25 15:52:55 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-06-25 15:52:55 +0200 |
commit | 352e9a365a88c33d623ac7cd5ba637770e69c047 (patch) | |
tree | 67b7a843f5d551cab7750c7c8c2bcf6b12762eff | |
parent | 48be51947919d7a12ff22b2f31cdca1d4167f782 (diff) | |
download | compilertests-352e9a365a88c33d623ac7cd5ba637770e69c047.tar.gz compilertests-352e9a365a88c33d623ac7cd5ba637770e69c047.tar.bz2 |
ec: avoid strange eof errors when using / instead of div
-rw-r--r-- | ecomp-c/ec.c | 4 | ||||
-rw-r--r-- | ecomp-c/test1.e | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ecomp-c/ec.c b/ecomp-c/ec.c index 962c99c..da25cf3 100644 --- a/ecomp-c/ec.c +++ b/ecomp-c/ec.c @@ -49,6 +49,7 @@ typedef enum { S_plus, S_minus, S_star, + S_slash, S_lparen, S_rparen, S_lbracket, @@ -90,6 +91,7 @@ static char *symname[S_eof+1] = { "+", "-", "*", + "/", "(", ")", "[", @@ -535,6 +537,8 @@ static S_Symbol getSym( void ) } else if( look == '*' ) { skipBlockComment( ); return getSym( ); + } else { + s = S_slash; } break; case '(': diff --git a/ecomp-c/test1.e b/ecomp-c/test1.e index e9e2cec..cc1c9f1 100644 --- a/ecomp-c/test1.e +++ b/ecomp-c/test1.e @@ -72,4 +72,6 @@ begin end; a1[4] := 42; s2[a1[2]] := 'Z'; + while i < i div 2 do + end end |