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