summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2011-05-20 21:19:56 +0000
committerAdrian Thurston <thurston@complang.org>2011-05-20 21:19:56 +0000
commit9b6006286b0de94880d44d708acb3394df28ad42 (patch)
treed23f75e80d18e316a4d09ffbf9533e600e4cddd1 /test
parent4738d0e77d853eeabcdebc0961c13c3762dca62b (diff)
downloadcolm-9b6006286b0de94880d44d708acb3394df28ad42.tar.gz
Can now capture (declare) variables in construct and parse statements. Name:
goes right after the keyword in the expression. refs #290.
Diffstat (limited to 'test')
-rw-r--r--test/backtrack1.lm2
-rw-r--r--test/backtrack2.lm2
-rw-r--r--test/context2.lm4
-rw-r--r--test/dns.lm6
-rw-r--r--test/rubyhere.lm4
5 files changed, 9 insertions, 9 deletions
diff --git a/test/backtrack1.lm b/test/backtrack1.lm
index 2485544e..2ad62ad8 100644
--- a/test/backtrack1.lm
+++ b/test/backtrack1.lm
@@ -19,6 +19,6 @@ def E
def start
[E]
-S: start = parse start( stdin )
+parse S: start( stdin )
R: start = match S ~ 9 + 9
print_xml( R )
diff --git a/test/backtrack2.lm b/test/backtrack2.lm
index fd06ad77..9b166fbe 100644
--- a/test/backtrack2.lm
+++ b/test/backtrack2.lm
@@ -20,5 +20,5 @@ def prods
def start
[prods]
-S: start = parse start( stdin )
+parse S: start( stdin )
print_xml( match S "!aa bb cc dd" )
diff --git a/test/context2.lm b/test/context2.lm
index 4f6ba2be..9f985341 100644
--- a/test/context2.lm
+++ b/test/context2.lm
@@ -26,10 +26,10 @@ context ruby_here
HereId = input.pull( match_length )
# Get the data up to the rest of the line.
- ROL: rest_of_line = parse_stop rest_of_line( ctx input )
+ parse_stop ROL: rest_of_line( ctx input )
# Parse the heredoc data.
- HereData: here_data = parse_stop here_data( ctx input )
+ parse_stop HereData: here_data( ctx input )
# Push the rest-of-line data back to the input stream.
input.push( $ROL )
diff --git a/test/dns.lm b/test/dns.lm
index f0fa305f..0528242e 100644
--- a/test/dns.lm
+++ b/test/dns.lm
@@ -459,7 +459,7 @@ int print_name( n: name m: name_map )
int print_all_names( s: start )
{
for M: message in s {
- m: name_map = construct name_map []
+ construct m: name_map []
O: octet = octet in M
@@ -467,9 +467,9 @@ int print_all_names( s: start )
match N [name_part* E:name_end]
for NP: name_part* in N {
- if match NP [L:octet nbytes name_part*] {
+ if match NP [L: octet nbytes name_part*] {
messageOffset: int = L.pos - O.pos
- n: name = construct name [NP E]
+ construct n: name [NP E]
m.insert( messageOffset n )
}
}
diff --git a/test/rubyhere.lm b/test/rubyhere.lm
index 2587ecd9..e91fb916 100644
--- a/test/rubyhere.lm
+++ b/test/rubyhere.lm
@@ -24,10 +24,10 @@ lex here_start
HereId = input.pull( match_length )
# Get the data up to the rest of the line.
- ROL: rest_of_line = parse_stop rest_of_line( stdin )
+ parse_stop ROL: rest_of_line( stdin )
# Parse the heredoc data.
- HereData: here_data HereData = parse_stop here_data( stdin )
+ parse_stop HereData: here_data( stdin )
# Push the rest-of-line data back to the input stream.
input.push( $ROL )