Fixed a limitToFunction bug or two, work on ADTs

This commit is contained in:
Nathan Braswell
2015-11-06 03:23:55 -05:00
parent 13c6044193
commit fcc0e770a5
8 changed files with 313 additions and 188 deletions

View File

@@ -16,6 +16,7 @@ template_param_list = template_param_list WS "," WS template_param | template_pa
template_param = identifier WS traits | identifier ;
import = "import" WS identifier line_end | "import" WS identifier WS ":" WS "\*" line_end | "import" WS identifier WS ":" WS identifier_list line_end ;
identifier_list = identifier | identifier WS "," WS identifier_list ;
# all for optional semicolons
line_break = "
@@ -57,7 +58,6 @@ triple_quoted_string = "\"\"\"((\"\"(`|1|2|3|4|5|6|7|8|9|0|-|=| |q|w|e|r|t|y|u|i
#identifier = alpha_alphanumeric ;
identifier = augmented_alpha_alphanumeric ;
identifier_list = identifier | identifier WS "," WS identifier_list ;
scope_op = ":" ":" ;
scoped_identifier = scoped_identifier WS scope_op WS identifier | identifier ;
@@ -89,7 +89,9 @@ traits = "\(" WS trait_list WS "\)" ;
trait_list = trait_list WS "," WS scoped_identifier | scoped_identifier ;
adt_nonterm = "adt" ;
adt_def = adt_nonterm WS identifier WS "{" WS identifier_list WS "}" ;
adt_def = adt_nonterm WS identifier WS "{" WS adt_option_list WS "}" ;
adt_option_list = adt_option | adt_option WS "," WS adt_option_list ;
adt_option = identifier | identifier WS dec_type ;
if_statement = "if" WS "\(" WS boolean_expression WS "\)" WS statement | "if" WS "\(" WS boolean_expression WS "\)" WS statement WS "else" WS statement ;