forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel21-Additions.lark
11 lines (10 loc) · 1.29 KB
/
level21-Additions.lark
1
2
3
4
5
6
7
8
9
10
11
// adds length of lists
print: _PRINT (_SPACE* _LEFT_BRACKET _SPACE* (quoted_text | list_access | var_access | sum | length) (_SPACE (quoted_text | list_access | var_access | sum | length))* _RIGHT_BRACKET)?
input: var _SPACE _IS _SPACE _INPUT (_LEFT_BRACKET (quoted_text | list_access | var_access | sum | length) (_SPACE (quoted_text | list_access | var_access | sum | length))* _RIGHT_BRACKET)?
assign: var _SPACE _IS _SPACE length | var _SPACE _IS _SPACE sum | var _SPACE _IS _SPACE textwithoutspaces | list_access _SPACE _IS _SPACE sum | list_access _SPACE _IS _SPACE textwithoutspaces
equality_check: (length | textwithoutspaces | list_access) _SPACE _IS _SPACE (length | textwithoutspaces | list_access)
for_loop: _FOR _SPACE (NAME | var) _SPACE _IN _SPACE _RANGE _LEFT_BRACKET (NUMBER | var | length)(_COMMA _SPACE|_COMMA) (NUMBER | var | length) _RIGHT_BRACKET _COLON _EOL (_SPACE command) (_EOL _SPACE command)* _EOL _END_BLOCK
smaller: (textwithoutspaces | list_access | length) _SPACE _SMALLER _SPACE (textwithoutspaces | list_access | length)
bigger: (textwithoutspaces | list_access | length) _SPACE _LARGER _SPACE (textwithoutspaces | list_access | length)
length: _LENGTH _LEFT_BRACKET var _RIGHT_BRACKET
list_access: var _LEFT_SQUARE_BRACKET (index | random | var | length) _RIGHT_SQUARE_BRACKET