mirror of
https://github.com/ilyakooo0/luau.git
synced 2024-10-03 21:48:26 +03:00
break and goto
This commit is contained in:
parent
907ae4d250
commit
4ed8acbbb1
@ -3,3 +3,4 @@
|
||||
- [ ] functioncall
|
||||
- [ ] any string apart from the basic string with no escapes
|
||||
- [ ] check if int fits in int or make it a float
|
||||
- [ ] strip out comments before parsing
|
||||
|
@ -465,7 +465,9 @@
|
||||
[%blok blok]
|
||||
[%asmnt varlist exprlist]
|
||||
[%label label]
|
||||
[%goto label]
|
||||
[%func-call functioncall]
|
||||
[%break ~]
|
||||
[%empty ~]
|
||||
==
|
||||
++ parse-stat
|
||||
@ -474,6 +476,15 @@
|
||||
;~ pose
|
||||
(cold [%empty ~] (just ';'))
|
||||
::
|
||||
(cold [%break ~] (jest 'break'))
|
||||
::
|
||||
%+ cook
|
||||
|= [* =label] [%goto label]
|
||||
;~ (glue ws)
|
||||
(jest 'goto')
|
||||
parse-name
|
||||
==
|
||||
::
|
||||
%+ cook
|
||||
|= =label [%label label]
|
||||
parse-label
|
||||
@ -513,6 +524,13 @@
|
||||
==
|
||||
%label (print-label +.stat)
|
||||
%func-call (print-functioncall +.stat)
|
||||
%break "break"
|
||||
%goto
|
||||
%- zing
|
||||
:~
|
||||
"goto "
|
||||
(trip +.stat)
|
||||
==
|
||||
==
|
||||
:: functioncall
|
||||
::
|
||||
|
@ -55,3 +55,7 @@ print('the way of the future')
|
||||
print 'hello'
|
||||
|
||||
h{key1 = 'Sonmi~451'}
|
||||
|
||||
goto helli
|
||||
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user