summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-08-17 16:47:29 -0400
committerAdrian Thurston <thurston@complang.org>2012-08-17 16:47:29 -0400
commit4da283ba42afc6cf65112bcc127951490034a6b4 (patch)
treefecdc35dc0bcd8c9a1c98419a579c8f0bd0cc264 /test
parentbc886d38db5bfeb172689a46afc18e933a220968 (diff)
downloadcolm-4da283ba42afc6cf65112bcc127951490034a6b4.tar.gz
remaining migration to new parse syntax
Diffstat (limited to 'test')
-rw-r--r--test/binary1.lm2
-rw-r--r--test/constructex.lm4
-rw-r--r--test/counting1.lm2
-rw-r--r--test/counting2.lm2
-rw-r--r--test/counting3.lm2
-rw-r--r--test/counting4.lm2
-rw-r--r--test/export1.lm4
-rw-r--r--test/generate1.lm10
-rw-r--r--test/generate2.lm4
-rw-r--r--test/heredoc.lm4
-rw-r--r--test/ignore1.lm6
-rw-r--r--test/ignore2.lm3
-rw-r--r--test/ignore3.lm3
-rw-r--r--test/island.lm4
-rw-r--r--test/lhs1.lm4
-rw-r--r--test/liftattrs.lm3
-rw-r--r--test/lookup1.lm6
-rw-r--r--test/mailbox.lm4
-rw-r--r--test/matchex.lm6
-rw-r--r--test/maxlen.lm4
-rw-r--r--test/multiregion2.lm3
-rw-r--r--test/nestedcomm.lm6
-rw-r--r--test/order2.lm4
-rw-r--r--test/reparse.lm8
-rw-r--r--test/rhsref1.lm3
-rw-r--r--test/string.lm4
-rw-r--r--test/superid.lm3
-rw-r--r--test/tags3.lm4
28 files changed, 61 insertions, 53 deletions
diff --git a/test/binary1.lm b/test/binary1.lm
index ff3ca066..f89e1d23 100644
--- a/test/binary1.lm
+++ b/test/binary1.lm
@@ -479,6 +479,6 @@ int print_all_names( s: start )
}
}
-S: start = parse start[ stdin ]
+parse S: start[ stdin ]
print_all_names( S.tree )
print( '*** SUCCESS ***\n' )
diff --git a/test/constructex.lm b/test/constructex.lm
index a92ca977..e0ade583 100644
--- a/test/constructex.lm
+++ b/test/constructex.lm
@@ -21,9 +21,9 @@ def item
[tag]
| [id]
-PersonTag: tag = parse tag( stdin )
+parse PersonTag: tag[ stdin ]
-match PersonTag
+match PersonTag.tree
["<person name=" Val:id attr*">" item* "</person>"]
NameTag1: tag = construct tag
diff --git a/test/counting1.lm b/test/counting1.lm
index d7511a8e..d8cc25fb 100644
--- a/test/counting1.lm
+++ b/test/counting1.lm
@@ -90,4 +90,4 @@ def start
}
}
-parse start( stdin )
+parse start[ stdin ]
diff --git a/test/counting2.lm b/test/counting2.lm
index ad92f591..c3152721 100644
--- a/test/counting2.lm
+++ b/test/counting2.lm
@@ -81,4 +81,4 @@ def start
}
}
-parse start( stdin )
+parse start[ stdin ]
diff --git a/test/counting3.lm b/test/counting3.lm
index 7ae3d960..2fa01865 100644
--- a/test/counting3.lm
+++ b/test/counting3.lm
@@ -91,4 +91,4 @@ def start
print( '*** SUCCESS ***\n' )
}
-parse start( stdin )
+parse start[ stdin ]
diff --git a/test/counting4.lm b/test/counting4.lm
index 61822db2..3c3e0805 100644
--- a/test/counting4.lm
+++ b/test/counting4.lm
@@ -86,4 +86,4 @@ def start
print( '*** SUCCESS ***\n' )
}
-parse start(stdin)
+parse start[stdin]
diff --git a/test/export1.lm b/test/export1.lm
index 5ca34a87..653f7dcc 100644
--- a/test/export1.lm
+++ b/test/export1.lm
@@ -10,7 +10,5 @@ def start
export Start: start
export Error: str
-Start = parse start( stdin )
-
+parse start[ stdin ]
Error = error()
-
diff --git a/test/generate1.lm b/test/generate1.lm
index ea60ae0b..445d3282 100644
--- a/test/generate1.lm
+++ b/test/generate1.lm
@@ -724,11 +724,11 @@ int print_stmts( S: start )
print( 'STMT: ' ^Stmt '\n' )
}
-S: start = parse start( stdin )
+parse S: start[ stdin ]
print( '*** SUCCESS ***\n' )
-print( ^S '\n' )
+print( ^S.tree '\n' )
print( '***\n' )
-print_stmts( S )
-print_target_subscriptions_and_slicings( S )
-print_primary_subscriptions_and_slicings( S )
+print_stmts( S.tree )
+print_target_subscriptions_and_slicings( S.tree )
+print_primary_subscriptions_and_slicings( S.tree )
print( '*** SUCCESS ***\n' )
diff --git a/test/generate2.lm b/test/generate2.lm
index 323d4490..498559bf 100644
--- a/test/generate2.lm
+++ b/test/generate2.lm
@@ -193,7 +193,9 @@ def item
def start
[item*]
-S: start = parse start(stdin)
+parse SP: start[stdin]
+S: start = SP.tree
+
if S {
for I: external_link in S
print( 'EXTERNAL LINK: ' I '\n' )
diff --git a/test/heredoc.lm b/test/heredoc.lm
index 9551e0e0..6941b0ba 100644
--- a/test/heredoc.lm
+++ b/test/heredoc.lm
@@ -42,5 +42,5 @@ def heredoc
[here_name here_data here_close id nl]
-S: heredoc = parse heredoc(stdin)
-print_xml(S)
+parse S: heredoc[stdin]
+print_xml(S.tree)
diff --git a/test/ignore1.lm b/test/ignore1.lm
index 2922116d..4c029354 100644
--- a/test/ignore1.lm
+++ b/test/ignore1.lm
@@ -43,11 +43,11 @@ def item_list
[item_list tag]
| []
-parse Attrs: attr_list( stdin )
+parse Attrs: attr_list[ stdin ]
-print( %Attrs '\n' )
+print( %Attrs.tree '\n' )
construct IL: item_list
- ["<wrapper .[Attrs]. ></wrapper>"]
+ ["<wrapper .[Attrs.tree]. ></wrapper>"]
print( IL '\n' )
diff --git a/test/ignore2.lm b/test/ignore2.lm
index 186125a3..5a2239d1 100644
--- a/test/ignore2.lm
+++ b/test/ignore2.lm
@@ -12,7 +12,8 @@ def item
def start
[item*]
-Input: start = parse start( stdin )
+parse InputP: start[ stdin ]
+Input: start = InputP.tree
cons Output: accum<start> []
diff --git a/test/ignore3.lm b/test/ignore3.lm
index c224769f..e38eedbc 100644
--- a/test/ignore3.lm
+++ b/test/ignore3.lm
@@ -23,7 +23,8 @@ def item
def start
[item* ';']
-parse Start: start( stdin )
+parse StartP: start[ stdin ]
+Start: start = StartP.tree
if ( ! Start ) {
print( 'parse error\n' )
diff --git a/test/island.lm b/test/island.lm
index 0ebea2d4..5f1bd227 100644
--- a/test/island.lm
+++ b/test/island.lm
@@ -50,8 +50,8 @@ def top_item
def start
[top_item*]
-S: start = parse start( stdin )
-print_xml( S )
+parse S: start[ stdin ]
+print_xml( S.tree )
print( '\n' )
#pattern start
diff --git a/test/lhs1.lm b/test/lhs1.lm
index acc9cbe2..efae68d9 100644
--- a/test/lhs1.lm
+++ b/test/lhs1.lm
@@ -30,5 +30,5 @@ def start
[A item* '!']
| [B item* ';\n']
-parse Start: start( stdin )
-print( Start "\n" )
+parse Start: start[ stdin ]
+print( Start.tree "\n" )
diff --git a/test/liftattrs.lm b/test/liftattrs.lm
index 5e1fda24..b4340575 100644
--- a/test/liftattrs.lm
+++ b/test/liftattrs.lm
@@ -43,7 +43,8 @@ def item_list
[item_list tag]
| []
-IL: item_list = parse item_list(stdin)
+parse ILP: item_list[stdin]
+IL: item_list = ILP.tree
# Get the item list
match IL [RootItemList: item_list]
diff --git a/test/lookup1.lm b/test/lookup1.lm
index cb5db9c4..fe036e2a 100644
--- a/test/lookup1.lm
+++ b/test/lookup1.lm
@@ -1515,16 +1515,16 @@ def class_specifier
[class_head base_clause_opt '{' class_member_rep class_body_end '}']
{
# FIXME: reparse not implemented yet
+# FIXME FIXME: reparse is actually implemented now implemented
# # Visit class function bodies, but skip nested classes.
# for CFB: class_function_body in lhs {
# skipping class_specifier
#
# # Reparse the text of the class function body as a function body
-# function_body FB = reparse function_body( CFB )
+# function_body FB = parse function_body[ $CFB ]
#
# # Replace the class function body with the parsed function body.
-# CFB = construct class_function_body
-# [FB]
+# CFB = cons class_function_body [FB.tree]
# }
}
diff --git a/test/mailbox.lm b/test/mailbox.lm
index 29f88062..50da0f60 100644
--- a/test/mailbox.lm
+++ b/test/mailbox.lm
@@ -40,5 +40,5 @@ def message
def start
[message*]
-S: start = parse start( stdin )
-print_xml( S )
+parse S: start[ stdin ]
+print_xml( S.tree )
diff --git a/test/matchex.lm b/test/matchex.lm
index e3274968..ce0797f2 100644
--- a/test/matchex.lm
+++ b/test/matchex.lm
@@ -21,13 +21,13 @@ def item
[tag]
| [id]
-Tag: tag = parse tag( stdin )
+parse Tag: tag[ stdin ]
# Style: List of literal text and types.
-match Tag ["<person name=" Val1:id attr*">" item* "</person>"]
+match Tag.tree ["<person name=" Val1:id attr*">" item* "</person>"]
# Style: Literal text with embedded lists of types.
-match Tag "<person name=[Val2:id attr*]>[item*]</person>"
+match Tag.tree "<person name=[Val2:id attr*]>[item*]</person>"
print( ^Val1 '\n' )
print( ^Val2 '\n' )
diff --git a/test/maxlen.lm b/test/maxlen.lm
index 7167ce58..32bee1a0 100644
--- a/test/maxlen.lm
+++ b/test/maxlen.lm
@@ -42,4 +42,6 @@ def restricted_list
def start
[restricted_list id*]
-print_xml( parse start(stdin) )
+
+parse S: start[stdin]
+print_xml( S.tree )
diff --git a/test/multiregion2.lm b/test/multiregion2.lm
index 7cba9df3..815783c1 100644
--- a/test/multiregion2.lm
+++ b/test/multiregion2.lm
@@ -69,7 +69,8 @@ def header
def request
[request_line header* CRLF]
-parse R: request*( stdin )
+parse RP: request*[ stdin ]
+R: request* = RP.tree
if !R {
print( error() )
diff --git a/test/nestedcomm.lm b/test/nestedcomm.lm
index d0e9f32b..02368f32 100644
--- a/test/nestedcomm.lm
+++ b/test/nestedcomm.lm
@@ -13,9 +13,9 @@ lex start
token open_paren /'('/
{
- parse_stop NC: nested_comment( stdin )
- print( %NC '\n' )
- input.push_ignore( NC )
+ parse_stop NC: nested_comment[ stdin ]
+ print( %NC.tree '\n' )
+ input.push_ignore( NC.tree )
}
}
diff --git a/test/order2.lm b/test/order2.lm
index 13064ae9..2babef1f 100644
--- a/test/order2.lm
+++ b/test/order2.lm
@@ -84,12 +84,12 @@ def port
[]
# Parse the input.
-P: program = parse program( stdin )
+parse P: program[ stdin ]
Output: output Output = construct output []
# Take off the leading C from the input file and send it out.
-match P [C: c '%%' protocol*]
+match P.tree [C: c '%%' protocol*]
Output << [$C]
Output <<
diff --git a/test/reparse.lm b/test/reparse.lm
index 9b70b555..23a3dd5e 100644
--- a/test/reparse.lm
+++ b/test/reparse.lm
@@ -12,11 +12,11 @@ def item
def start
[item*]
-Input: item* = parse item*( stdin )
+parse Input: item*[ stdin ]
-S: start = cons start[ Input ]
+S: start = cons start[ Input.tree ]
-Again: start = parse start( Input )
+parse Again: start[ %Input.tree ]
-print( %Again )
+print( %Again.tree )
diff --git a/test/rhsref1.lm b/test/rhsref1.lm
index 75f83e73..f771bce8 100644
--- a/test/rhsref1.lm
+++ b/test/rhsref1.lm
@@ -87,7 +87,8 @@ def labelled_statement
def goto_statement
['goto' id ';']
-P: program = parse program(stdin)
+parse PP: program[stdin]
+P: program = PP.tree
for E: expression in P {
print( ^(E.Term.Factor.Primary) '\n' )
diff --git a/test/string.lm b/test/string.lm
index 015de456..d8a33486 100644
--- a/test/string.lm
+++ b/test/string.lm
@@ -50,6 +50,6 @@ def start
}
}
-S: start = parse start(stdin)
-print_xml( S )
+parse S: start[stdin]
+print_xml( S.tree )
print( '\n' )
diff --git a/test/superid.lm b/test/superid.lm
index d05726d7..e3693ba0 100644
--- a/test/superid.lm
+++ b/test/superid.lm
@@ -57,5 +57,6 @@ def start
print( Item2.msg )
}
-print_xml( parse start(stdin) )
+parse S: start[stdin]
+print_xml( S.tree )
print( '\n' )
diff --git a/test/tags3.lm b/test/tags3.lm
index 1f33a674..1ad217cd 100644
--- a/test/tags3.lm
+++ b/test/tags3.lm
@@ -289,10 +289,10 @@ int close( Start: ref start )
if should_close( TagId )
{
- CloseId: close_id = parse close_id( TagId.data )
+ parse CloseId: close_id[ TagId.data ]
CloseTag: opt_close_tag =
- construct opt_close_tag ['</' CloseId '>']
+ construct opt_close_tag ['</' CloseId.tree '>']
# Close the tag and put inside after it.
TL = construct item