Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/interpreter/LuaInterpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,6 @@ export default class LuaInterpreter extends LuaParserVisitor<Value> {
}
}
throw ReturnStmt.withList(resultList);
} else if (ctx.CONTINUE()) {
throw new NotYetImplemented(
'continue is not supported in Lua',
ctx,
'N003'
);
} else {
throw new RuntimeError(
"This 'break' should not happen; open an issue on GitHub",
Expand Down
3 changes: 1 addition & 2 deletions src/parser/LuaLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ LOCAL : 'local';
LT : '<';
GT : '>';
RETURN : 'return';
CONTINUE : 'continue';
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the contribution!

May I ask to take a look at vm.test.ts?

● continue causes RuntimeError

expect(received).toBeInstanceOf(expected)

Expected constructor: NotYetImplemented
Received constructor: LuaLangError

I can clean it (it's a one liner), or you can have the fix to keep all changes in a single PR

thank you!

CC : '::';
NIL : 'nil';
FALSE : 'false';
Expand Down Expand Up @@ -120,4 +119,4 @@ WS: [ \t\u000C\r]+ -> channel(HIDDEN);

NL: [\n] -> channel(2);

SHEBANG: '#' { this.IsLine1Col0() }? '!'? SingleLineInputCharacter* -> channel(HIDDEN);
SHEBANG: '#' { this.IsLine1Col0() }? '!'? SingleLineInputCharacter* -> channel(HIDDEN);
5 changes: 1 addition & 4 deletions src/parser/LuaLexer.interp

Large diffs are not rendered by default.

162 changes: 80 additions & 82 deletions src/parser/LuaLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,52 @@ LOCAL=18
LT=19
GT=20
RETURN=21
CONTINUE=22
CC=23
NIL=24
FALSE=25
TRUE=26
DOT=27
SQUIG=28
MINUS=29
POUND=30
OP=31
CP=32
NOT=33
LL=34
GG=35
AMP=36
SS=37
PER=38
COL=39
LE=40
GE=41
AND=42
OR=43
PLUS=44
STAR=45
OCU=46
CCU=47
OB=48
CB=49
EE=50
DD=51
PIPE=52
CARET=53
SLASH=54
DDD=55
SQEQ=56
NAME=57
NORMALSTRING=58
CHARSTRING=59
LONGSTRING=60
INT=61
HEX=62
FLOAT=63
HEX_FLOAT=64
COMMENT=65
WS=66
NL=67
SHEBANG=68
CC=22
NIL=23
FALSE=24
TRUE=25
DOT=26
SQUIG=27
MINUS=28
POUND=29
OP=30
CP=31
NOT=32
LL=33
GG=34
AMP=35
SS=36
PER=37
COL=38
LE=39
GE=40
AND=41
OR=42
PLUS=43
STAR=44
OCU=45
CCU=46
OB=47
CB=48
EE=49
DD=50
PIPE=51
CARET=52
SLASH=53
DDD=54
SQEQ=55
NAME=56
NORMALSTRING=57
CHARSTRING=58
LONGSTRING=59
INT=60
HEX=61
FLOAT=62
HEX_FLOAT=63
COMMENT=64
WS=65
NL=66
SHEBANG=67
';'=1
'='=2
'break'=3
Expand All @@ -87,38 +86,37 @@ SHEBANG=68
'<'=19
'>'=20
'return'=21
'continue'=22
'::'=23
'nil'=24
'false'=25
'true'=26
'.'=27
'~'=28
'-'=29
'#'=30
'('=31
')'=32
'not'=33
'<<'=34
'>>'=35
'&'=36
'//'=37
'%'=38
':'=39
'<='=40
'>='=41
'and'=42
'or'=43
'+'=44
'*'=45
'{'=46
'}'=47
'['=48
']'=49
'=='=50
'..'=51
'|'=52
'^'=53
'/'=54
'...'=55
'~='=56
'::'=22
'nil'=23
'false'=24
'true'=25
'.'=26
'~'=27
'-'=28
'#'=29
'('=30
')'=31
'not'=32
'<<'=33
'>>'=34
'&'=35
'//'=36
'%'=37
':'=38
'<='=39
'>='=40
'and'=41
'or'=42
'+'=43
'*'=44
'{'=45
'}'=46
'['=47
']'=48
'=='=49
'..'=50
'|'=51
'^'=52
'/'=53
'...'=54
'~='=55
Loading