finished the rest of the tests
This commit is contained in:
@@ -73,10 +73,6 @@ public final class Parser {
|
||||
* Reads ahead one symbol.
|
||||
*/
|
||||
private void scan() {
|
||||
if (la != null) {
|
||||
System.out.println(la.val);
|
||||
}
|
||||
|
||||
t = la;
|
||||
la = scanner.next();
|
||||
sym = la.kind;
|
||||
@@ -284,6 +280,8 @@ public final class Parser {
|
||||
scan();
|
||||
} else if (sym == mminus) {
|
||||
scan();
|
||||
} else {
|
||||
error(TOKEN_EXPECTED, "unexpected token. assignment token (=, +=, -=, *=, /=, %=), method call (\"(\"), increment (++) or decrement (--)");
|
||||
}
|
||||
|
||||
check(semicolon);
|
||||
@@ -314,7 +312,7 @@ public final class Parser {
|
||||
case return_ -> {
|
||||
scan();
|
||||
|
||||
if (sym == minus || firstStatement.contains(sym)) {
|
||||
if (sym == minus || firstFactor.contains(sym)) {
|
||||
Expr();
|
||||
}
|
||||
|
||||
@@ -381,7 +379,6 @@ public final class Parser {
|
||||
}
|
||||
|
||||
private void Expr() {
|
||||
System.out.println();
|
||||
if (sym == minus) {
|
||||
scan();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user