This commit is contained in:
hneemann 2019-07-06 14:24:44 +02:00
parent e079729e1a
commit 383b15dc06

View File

@ -192,7 +192,7 @@ public class Parser {
return lino(c -> ref.declareVar(c, initVal.value(c))); return lino(c -> ref.declareVar(c, initVal.value(c)));
case EQUAL: case EQUAL:
if (export) if (export)
throw newParserException("export not alowed here!"); throw newParserException("export not allowed here!");
final Expression val = parseExpression(); final Expression val = parseExpression();
if (isRealStatement) expect(SEMICOLON); if (isRealStatement) expect(SEMICOLON);
return lino(c -> { return lino(c -> {
@ -204,18 +204,18 @@ public class Parser {
case ADD: case ADD:
expect(ADD); expect(ADD);
if (export) if (export)
throw newParserException("export not alowed here!"); throw newParserException("export not allowed here!");
if (isRealStatement) expect(SEMICOLON); if (isRealStatement) expect(SEMICOLON);
return lino(c -> ref.set(c, Value.toLong(ref.get(c)) + 1)); return lino(c -> ref.set(c, Value.toLong(ref.get(c)) + 1));
case SUB: case SUB:
expect(SUB); expect(SUB);
if (export) if (export)
throw newParserException("export not alowed here!"); throw newParserException("export not allowed here!");
if (isRealStatement) expect(SEMICOLON); if (isRealStatement) expect(SEMICOLON);
return lino(c -> ref.set(c, Value.toLong(ref.get(c)) - 1)); return lino(c -> ref.set(c, Value.toLong(ref.get(c)) - 1));
case SEMICOLON: case SEMICOLON:
if (export) if (export)
throw newParserException("export not alowed here!"); throw newParserException("export not allowed here!");
return lino(ref::get); return lino(ref::get);
default: default:
throw newUnexpectedToken(refToken); throw newUnexpectedToken(refToken);