Skip to content

Commit

Permalink
~Fixed all test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaniBilby committed Jul 19, 2023
1 parent 64c3477 commit e9e5fa2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/bnfs/lolcode.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ w ::= ws* nlc ws* ; # Multi-line white space

code_block ::= statement %w ( statement %w )* ;
statement ::= declaration | if_block | loop | func_def | comment |
print_block | input_block | assignment | expression ;
print_block | input_block | assignment | func ;


declaration ::= %"I HAZ A" %ws+ ...label ( %ws+ %"ITZ" %ws+ expression )? ;
assignment ::= ...label %ws+ %"R" %ws+ expression ;


loop ::= %"IM IN YR" %ws+ ...label %ws+ %"WILE" expression %w code_block %w %"IM OUTTA YR" %ws+ ...label ;
loop ::= %"IM IN YR" %ws+ ...label %ws+ %"WILE" %ws+ expression %w code_block %"IM OUTTA YR" %ws+ ...label ;

if_block ::= %"O RLY?" %ws expression %w %"YA RLY" %w code_block else_if_block? %"OIC" ;
else_if_block ::= ( else_bounded | else_unbounded ) %w code_block ;
Expand All @@ -39,7 +39,7 @@ expression ::=
equals | not_equals | both | either | greater | less | # comparitors
add | sub | mul | div | mod | cast | # dual operand
all | any | not | # group boolean operand
func | label | atom ; # operands
func | atom | label ; # operands
equals ::= %( "BOTH SAEM" ws+ ) expression %( ws+ "AN" ws+ ) expression ;
not_equals ::= %( "DIFFRINT" ws+ ) expression %( ws+ "AN" ws+ ) expression ;
both ::= %( "BOTH OF" ws+ ) expression %( ws+ "AN" ws+ ) expression ;
Expand All @@ -55,7 +55,7 @@ expression ::=
all ::= %("ALL OF" ws+ ) expression ( %( ws+ "AN" ws+ ) expression )* ;
any ::= %("ANY OF" ws+ ) expression ( %( ws+ "AN" ws+ ) expression )* ;
not ::= %("NOT" ws+ ) expression ;
func ::= ...label %ws+ ( expression %ws+ )+ %"MKAY?" ;
func ::= "DO" ...label %ws+ ( expression %ws+ )+ %"MKAY?" ;
label ::= ...( letters ( letters | digits )* ) ;
letters ::= "A"->"Z"+ | "a"->"z"+ ;
digit_nz ::= "1"->"9"+ ;
Expand Down

0 comments on commit e9e5fa2

Please sign in to comment.