diff options
author | Adrian Thurston <thurston@complang.org> | 2015-10-05 11:15:52 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-10-05 11:21:55 -0400 |
commit | 904ac5cc1675b19249750e3f5492cba720dda4c5 (patch) | |
tree | 097fa6eb549809d993ec3ba2e89fdc658becc598 /src/colm.lm | |
parent | f19e2b452e5dc2a14a48fe71fa26796b5678b147 (diff) | |
download | colm-904ac5cc1675b19249750e3f5492cba720dda4c5.tar.gz |
added syntax dedicated to reductions
This avoids interferrence with existing parsing code. Calling the commit/reduce
code only if the reduce construct is used.
Diffstat (limited to 'src/colm.lm')
-rw-r--r-- | src/colm.lm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/colm.lm b/src/colm.lm index 9b305e70..5420014e 100644 --- a/src/colm.lm +++ b/src/colm.lm @@ -11,6 +11,7 @@ lex token PRINT_XML / 'print_xml' / token PRINT_XML_AC / 'print_xml_ac' / token PARSE / 'parse' / + token REDUCE / 'reduce' / token PARSE_TREE / 'parse_tree' / token PARSE_STOP / 'parse_stop' / token CONS / 'construct' | 'cons' / @@ -615,6 +616,7 @@ def code_factor | [PARSE opt_capture type_ref opt_field_init accumulate] :Parse | [PARSE_TREE opt_capture type_ref opt_field_init accumulate] :ParseTree | [PARSE_STOP opt_capture type_ref opt_field_init accumulate] :ParseStop +| [REDUCE type_ref opt_field_init accumulate] :Reduce | [CONS opt_capture type_ref opt_field_init constructor] :Cons | [MATCH var_ref pattern] :Match | [string] :String |