summaryrefslogtreecommitdiff
path: root/src/colm.lm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-10-06 10:50:30 -0400
committerAdrian Thurston <thurston@complang.org>2015-10-06 10:50:30 -0400
commit0088b7912eb1bbcf7034b005ef84e133f3d89aab (patch)
tree1b03a4ac4f897bb8e00dcf0992f1053b3ec666cc /src/colm.lm
parentdc2a84cc6c730f991e5f7c41964f1a81a086aaae (diff)
downloadcolm-0088b7912eb1bbcf7034b005ef84e133f3d89aab.tar.gz
collect and emit reduction action items
Diffstat (limited to 'src/colm.lm')
-rw-r--r--src/colm.lm13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/colm.lm b/src/colm.lm
index c7c72c2a..74e83bf5 100644
--- a/src/colm.lm
+++ b/src/colm.lm
@@ -338,8 +338,8 @@ def reduction_def
[REDUCTION id ItemList: reduction_item* END]
lex
- token ROPEN / '{' /
- token RCLOSE / '}' /
+ token RED_OPEN / '{' /
+ token RED_CLOSE / '}' /
token red_id /
( 'a' .. 'z' | 'A' .. 'Z' | '_' ) .
@@ -360,14 +360,17 @@ lex
'\"' . ( ^( '\"' | '\\' ) | '\\' . any )* . ( '\"' | '\"i' )
/
+ token RED_LHS / '$' . '$' /
+ token RED_RHS / '$' . red_id /
+
token red_any / any /
end
def red_nonterm
- [type_ref ROPEN HostItems: host_item* RCLOSE]
+ [type_ref RED_OPEN HostItems: host_item* RED_CLOSE]
def red_action
- [type_ref COLON id ROPEN HostItems: host_item* RCLOSE]
+ [type_ref COLON id RED_OPEN HostItems: host_item* RED_CLOSE]
def host_item
[red_id]
@@ -375,6 +378,8 @@ def host_item
| [red_comment]
| [red_ws]
| [red_any]
+| [RED_LHS]
+| [RED_RHS]
def reduction_item
[red_nonterm] :NonTerm commit