diff --git a/bench/good/JSParse.opp.exp b/bench/good/JSParse.opp.exp index 31b52a192e60f54766ce0cfcf619599d156cdc3b..d483805732d13f235e2de76e1ed7b30ed09b1ee8 100644 --- a/bench/good/JSParse.opp.exp +++ b/bench/good/JSParse.opp.exp @@ -236,11 +236,11 @@ let string_of_constant c = %% program: -_1 = source_elements _2 = Leof + _1 = source_elements _2 = Leof { (Program ((default_annotation (sndo3 _1) _2), (fsto3 _1)))} source_elements: -_1 = Leof + _1 = Leof { ( ([], _1, _1))} | _1 = source_element { ( ([fsto3 _1], sndo3 _1, trdo3 _1) )} @@ -249,14 +249,14 @@ _1 = Leof sndo3 _1, trdo3 _2) )} source_element: -_1 = statement + _1 = statement { ((Statement ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), sndo3 _1, trdo3 _1))} | _1 = function_declaration { (_1)} function_declaration: -_1 = KWfunction _2 = identifier _3 = Llparen _4 = formal_parameter_list _5 = Lrparen _6 = Llbrace _7 = function_body _8 = Lrbrace + _1 = KWfunction _2 = identifier _3 = Llparen _4 = formal_parameter_list _5 = Lrparen _6 = Llbrace _7 = function_body _8 = Lrbrace { ((Function_declaration ((default_annotation _1 _8),"",fsto3 _2, fsto3 _4,None, fsto3 _7), _1, _8))} | _1 = LCcomment _2 = KWfunction _3 = identifier _4 = Llparen _5 = formal_parameter_list _6 = Lrparen _7 = Llbrace _8 = function_body _9 = Lrbrace @@ -264,7 +264,7 @@ _1 = KWfunction _2 = identifier _3 = Llparen _4 = formal_parameter_list _5 = Lrp fst _1, _9) )} function_expression: -_1 = KWfunction _2 = Llparen _3 = formal_parameter_list _4 = Lrparen _5 = Llbrace _6 = function_body _7 = Lrbrace + _1 = KWfunction _2 = Llparen _3 = formal_parameter_list _4 = Lrparen _5 = Llbrace _6 = function_body _7 = Lrbrace { ((Function_expression ((default_annotation _1 _7), None, None, fsto3 _3, None, fsto3 _6), _1, _7))} | _1 = KWfunction _2 = identifier _3 = Llparen _4 = formal_parameter_list _5 = Lrparen _6 = Llbrace _7 = function_body _8 = Lrbrace { ((Function_expression ((default_annotation _1 _8), None, (Some (fsto3 _2)), fsto3 _4, None, fsto3 _7), @@ -281,7 +281,7 @@ _1 = KWfunction _2 = Llparen _3 = formal_parameter_list _4 = Lrparen _5 = Llbrac _1, _9))} formal_parameter_list: - + { (([], null_annotation, null_annotation))} | _1 = identifier { (([fsto3 _1], sndo3 _1, trdo3 _1))} @@ -289,11 +289,11 @@ formal_parameter_list: { (((fsto3 _1) @ [fsto3 _3], sndo3 _1, trdo3 _3))} function_body: -_1 = source_elements + _1 = source_elements { (_1)} statement: -_1 = block + _1 = block { (_1)} | _1 = variable_statement { (_1)} @@ -325,84 +325,84 @@ _1 = block { (_1)} block: -_1 = Llbrace _2 = optional_statement_list _3 = Lrbrace + _1 = Llbrace _2 = optional_statement_list _3 = Lrbrace { ((Block ((default_annotation _1 _3), fsto3 _2), _1, _3))} optional_statement_list: - + { (([], null_annotation,null_annotation))} | _1 = non_empty_statement_list { (_1)} non_empty_statement_list: -_1 = statement + _1 = statement { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = non_empty_statement_list _2 = statement { ((((fsto3 _1) @ [fsto3 _2]), sndo3 _1, trdo3 _2))} variable_statement: -_1 = KWvar _2 = variable_declaration_list _3 = Lsemicolon + _1 = KWvar _2 = variable_declaration_list _3 = Lsemicolon { ((Variable_declaration ((default_annotation _1 _3), (fsto3 _2)), _1, _3))} variable_declaration_list: -_1 = variable_declaration + _1 = variable_declaration { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = variable_declaration_list _2 = Lcomma _3 = variable_declaration { ((((fsto3 _1) @ [fsto3 _3]), sndo3 _1, trdo3 _3))} variable_declaration_list_no_in: -_1 = variable_declaration_no_in + _1 = variable_declaration_no_in { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = variable_declaration_list_no_in _2 = Lcomma _3 = variable_declaration_no_in { ((((fsto3 _1) @ [fsto3 _3]), sndo3 _1, trdo3 _3))} variable_declaration: -_1 = identifier + _1 = identifier { ((((fsto3 _1), None), sndo3 _1, trdo3 _1))} | _1 = identifier _2 = initialiser { ((((fsto3 _1), Some (fsto3 _2)), sndo3 _1, trdo3 _2))} variable_declaration_no_in: -_1 = identifier + _1 = identifier { ((((fsto3 _1), None), sndo3 _1, trdo3 _1))} | _1 = identifier _2 = initialiser_no_in { ((((fsto3 _1), Some (fsto3 _2)), sndo3 _1, trdo3 _2))} initialiser: -_1 = Lassign _2 = assignment_expression + _1 = Lassign _2 = assignment_expression { (((fsto3 _2), _1, trdo3 _2))} initialiser_no_in: -_1 = Lassign _2 = assignment_expression_no_in + _1 = Lassign _2 = assignment_expression_no_in { (((fsto3 _2), _1, trdo3 _2))} empty_statement: -_1 = Lsemicolon + _1 = Lsemicolon { ((Skip (default_annotation _1 _1), _1, _1))} expression_statement: -_1 = init_expression _2 = Lsemicolon + _1 = init_expression _2 = Lsemicolon { ((Expression ((default_annotation (sndo3 _1) _2), (fsto3 _1)), sndo3 _1, _2))} if_statement: -_1 = KWif _2 = Llparen _3 = expression _4 = Lrparen _5 = statement _6 = KWelse _7 = statement + _1 = KWif _2 = Llparen _3 = expression _4 = Lrparen _5 = statement _6 = KWelse _7 = statement { ((If ((default_annotation _1 (trdo3 _7)), fsto3 _3, fsto3 _5, Some (fsto3 _7)), _1, trdo3 _7))} | _1 = KWif _2 = Llparen _3 = expression _4 = Lrparen _5 = statement { ((If ((default_annotation _1 (trdo3 _5)), fsto3 _3, fsto3 _5, None), _1, trdo3 _5))} switch_statement: -_1 = KWswitch _2 = Llparen _3 = expression _4 = Lrparen _5 = case_block + _1 = KWswitch _2 = Llparen _3 = expression _4 = Lrparen _5 = case_block { ((Switch ((default_annotation _1 (trdo3 _5)), fsto3 _3, (fsto3 (fsto3 _5)), (sndo3 (fsto3 _5)), (trdo3 (fsto3 _5))), _1, trdo3 _5))} case_block: -_1 = Llbrace _2 = case_clauses _3 = Lrbrace + _1 = Llbrace _2 = case_clauses _3 = Lrbrace { (((fsto3 _2, None, []), _1, _3))} | _1 = Llbrace _2 = Lrbrace { ((([], None, []), _1, _2))} @@ -416,25 +416,25 @@ _1 = Llbrace _2 = case_clauses _3 = Lrbrace { (((fsto3 _2, Some (fsto3 _3), fsto3 _4), _1, _5))} case_clauses: -_1 = case_clause + _1 = case_clause { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = case_clauses _2 = case_clause { (((fsto3 _1) @ [fsto3 _2], sndo3 _1, trdo3 _2))} case_clause: -_1 = KWcase _2 = expression _3 = Lcolon + _1 = KWcase _2 = expression _3 = Lcolon { (((fsto3 _2, None), _1, _3))} | _1 = KWcase _2 = expression _3 = Lcolon _4 = non_empty_statement_list { (((fsto3 _2, Some (fsto3 _4)), _1, trdo3 _4))} default_clause: -_1 = KWdefault _2 = Lcolon + _1 = KWdefault _2 = Lcolon { ((None, _1, _2))} | _1 = KWdefault _2 = Lcolon _3 = non_empty_statement_list { ((Some (fsto3 _3), _1, trdo3 _3))} iteration_statement: -_1 = KWdo _2 = statement _3 = KWwhile _4 = Llparen _5 = expression _6 = Lrparen _7 = Lsemicolon + _1 = KWdo _2 = statement _3 = KWwhile _4 = Llparen _5 = expression _6 = Lrparen _7 = Lsemicolon { ((Do ((default_annotation _1 _7), fsto3 _2, fsto3 _5), _1, _7))} | _1 = KWwhile _2 = Llparen _3 = expression _4 = Lrparen _5 = statement { ((While ((default_annotation _1 (trdo3 _5)), fsto3 _3, fsto3 _5), _1, trdo3 _5))} @@ -452,7 +452,7 @@ _1 = KWdo _2 = statement _3 = KWwhile _4 = Llparen _5 = expression _6 = Lrparen _1, trdo3 _9))} for_bracket: -_1 = optional_expression_no_in _2 = Lsemicolon _3 = optional_expression _4 = Lsemicolon _5 = optional_expression + _1 = optional_expression_no_in _2 = Lsemicolon _3 = optional_expression _4 = Lsemicolon _5 = optional_expression { ((Regular ((default_annotation (sndo3 _1) (trdo3 _5)), fsto3 _1, fsto3 _3, fsto3 _5), sndo3 _1, trdo3 _5))} | _1 = KWvar _2 = variable_declaration_list_no_in _3 = Lsemicolon _4 = optional_expression _5 = Lsemicolon _6 = optional_expression @@ -466,19 +466,19 @@ _1 = optional_expression_no_in _2 = Lsemicolon _3 = optional_expression _4 = Lse _1, trdo3 _4))} optional_expression: - + { ((None, null_annotation, null_annotation))} | _1 = expression { ((Some (fsto3 _1), sndo3 _1, trdo3 _1))} optional_expression_no_in: - + { ((None, null_annotation, null_annotation))} | _1 = expression_no_in { ((Some (fsto3 _1), sndo3 _1, trdo3 _1))} continue_statement: -_1 = KWcontinue _2 = identifier _3 = Lsemicolon + _1 = KWcontinue _2 = identifier _3 = Lsemicolon { (if (different_line _1 (sndo3 _2)) then raise_parse_error("Illegal line terminator in line "^(string_of_starting_line _1)) else (Continue ((default_annotation _1 _3),Some (fsto3 _2)), _1, _3))} @@ -488,7 +488,7 @@ _1 = KWcontinue _2 = identifier _3 = Lsemicolon else (Continue ((default_annotation _1 _2), None), _1, _2))} break_statement: -_1 = KWbreak _2 = identifier _3 = Lsemicolon + _1 = KWbreak _2 = identifier _3 = Lsemicolon { (if (different_line (sndo3 _2) _1) then raise_parse_error("Illegal line terminator in line "^(string_of_starting_line _1)) else (Break ((default_annotation _1 _3), Some (fsto3 _2)), _1, _3))} @@ -498,7 +498,7 @@ _1 = KWbreak _2 = identifier _3 = Lsemicolon else (Break ((default_annotation _1 _2), None), _1, _2))} return_statement: -_1 = KWreturn _2 = expression _3 = Lsemicolon + _1 = KWreturn _2 = expression _3 = Lsemicolon { (if different_line (sndo3 _2) _1 then raise_parse_error("Illegal line terminator in line "^(string_of_starting_line _1)) else (Return ((default_annotation _1 _3), Some (fsto3 _2)), _1, _3))} @@ -508,11 +508,11 @@ _1 = KWreturn _2 = expression _3 = Lsemicolon else (Return ((default_annotation _1 _2), None), _1, _2))} with_statement: -_1 = KWwith _2 = Llparen _3 = expression _4 = Lrparen _5 = statement + _1 = KWwith _2 = Llparen _3 = expression _4 = Lrparen _5 = statement { ((With ((default_annotation _1 (trdo3 _5)), fsto3 _3, fsto3 _5), _1, trdo3 _5))} labelled_statement: -_1 = identifier _2 = Lcolon _3 = statement + _1 = identifier _2 = Lcolon _3 = statement { ((Labelled_statement ((default_annotation (sndo3 _1) (trdo3 _3)), @@ -520,13 +520,13 @@ _1 = identifier _2 = Lcolon _3 = statement sndo3 _1, trdo3 _3))} throw_statement: -_1 = KWthrow _2 = expression _3 = Lsemicolon + _1 = KWthrow _2 = expression _3 = Lsemicolon { (if (different_line (sndo3 _2) _1) then raise_parse_error("Illegal line terminator in line "^(string_of_starting_line _1)) else (Throw ((default_annotation _1 _3), fsto3 _2), _1, _3))} try_statement: -_1 = KWtry _2 = block _3 = catch_prod + _1 = KWtry _2 = block _3 = catch_prod { ((Try_catch_finally ((default_annotation _1 (trdo3 _3)), fsto3 _2, (Some (fsto3 _3)), None), _1, trdo3 _3))} @@ -540,54 +540,54 @@ _1 = KWtry _2 = block _3 = catch_prod _1, trdo3 _4))} catch_prod: -_1 = KWcatch _2 = Llparen _3 = identifier _4 = Lrparen _5 = block + _1 = KWcatch _2 = Llparen _3 = identifier _4 = Lrparen _5 = block { (((fsto3 _3, fsto3 _5), _1, trdo3 _5))} finally_prod: -_1 = KWfinally _2 = block + _1 = KWfinally _2 = block { ((fsto3 _2, _1, trdo3 _2))} default_xml_namespace_statement: -_1 = CKWdefaultxmlnamespace _2 = Lassign _3 = expression _4 = Lsemicolon + _1 = CKWdefaultxmlnamespace _2 = Lassign _3 = expression _4 = Lsemicolon { ((DefaultXMLNamespace ((default_annotation _1 _4), fsto3 _3), _1, _4))} expression: -_1 = sequence_of_expression + _1 = sequence_of_expression { ( (Sequence ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), sndo3 _1, trdo3 _1) )} expression_no_in: -_1 = sequence_of_expression_no_in + _1 = sequence_of_expression_no_in { ((Sequence ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), sndo3 _1, trdo3 _1))} init_expression: -_1 = sequence_of_init_expression + _1 = sequence_of_init_expression { ((Sequence ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), sndo3 _1, trdo3 _1))} sequence_of_expression: -_1 = assignment_expression + _1 = assignment_expression { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = sequence_of_expression _2 = Lcomma _3 = assignment_expression { (((fsto3 _1) @ [fsto3 _3], sndo3 _1, trdo3 _3))} sequence_of_expression_no_in: -_1 = assignment_expression_no_in + _1 = assignment_expression_no_in { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = sequence_of_expression_no_in _2 = Lcomma _3 = assignment_expression_no_in { (((fsto3 _1) @ [fsto3 _3], sndo3 _1, trdo3 _3))} sequence_of_init_expression: -_1 = assignment_init_expression + _1 = assignment_init_expression { (([fsto3 _1], sndo3 _1, trdo3 _1))} | _1 = sequence_of_init_expression _2 = Lcomma _3 = assignment_expression { (((fsto3 _1) @ [fsto3 _3], sndo3 _1, trdo3 _3))} member_expression: -_1 = primary_expression + _1 = primary_expression { (_1)} | _1 = function_expression { (_1)} @@ -616,7 +616,7 @@ _1 = primary_expression sndo3 _1, _5))} member_init_expression: -_1 = primary_init_expression + _1 = primary_init_expression { (_1)} | _1 = member_init_expression _2 = Llbracket _3 = expression _4 = Lrbracket { ((Array_access ((default_annotation (sndo3 _1) _4), fsto3 _1, fsto3 _3), @@ -644,7 +644,7 @@ _1 = primary_init_expression sndo3 _1, _5))} primary_expression: -_1 = KWthis + _1 = KWthis { ( (This _1,_1,_1))} | _1 = identifier { ((Variable ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), sndo3 _1, trdo3 _1))} @@ -667,7 +667,7 @@ _1 = KWthis { (_1)} primary_init_expression: -_1 = KWthis + _1 = KWthis { ( (This _1,_1,_1))} | _1 = identifier { ((Variable ((default_annotation (sndo3 _1) (trdo3 _1)), fsto3 _1), @@ -682,7 +682,7 @@ _1 = KWthis { ((fsto3 _2, _1, _3))} literal: -_1 = numeric_literal + _1 = numeric_literal { (_1)} | _1 = Lnull { ((Null (default_annotation _1 _1), _1, _1))} @@ -695,20 +695,20 @@ _1 = numeric_literal (fst _1), (fst _1)))} numeric_literal: -_1 = Lfloat + _1 = Lfloat { ((Number ((default_annotation (fst _1) (fst _1)), (snd _1)), fst _1, fst _1))} | _1 = Lint { ((Number ((default_annotation (fst _1) (fst _1)), (float_of_int (snd _1))), fst _1, fst _1))} array_literal: -_1 = Llbracket _2 = Lrbracket + _1 = Llbracket _2 = Lrbracket { (([], _1, _2))} | _1 = Llbracket _2 = non_empty_element_list _3 = Lrbracket { ((fsto3 _2, _1, _3))} non_empty_element_list: -_1 = assignment_expression + _1 = assignment_expression { (([Some (fsto3 _1)], sndo3 _1, trdo3 _1))} | _1 = non_empty_element_list _2 = Lcomma _3 = assignment_expression { (((fsto3 _1) @ [Some (fsto3 _3)], sndo3 _1, trdo3 _3))} @@ -718,17 +718,17 @@ _1 = assignment_expression { (((fsto3 _1) @ [(fsto3 _3)], sndo3 _1, trdo3 _3))} elision: -_1 = Lcomma + _1 = Lcomma { ((None, _1, _1))} object_literal: -_1 = Llbrace _2 = Lrbrace + _1 = Llbrace _2 = Lrbrace { (([], _1, _2))} | _1 = Llbrace _2 = property_name_and_value_list _3 = Lrbrace { ((fsto3 _2, _1, _3))} identifier: -_1 = Lident + _1 = Lident { ((Identifier ((default_annotation (fst _1) (fst _1)), (snd _1)), fst _1, fst _1))} | _1 = CKWeach { ((Identifier ((default_annotation _1 _1),"each"), _1, _1))} @@ -738,7 +738,7 @@ _1 = Lident { ((Identifier ((default_annotation _1 _1),"xml"), _1, _1))} property_identifier: -_1 = attribute_identifier + _1 = attribute_identifier { (_1)} | _1 = qualified_identifier { (_1)} @@ -746,7 +746,7 @@ _1 = attribute_identifier { (_1)} attribute_identifier: -_1 = Lat _2 = property_selector + _1 = Lat _2 = property_selector { ((AttributeIdentifier ((default_annotation _1 (trdo3 _2)), (fsto3 _2)), _1, trdo3 _2))} | _1 = Lat _2 = qualified_identifier { ((AttributeIdentifier ((default_annotation _1 (trdo3 _2)), (fsto3 _2)), _1, trdo3 _2))} @@ -754,13 +754,13 @@ _1 = Lat _2 = property_selector { ((AttributeIdentifierExp ((default_annotation _1 _4), (fsto3 _3)), _1, _4))} property_selector: -_1 = identifier + _1 = identifier { (_1)} | _1 = wildcard_identifier { (_1)} qualified_identifier: -_1 = property_selector _2 = Ldcolon _3 = property_selector + _1 = property_selector _2 = Ldcolon _3 = property_selector { ((QualifiedIdentifier ((default_annotation (sndo3 _1) (trdo3 _3)), (fsto3 _1), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -769,11 +769,11 @@ _1 = property_selector _2 = Ldcolon _3 = property_selector sndo3 _1, _5))} wildcard_identifier: -_1 = Lstar + _1 = Lstar { ((Wildcard (default_annotation _1 _1), _1, _1))} xml_initialiser: -_1 = xml_markup + _1 = xml_markup { (((XMLInitialiser ((default_annotation (sndo3 _1) (trdo3 _1)),(fsto3 _1))), sndo3 _1, trdo3 _1))} | _1 = xml_element @@ -781,7 +781,7 @@ _1 = xml_markup sndo3 _1, trdo3 _1))} xml_element: -_1 = XMLotag_open _2 = xml_tag_content_option _3 = XMLempty_tag_close + _1 = XMLotag_open _2 = xml_tag_content_option _3 = XMLempty_tag_close { ((XMLElementEmpty ((default_annotation _1 _3), (fsto3 _2)), _1, _3))} | _1 = XMLotag_open _2 = xml_tag_content_option _3 = XMLtag_close _4 = xml_element_content _5 = XMLctag_open _6 = xml_tag_content_option _7 = XMLtag_close { ((XMLElement ((default_annotation _1 _7),(fsto3 _2), Some (fsto3 _4), (fsto3 _6)), @@ -790,7 +790,7 @@ _1 = XMLotag_open _2 = xml_tag_content_option _3 = XMLempty_tag_close { ((XMLElement ((default_annotation _1 _6),(fsto3 _2), None, (fsto3 _5)), _1, _6))} xml_element_content: -_1 = xml_markup + _1 = xml_markup { ((XMLElementContent ((default_annotation (sndo3 _1) (trdo3 _1)), (fsto3 _1), None), sndo3 _1, trdo3 _1))} | _1 = xml_markup _2 = xml_element_content @@ -824,17 +824,17 @@ _1 = xml_markup _1, _3))} xml_list_initialiser: -_1 = XMLotag_open _2 = XMLtag_close _3 = xml_element_content _4 = XMLctag_open _5 = XMLtag_close + _1 = XMLotag_open _2 = XMLtag_close _3 = xml_element_content _4 = XMLctag_open _5 = XMLtag_close { ((XMLListInitialiser ((default_annotation _1 _5),(fsto3 _3)), _1, _5))} xml_tag_content_option: -_1 = xml_tag_content + _1 = xml_tag_content { (([(fsto3 _1)], sndo3 _1, trdo3 _1))} | _1 = xml_tag_content _2 = xml_tag_content_option { (([(fsto3 _1)] @ (fsto3 _2), sndo3 _1, trdo3 _2))} xml_tag_content: -_1 = XMLtag_chars + _1 = XMLtag_chars { ((XMLTagChars ((default_annotation (fst _1) (fst _1)),(snd _1)), fst _1, fst _1))} | _1 = XMLwhitespace { ((XMLWhitespace (default_annotation _1 _1), _1, _1))} @@ -846,7 +846,7 @@ _1 = XMLtag_chars { ((XMLAssignAttr ((default_annotation _1 (fst _2)), (snd _2)), _1, fst _2))} xml_markup: -_1 = XMLcomment + _1 = XMLcomment { ((XMLComment ((default_annotation (fst _1) (fst _1)),(snd _1)), fst _1, fst _1))} | _1 = XMLcdata { ((XMLCDATA ((default_annotation (fst _1) (fst _1)),(snd _1)), fst _1, fst _1))} @@ -854,13 +854,13 @@ _1 = XMLcomment { ((XMLPI ((default_annotation (fst _1) (fst _1)),(snd _1)), fst _1, fst _1))} property_name_and_value_list: -_1 = property_name _2 = Lcolon _3 = assignment_expression + _1 = property_name _2 = Lcolon _3 = assignment_expression { (([((fsto3 _1), (fsto3 _3))], sndo3 _1, trdo3 _3))} | _1 = property_name_and_value_list _2 = Lcomma _3 = property_name _4 = Lcolon _5 = assignment_expression { (((fsto3 _1) @ [((fsto3 _3), (fsto3 _5))], sndo3 _1, trdo3 _5))} property_name: -_1 = identifier + _1 = identifier { (((DynamicName ((default_annotation (sndo3 _1) (trdo3 _1)),(fsto3 _1))), sndo3 _1, trdo3 _1))} | _1 = Lstring @@ -872,7 +872,7 @@ _1 = identifier sndo3 _1, trdo3 _1))} new_expression: -_1 = member_expression + _1 = member_expression { (_1)} | _1 = KWnew _2 = new_expression { ((New_expression ((default_annotation _1 (trdo3 _2)), @@ -880,7 +880,7 @@ _1 = member_expression _1, trdo3 _2))} new_init_expression: -_1 = member_init_expression + _1 = member_init_expression { (_1)} | _1 = KWnew _2 = new_expression { ((New_expression ((default_annotation _1 (trdo3 _2)), @@ -888,7 +888,7 @@ _1 = member_init_expression _1, trdo3 _2))} call_expression: -_1 = member_expression _2 = arguments + _1 = member_expression _2 = arguments { ((Function_call ((default_annotation (sndo3 _1) (trdo3 _2)), (fsto3 _1), (fsto3 _2)), sndo3 _1, trdo3 _2))} @@ -922,7 +922,7 @@ _1 = member_expression _2 = arguments sndo3 _1, _5))} call_init_expression: -_1 = member_init_expression _2 = arguments + _1 = member_init_expression _2 = arguments { ((Function_call ((default_annotation (sndo3 _1) (trdo3 _2)), (fsto3 _1), (fsto3 _2)), sndo3 _1, trdo3 _2))} @@ -956,31 +956,31 @@ _1 = member_init_expression _2 = arguments sndo3 _1, _5))} arguments: -_1 = Llparen _2 = Lrparen + _1 = Llparen _2 = Lrparen { (([], _1, _2))} | _1 = Llparen _2 = argument_list _3 = Lrparen { (((fsto3 _2), _1, _3))} argument_list: -_1 = assignment_expression + _1 = assignment_expression { (([(fsto3 _1)], sndo3 _1, trdo3 _1))} | _1 = argument_list _2 = Lcomma _3 = assignment_expression { (((fsto3 _1) @ [(fsto3 _3)], sndo3 _1, trdo3 _3))} left_hand_side_expression: -_1 = new_expression + _1 = new_expression { (_1)} | _1 = call_expression { (_1)} left_hand_side_init_expression: -_1 = new_init_expression + _1 = new_init_expression { (_1)} | _1 = call_init_expression { (_1)} postfix_expression: -_1 = left_hand_side_expression + _1 = left_hand_side_expression { (_1)} | _1 = left_hand_side_expression _2 = Lincr { ( if (different_line (trdo3 _1) _2) @@ -996,7 +996,7 @@ _1 = left_hand_side_expression sndo3 _1, _2))} postfix_init_expression: -_1 = left_hand_side_init_expression + _1 = left_hand_side_init_expression { (_1)} | _1 = left_hand_side_init_expression _2 = Lincr { (if (different_line (sndo3 _1) _2) @@ -1012,7 +1012,7 @@ _1 = left_hand_side_init_expression sndo3 _1, _2))} unary_expression: -_1 = postfix_expression + _1 = postfix_expression { (_1)} | _1 = KWdelete _2 = unary_expression { ((Unop ((default_annotation _1 (trdo3 _2)),(fsto3 _2), @@ -1052,7 +1052,7 @@ _1 = postfix_expression _1, trdo3 _2))} unary_init_expression: -_1 = postfix_init_expression + _1 = postfix_init_expression { (_1)} | _1 = KWdelete _2 = unary_expression { ((Unop ((default_annotation _1 (trdo3 _2)),(fsto3 _2), @@ -1092,7 +1092,7 @@ _1 = postfix_init_expression _1, trdo3 _2))} multiplicative_expression: -_1 = unary_expression + _1 = unary_expression { (_1)} | _1 = multiplicative_expression _2 = Lstar _3 = unary_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Star (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1102,7 +1102,7 @@ _1 = unary_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Rem (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} multiplicative_init_expression: -_1 = unary_init_expression + _1 = unary_init_expression { (_1)} | _1 = multiplicative_init_expression _2 = Lstar _3 = unary_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Star (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1112,7 +1112,7 @@ _1 = unary_init_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Rem (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} additive_expression: -_1 = multiplicative_expression + _1 = multiplicative_expression { (_1)} | _1 = additive_expression _2 = Lplus _3 = multiplicative_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Plus (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1120,7 +1120,7 @@ _1 = multiplicative_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Minus (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} additive_init_expression: -_1 = multiplicative_init_expression + _1 = multiplicative_init_expression { (_1)} | _1 = additive_init_expression _2 = Lplus _3 = multiplicative_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Plus (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1128,7 +1128,7 @@ _1 = multiplicative_init_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Minus (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} shift_expression: -_1 = additive_expression + _1 = additive_expression { (_1)} | _1 = shift_expression _2 = Llshift _3 = additive_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Lshift (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1138,7 +1138,7 @@ _1 = additive_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Runsignedshift (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} shift_init_expression: -_1 = additive_init_expression + _1 = additive_init_expression { (_1)} | _1 = shift_init_expression _2 = Llshift _3 = additive_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Lshift (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1148,7 +1148,7 @@ _1 = additive_init_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Runsignedshift (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} relational_expression: -_1 = shift_expression + _1 = shift_expression { (_1)} | _1 = relational_expression _2 = Lless _3 = shift_expression { ( (Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Less (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1164,7 +1164,7 @@ _1 = shift_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), In (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} relational_expression_no_in: -_1 = shift_expression + _1 = shift_expression { (_1)} | _1 = relational_expression_no_in _2 = Lless _3 = shift_expression { ( (Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Less (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1178,7 +1178,7 @@ _1 = shift_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Instanceof (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} relational_init_expression: -_1 = shift_init_expression + _1 = shift_init_expression { (_1)} | _1 = relational_init_expression _2 = Lless _3 = shift_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Less (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1194,7 +1194,7 @@ _1 = shift_init_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), In (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} equality_expression: -_1 = relational_expression + _1 = relational_expression { (_1)} | _1 = equality_expression _2 = Leq _3 = relational_expression {((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Eq (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1206,7 +1206,7 @@ _1 = relational_expression {((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Neq (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} equality_expression_no_in: -_1 = relational_expression_no_in + _1 = relational_expression_no_in { (_1)} | _1 = equality_expression_no_in _2 = Leq _3 = relational_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Eq (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1218,7 +1218,7 @@ _1 = relational_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Neq (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} equality_init_expression: -_1 = relational_init_expression + _1 = relational_init_expression { (_1)} | _1 = equality_init_expression _2 = Leq _3 = relational_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Eq (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} @@ -1230,97 +1230,97 @@ _1 = relational_init_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Neq (default_annotation _2 _2) , (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_and_expression: -_1 = equality_expression + _1 = equality_expression { (_1)} | _1 = bitwise_and_expression _2 = Lbit_and _3 = equality_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_and_expression_no_in: -_1 = equality_expression_no_in + _1 = equality_expression_no_in { (_1)} | _1 = bitwise_and_expression_no_in _2 = Lbit_and _3 = equality_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_and_init_expression: -_1 = equality_init_expression + _1 = equality_init_expression { (_1)} | _1 = bitwise_and_init_expression _2 = Lbit_and _3 = equality_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_xor_expression: -_1 = bitwise_and_expression + _1 = bitwise_and_expression { (_1)} | _1 = bitwise_xor_expression _2 = Lxor _3 = bitwise_and_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Xor (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_xor_expression_no_in: -_1 = bitwise_and_expression_no_in + _1 = bitwise_and_expression_no_in { (_1)} | _1 = bitwise_xor_expression_no_in _2 = Lxor _3 = bitwise_and_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Xor (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_xor_init_expression: -_1 = bitwise_and_init_expression + _1 = bitwise_and_init_expression { (_1)} | _1 = bitwise_xor_init_expression _2 = Lxor _3 = bitwise_and_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Xor (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_or_expression: -_1 = bitwise_xor_expression + _1 = bitwise_xor_expression { (_1)} | _1 = bitwise_or_expression _2 = Lbit_or _3 = bitwise_xor_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_or_expression_no_in: -_1 = bitwise_xor_expression_no_in + _1 = bitwise_xor_expression_no_in { (_1)} | _1 = bitwise_or_expression_no_in _2 = Lbit_or _3 = bitwise_xor_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} bitwise_or_init_expression: -_1 = bitwise_xor_init_expression + _1 = bitwise_xor_init_expression { (_1)} | _1 = bitwise_or_init_expression _2 = Lbit_or _3 = bitwise_xor_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Bit_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_and_expression: -_1 = bitwise_or_expression + _1 = bitwise_or_expression { (_1)} | _1 = logical_and_expression _2 = Lsc_and _3 = bitwise_or_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_and_expression_no_in: -_1 = bitwise_or_expression_no_in + _1 = bitwise_or_expression_no_in { (_1)} | _1 = logical_and_expression_no_in _2 = Lsc_and _3 = bitwise_or_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_and_init_expression: -_1 = bitwise_or_init_expression + _1 = bitwise_or_init_expression { (_1)} | _1 = logical_and_init_expression _2 = Lsc_and _3 = bitwise_or_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_and (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_or_expression: -_1 = logical_and_expression + _1 = logical_and_expression { (_1)} | _1 = logical_or_expression _2 = Lsc_or _3 = logical_and_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_or_expression_no_in: -_1 = logical_and_expression_no_in + _1 = logical_and_expression_no_in { (_1)} | _1 = logical_or_expression_no_in _2 = Lsc_or _3 = logical_and_expression_no_in { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} logical_or_init_expression: -_1 = logical_and_init_expression + _1 = logical_and_init_expression { (_1)} | _1 = logical_or_init_expression _2 = Lsc_or _3 = logical_and_expression { ((Binop ((default_annotation (sndo3 _1) (trdo3 _3)),(fsto3 _1), Sc_or (default_annotation _2 _2), (fsto3 _3)), sndo3 _1, trdo3 _3))} conditional_expression: -_1 = logical_or_expression + _1 = logical_or_expression { (_1)} | _1 = logical_or_expression _2 = Lhook _3 = assignment_expression _4 = Lcolon _5 = assignment_expression { ((Conditional ((default_annotation (sndo3 _1) (trdo3 _5)), @@ -1328,7 +1328,7 @@ _1 = logical_or_expression sndo3 _1, trdo3 _5))} conditional_expression_no_in: -_1 = logical_or_expression_no_in + _1 = logical_or_expression_no_in { (_1)} | _1 = logical_or_expression_no_in _2 = Lhook _3 = assignment_expression_no_in _4 = Lcolon _5 = assignment_expression_no_in { ((Conditional ((default_annotation (sndo3 _1) (trdo3 _5)), @@ -1336,7 +1336,7 @@ _1 = logical_or_expression_no_in sndo3 _1, trdo3 _5))} conditional_init_expression: -_1 = logical_or_init_expression + _1 = logical_or_init_expression { (_1)} | _1 = logical_or_init_expression _2 = Lhook _3 = assignment_expression _4 = Lcolon _5 = assignment_expression { ((Conditional ((default_annotation (sndo3 _1) (trdo3 _5)), @@ -1344,7 +1344,7 @@ _1 = logical_or_init_expression sndo3 _1, trdo3 _5))} assignment_expression: -_1 = conditional_expression + _1 = conditional_expression { (_1)} | _1 = left_hand_side_expression _2 = assignment_operator _3 = assignment_expression { ((Assign ((default_annotation (sndo3 _1) (trdo3 _3)), @@ -1352,7 +1352,7 @@ _1 = conditional_expression sndo3 _1, trdo3 _3))} assignment_expression_no_in: -_1 = conditional_expression_no_in + _1 = conditional_expression_no_in { (_1)} | _1 = left_hand_side_expression _2 = assignment_operator _3 = assignment_expression_no_in { ((Assign ((default_annotation (sndo3 _1) (trdo3 _3)), @@ -1360,7 +1360,7 @@ _1 = conditional_expression_no_in sndo3 _1, trdo3 _3))} assignment_init_expression: -_1 = conditional_init_expression + _1 = conditional_init_expression { (_1)} | _1 = left_hand_side_init_expression _2 = assignment_operator _3 = assignment_expression { ((Assign ((default_annotation (sndo3 _1) (trdo3 _3)), @@ -1368,7 +1368,7 @@ _1 = conditional_init_expression sndo3 _1, trdo3 _3))} assignment_operator: -_1 = Lassign + _1 = Lassign { ((Regular_assign (default_annotation _1 _1), _1, _1))} | _1 = Lstarassign { ((Star_assign (default_annotation _1 _1), _1, _1))} diff --git a/bench/good/K3Parser.opp.exp b/bench/good/K3Parser.opp.exp index 75a69f7c11b4fd162dcd7a4edf5701677a63ecc2..edba6f9c08904b172cc90ccba76312383e9780f8 100644 --- a/bench/good/K3Parser.opp.exp +++ b/bench/good/K3Parser.opp.exp @@ -254,13 +254,13 @@ Warning: symbol integer_list is unreachable from any of the start symbol(s). %% program: -_1 = declaration + _1 = declaration { ( if !numerrors>=1 then raise Exit else [_1, []] )} | _1 = declaration _2 = program { ( (_1, []) :: _2 )} declaration: -_1 = DECLARE _2 = IDENTIFIER _3 = COLON _4 = type_expr + _1 = DECLARE _2 = IDENTIFIER _3 = COLON _4 = type_expr { ( Global(_2, _4, None) )} | _1 = DECLARE _2 = IDENTIFIER _3 = COLON _4 = type_expr _5 = GETS _6 = anno_expr { ( Global(_2, _4, Some _6) )} @@ -294,13 +294,13 @@ _1 = DECLARE _2 = IDENTIFIER _3 = COLON _4 = type_expr { ( id_error() )} flow_program: -_1 = flow_statement + _1 = flow_statement { ( [_1, []] )} | _1 = flow_statement _2 = flow_program { ( (_1,[]) :: _2 )} flow_statement: -_1 = resource + _1 = resource { ( _1 )} | _1 = instruction { ( Instruction(_1) )} @@ -333,11 +333,11 @@ _1 = resource { ( print_error("Invalid bind source") )} instruction: -_1 = CONSUME _2 = IDENTIFIER + _1 = CONSUME _2 = IDENTIFIER { ( Consume(_2) )} resource: -_1 = SOURCE _2 = IDENTIFIER _3 = COLON _4 = type_expr _5 = GETS _6 = handle + _1 = SOURCE _2 = IDENTIFIER _3 = COLON _4 = type_expr _5 = GETS _6 = handle { ( let channel_type, channel_format = _6 in Source(Resource(_2, Handle(_4, channel_type, channel_format))) @@ -361,19 +361,19 @@ _1 = SOURCE _2 = IDENTIFIER _3 = COLON _4 = type_expr _5 = GETS _6 = handle )} handle: -_1 = FILE _2 = LPAREN _3 = STRING _4 = COMMA _5 = IDENTIFIER _6 = RPAREN + _1 = FILE _2 = LPAREN _3 = STRING _4 = COMMA _5 = IDENTIFIER _6 = RPAREN { ( File(_3), parse_format _5 )} | _1 = SOCKET _2 = LPAREN _3 = STRING _4 = COMMA _5 = INTEGER _6 = COMMA _7 = IDENTIFIER _8 = RPAREN { ( Network(_3, _5), parse_format _7 )} stream: -_1 = STREAM _2 = LPAREN _3 = anno_expr _4 = RPAREN + _1 = STREAM _2 = LPAREN _3 = anno_expr _4 = RPAREN { ( ConstStream(_3) )} | _1 = RANDOM _2 = LPAREN _3 = INTEGER _4 = RPAREN { ( RandomStream(_3) )} resource_pattern: -_1 = IDENTIFIER + _1 = IDENTIFIER { ( Terminal(_1) )} | _1 = LPAREN _2 = resource_pattern _3 = RPAREN { ( _2 )} @@ -393,17 +393,17 @@ _1 = IDENTIFIER )} annotations: -_1 = annotation + _1 = annotation { ( [_1] )} | _1 = annotation _2 = SEMICOLON _3 = annotations { ( _1::_3 )} annotation: -_1 = identifier_stream + _1 = identifier_stream { ( Property(String.concat " " _1) )} type_expr: -_1 = type_expr _2 = RARROW _3 = fn_type_expr_list %prec UMINUS + _1 = type_expr _2 = RARROW _3 = fn_type_expr_list %prec UMINUS { ( let is, o = list_split (-1) (_1::_3) in match (hd o).typ with | TFunction(is', o') -> wrap_tfunc (is@is') o' @@ -425,29 +425,29 @@ _1 = type_expr _2 = RARROW _3 = fn_type_expr_list %prec UMINUS { ( let c, anno = _1 in { (canonical c) with anno} )} fn_type_expr_list: -_1 = type_expr _2 = RARROW _3 = fn_type_expr_list + _1 = type_expr _2 = RARROW _3 = fn_type_expr_list { ( _1 :: _3 )} | _1 = type_expr { ( [_1] )} type_expr_tuple: -_1 = type_expr_list + _1 = type_expr_list { ( wrap_ttuple _1 )} type_expr_list: -_1 = type_expr + _1 = type_expr { ( [_1] )} | _1 = type_expr _2 = COMMA _3 = type_expr_list { ( _1 :: _3 )} annotated_collection_type: -_1 = collection_type + _1 = collection_type { ( _1, [] )} | _1 = collection_type _2 = ANNOTATE _3 = LBRACE _4 = annotations _5 = RBRACE { ( _1, _4 )} collection_type: -_1 = LBRACE _2 = type_expr _3 = RBRACE + _1 = LBRACE _2 = type_expr _3 = RBRACE { ( TCollection(TSet, _2) )} | _1 = LBRACE _2 = type_expr_tuple _3 = RBRACE { ( TCollection(TSet, _2) )} @@ -485,25 +485,25 @@ _1 = LBRACE _2 = type_expr _3 = RBRACE { ( TCollection(TSortedSet, _2) )} int_list_list: -_1 = int_list + _1 = int_list { ([_1])} | _1 = int_list _2 = SEMICOLON _3 = int_list_list { ( _1::_3 )} int_list: -_1 = INTEGER + _1 = INTEGER { ([_1])} | _1 = INTEGER _2 = COMMA _3 = int_list { ( _1::_3 )} anno_expr: -_1 = expr _2 = ANNOTATE _3 = LBRACE _4 = annotations _5 = RBRACE + _1 = expr _2 = ANNOTATE _3 = LBRACE _4 = annotations _5 = RBRACE { ( K3Util.add_annos _4 _1 )} | _1 = expr { ( _1 )} expr: -_1 = LPAREN _2 = tuple _3 = RPAREN + _1 = LPAREN _2 = tuple _3 = RPAREN { ( _2 )} | _1 = block { ( _1 )} @@ -571,47 +571,47 @@ _1 = LPAREN _2 = tuple _3 = RPAREN { ( print_error("Function application error") )} id_unknown: -_1 = UNKNOWN + _1 = UNKNOWN { ( "_" )} | _1 = IDENTIFIER { ( _1 )} id_list: -_1 = id_unknown + _1 = id_unknown { ( [_1] )} | _1 = id_unknown _2 = COMMA _3 = id_list { ( _1 :: _3 )} expr_list: -_1 = anno_expr + _1 = anno_expr { ( [_1] )} | _1 = anno_expr _2 = COMMA _3 = expr_list { ( _1 :: _3 )} expr_seq: -_1 = tuple + _1 = tuple { ( [_1] )} | _1 = tuple _2 = SEMICOLON _3 = expr_seq { ( _1 :: _3 )} tuple: -_1 = expr_list + _1 = expr_list { ( if List.length _1 = 1 then List.hd _1 else mkexpr Tuple _1 )} value_typed_identifier: -_1 = IDENTIFIER _2 = COLON _3 = type_expr + _1 = IDENTIFIER _2 = COLON _3 = type_expr { ( (_1, _3) )} | _1 = IDENTIFIER _2 = COLON _3 = error { ( type_error() )} value_typed_identifier_list: -_1 = value_typed_identifier + _1 = value_typed_identifier { ( [_1] )} | _1 = value_typed_identifier _2 = COMMA _3 = value_typed_identifier_list { ( _1 :: _3 )} arg: -_1 = LPAREN _2 = arg_list _3 = RPAREN + _1 = LPAREN _2 = arg_list _3 = RPAREN { ( ATuple(_2) )} | _1 = UNKNOWN { ( AIgnored )} @@ -619,13 +619,13 @@ _1 = LPAREN _2 = arg_list _3 = RPAREN { ( AVar(fst _1, snd _1) )} arg_list: -_1 = arg + _1 = arg { ( [(_1)] )} | _1 = arg _2 = COMMA _3 = arg_list { ( _1 :: _3 )} constant: -_1 = UNKNOWN + _1 = UNKNOWN { ( CUnknown )} | _1 = UNIT { ( CUnit )} @@ -641,7 +641,7 @@ _1 = UNKNOWN { ( _1 )} range: -_1 = LBRACE _2 = anno_expr _3 = COLON _4 = COLON _5 = anno_expr _6 = COLON _7 = COLON _8 = anno_expr _9 = RBRACE + _1 = LBRACE _2 = anno_expr _3 = COLON _4 = COLON _5 = anno_expr _6 = COLON _7 = COLON _8 = anno_expr _9 = RBRACE { ( mkexpr (Range(TSet)) [_2; _5; _8] )} | _1 = LBRACEBAR _2 = anno_expr _3 = COLON _4 = COLON _5 = anno_expr _6 = COLON _7 = COLON _8 = anno_expr _9 = RBRACEBAR { ( mkexpr (Range(TBag)) [_2; _5; _8] )} @@ -651,7 +651,7 @@ _1 = LBRACE _2 = anno_expr _3 = COLON _4 = COLON _5 = anno_expr _6 = COLON _7 = { ( mkexpr (Range(TVector)) [_2; _5; _8] )} collection: -_1 = LBRACE _2 = RBRACE _3 = COLON _4 = type_expr + _1 = LBRACE _2 = RBRACE _3 = COLON _4 = type_expr { ( build_collection [] _4 )} | _1 = LBRACEBAR _2 = RBRACEBAR _3 = COLON _4 = type_expr { ( build_collection [] _4 )} @@ -699,11 +699,11 @@ _1 = LBRACE _2 = RBRACE _3 = COLON _4 = type_expr { ( build_collection _2 (mk_unknown_collection (TVMap None)) )} variable: -_1 = IDENTIFIER + _1 = IDENTIFIER { ( _1 )} address: -_1 = IDENTIFIER _2 = COLON _3 = INTEGER + _1 = IDENTIFIER _2 = COLON _3 = INTEGER { ( CAddress(_1,_3) )} | _1 = IP _2 = COLON _3 = INTEGER { ( @@ -714,7 +714,7 @@ _1 = IDENTIFIER _2 = COLON _3 = INTEGER )} arithmetic: -_1 = NEG _2 = anno_expr + _1 = NEG _2 = anno_expr { ( mkexpr Neg [_2] )} | _1 = anno_expr _2 = PLUS _3 = anno_expr { ( mkexpr Add [_1; _3] )} @@ -738,7 +738,7 @@ _1 = NEG _2 = anno_expr { ( arith_error 2 )} predicate: -_1 = NOT _2 = anno_expr + _1 = NOT _2 = anno_expr { ( mkexpr Neg [_2] )} | _1 = anno_expr _2 = AND _3 = anno_expr { ( mkexpr Mult [_1; _3] )} @@ -770,7 +770,7 @@ _1 = NOT _2 = anno_expr { ( comp_error() )} conditional: -_1 = IF _2 = anno_expr _3 = THEN _4 = anno_expr _5 = ELSE _6 = anno_expr + _1 = IF _2 = anno_expr _3 = THEN _4 = anno_expr _5 = ELSE _6 = anno_expr { ( mkexpr IfThenElse [_2; _4; _6] )} | _1 = IF _2 = anno_expr _3 = THEN _4 = anno_expr _5 = ELSE _6 = error { ( cond_error "else branch" )} @@ -780,7 +780,7 @@ _1 = IF _2 = anno_expr _3 = THEN _4 = anno_expr _5 = ELSE _6 = anno_expr { ( cond_error "predicate" )} case: -_1 = CASE _2 = anno_expr _3 = OF _4 = LBRACE _5 = JUST _6 = id_unknown _7 = RARROW _8 = anno_expr _9 = RBRACE _10 = LBRACE _11 = NOTHING _12 = RARROW _13 = anno_expr _14 = RBRACE + _1 = CASE _2 = anno_expr _3 = OF _4 = LBRACE _5 = JUST _6 = id_unknown _7 = RARROW _8 = anno_expr _9 = RBRACE _10 = LBRACE _11 = NOTHING _12 = RARROW _13 = anno_expr _14 = RBRACE { ( mk_case_sn _2 _6 _8 _13 )} | _1 = CASE _2 = anno_expr _3 = OF _4 = LBRACE _5 = NOTHING _6 = RARROW _7 = anno_expr _8 = RBRACE _9 = LBRACE _10 = JUST _11 = id_unknown _12 = RARROW _13 = anno_expr _14 = RBRACE { ( mk_case_sn _2 _11 _7 _13 )} @@ -794,7 +794,7 @@ _1 = CASE _2 = anno_expr _3 = OF _4 = LBRACE _5 = JUST _6 = id_unknown _7 = RARR { ( case_error "predicate" )} letin: -_1 = LET _2 = LPAREN _3 = id_list _4 = RPAREN _5 = GETS _6 = anno_expr _7 = IN _8 = anno_expr + _1 = LET _2 = LPAREN _3 = id_list _4 = RPAREN _5 = GETS _6 = anno_expr _7 = IN _8 = anno_expr { ( mk_let _3 _6 _8 )} | _1 = LET _2 = IDENTIFIER _3 = GETS _4 = anno_expr _5 = IN _6 = anno_expr { ( mk_let [_2] _4 _6 )} @@ -810,7 +810,7 @@ _1 = LET _2 = LPAREN _3 = id_list _4 = RPAREN _5 = GETS _6 = anno_expr _7 = IN _ { ( print_error "Let binding error" )} bind: -_1 = BIND _2 = anno_expr _3 = AS _4 = IDENTIFIER _5 = IN _6 = anno_expr + _1 = BIND _2 = anno_expr _3 = AS _4 = IDENTIFIER _5 = IN _6 = anno_expr { ( mk_bind _2 _4 _6 )} | _1 = BIND _2 = anno_expr _3 = AS _4 = IDENTIFIER _5 = IN _6 = error { ( bind_error "expr" )} @@ -824,7 +824,7 @@ _1 = BIND _2 = anno_expr _3 = AS _4 = IDENTIFIER _5 = IN _6 = anno_expr { ( bind_error "predicate" )} lambda: -_1 = BACKSLASH _2 = arg _3 = RARROW _4 = anno_expr + _1 = BACKSLASH _2 = arg _3 = RARROW _4 = anno_expr { ( mkexpr (Lambda(_2)) [_4] )} | _1 = BACKSLASH _2 = arg _3 = RARROW _4 = error { ( lambda_error "body" )} @@ -832,11 +832,11 @@ _1 = BACKSLASH _2 = arg _3 = RARROW _4 = anno_expr { ( lambda_error "argument" )} tuple_index: -_1 = anno_expr _2 = PERIOD _3 = LBRACKET _4 = INTEGER _5 = RBRACKET + _1 = anno_expr _2 = PERIOD _3 = LBRACKET _4 = INTEGER _5 = RBRACKET { ( mkexpr (Subscript _4) [_1] )} access: -_1 = anno_expr _2 = LBRACKET _3 = tuple _4 = RBRACKET + _1 = anno_expr _2 = LBRACKET _3 = tuple _4 = RBRACKET { ( mkexpr Slice [_1; _3] )} | _1 = anno_expr _2 = LBRACKETLT _3 = tuple _4 = RBRACKET { ( mkexpr SliceFrontier [_1; _3] )} @@ -852,7 +852,7 @@ _1 = anno_expr _2 = LBRACKET _3 = tuple _4 = RBRACKET { ( mkexpr MinWith [_3; _5; _7] )} mutation: -_1 = INSERT _2 = LPAREN _3 = variable _4 = COMMA _5 = tuple _6 = RPAREN + _1 = INSERT _2 = LPAREN _3 = variable _4 = COMMA _5 = tuple _6 = RPAREN { ( mkexpr Insert [mk_var _3; _5] )} | _1 = UPSERT_WITH _2 = LPAREN _3 = variable _4 = COMMA _5 = LPAREN _6 = tuple _7 = RPAREN _8 = COMMA _9 = anno_expr _10 = COMMA _11 = anno_expr _12 = RPAREN { ( mkexpr UpsertWith [mk_var _3; _6; _9; _11] )} @@ -892,7 +892,7 @@ _1 = INSERT _2 = LPAREN _3 = variable _4 = COMMA _5 = tuple _6 = RPAREN { ( assign_error "reference" )} transformers: -_1 = anno_expr _2 = CONCAT _3 = anno_expr + _1 = anno_expr _2 = CONCAT _3 = anno_expr { ( mkexpr Combine [_1; _3] )} | _1 = MAP _2 = LPAREN _3 = anno_expr _4 = COMMA _5 = anno_expr _6 = RPAREN { ( mkexpr Map [_3; _5] )} @@ -958,17 +958,17 @@ _1 = anno_expr _2 = CONCAT _3 = anno_expr { ( print_error("Invalid groupby syntax") )} block: -_1 = DO _2 = LBRACE _3 = expr_seq _4 = RBRACE + _1 = DO _2 = LBRACE _3 = expr_seq _4 = RBRACE { ( mkexpr Block _3 )} identifier_stream: -_1 = IDENTIFIER + _1 = IDENTIFIER { ([_1])} | _1 = IDENTIFIER _2 = identifier_stream { ( _1::_2 )} program_test: -_1 = program _2 = EXPECTED _3 = named_expr_list + _1 = program _2 = EXPECTED _3 = named_expr_list { ( ProgTest (_1, _3) )} | _1 = program _2 = NETWORK _3 = EXPECTED _4 = named_expr_list { ( NetworkTest (_1, _4) )} @@ -980,7 +980,7 @@ _1 = program _2 = EXPECTED _3 = named_expr_list { ( print_error "no expected values specified for program test" )} expression_test_list: -_1 = anno_expr _2 = EXPECTED _3 = check_expr + _1 = anno_expr _2 = EXPECTED _3 = check_expr { ( [[], _1, _3] )} | _1 = program _2 = anno_expr _3 = EXPECTED _4 = check_expr { ( [_1, _2, _4] )} @@ -990,11 +990,11 @@ _1 = anno_expr _2 = EXPECTED _3 = check_expr { ( print_error "invalid expected expression")} expression_test: -_1 = expression_test_list + _1 = expression_test_list { ( ExprTest _1 )} named_expr_list: -_1 = anno_expr _2 = GETS _3 = check_expr + _1 = anno_expr _2 = GETS _3 = check_expr { ( [_1, _3] )} | _1 = anno_expr _2 = GETS _3 = check_expr _4 = COMMA _5 = named_expr_list { ( _5@[_1, _3] )} @@ -1002,7 +1002,7 @@ _1 = anno_expr _2 = GETS _3 = check_expr { ( print_error "invalid check expression")} check_expr: -_1 = IDENTIFIER _2 = COLON _3 = anno_expr + _1 = IDENTIFIER _2 = COLON _3 = anno_expr { ( InlineExpr(_1, _3) )} %% diff --git a/bench/good/albatross.opp.exp b/bench/good/albatross.opp.exp index cc681a8967d142e3972770e3ac759acf02eb300c..4562afe029ee454bd7a8efe2dcc9584d320cfe09 100644 --- a/bench/good/albatross.opp.exp +++ b/bench/good/albatross.opp.exp @@ -240,19 +240,19 @@ let predicate_of_expression (info:info) (e:expression): expression = %% file: -_1 = use_block _2 = optsemi _3 = decls + _1 = use_block _2 = optsemi _3 = decls { (_1, List.rev _3)} | _1 = decls { ([], List.rev _1 )} decls: - + { ( [] )} | _1 = decls _2 = optsemi _3 = decl { ( _3::_1 )} decl: -_1 = class_declaration + _1 = class_declaration { ( _1 )} | _1 = named_feature { ( _1 )} @@ -262,7 +262,7 @@ _1 = class_declaration { ( _1 )} use_block_opt: - + { ( [] )} | _1 = decl { ( [] )} @@ -270,28 +270,28 @@ use_block_opt: { ( _1 )} use_block: -_1 = KWuse _2 = module_list _3 = KWend + _1 = KWuse _2 = module_list _3 = KWend { ( List.rev _2 )} module_list: -_1 = one_module + _1 = one_module { ( [_1] )} | _1 = one_module _2 = separator _3 = module_list { ( _1 :: _3 )} one_module: -_1 = dotted_id_list + _1 = dotted_id_list { ( withinfo (rhs_info 1) (List.hd _1, List.tl _1) )} formal_generic: -_1 = UIDENTIFIER _2 = COLON _3 = type_nt + _1 = UIDENTIFIER _2 = COLON _3 = type_nt { ( Formal_generic (withinfo (rhs_info 1) _1, withinfo (rhs_info 3) _3) )} ass_feat: -_1 = proof_all_expr + _1 = proof_all_expr { ( let entlst, req, impl, ens = _1 in let bdy = req, Some impl, ens in @@ -299,39 +299,39 @@ _1 = proof_all_expr )} ass_req: -_1 = KWrequire _2 = ass_seq + _1 = KWrequire _2 = ass_seq { ( List.rev _2 )} | _1 = KWrequire _2 = ass_seq _3 = separator { ( List.rev _2 )} ass_req_opt: - + { ( [] )} | _1 = ass_req { ( _1 )} ass_check: -_1 = KWproof _2 = proof_seq _3 = separator + _1 = KWproof _2 = proof_seq _3 = separator { ( List.rev _2 )} ass_ens: -_1 = KWensure _2 = ass_seq + _1 = KWensure _2 = ass_seq { ( List.rev _2 )} ass_seq: -_1 = info_expr + _1 = info_expr { ( [_1] )} | _1 = ass_seq _2 = separator _3 = info_expr { ( _3::_1 )} proof_seq: -_1 = proof_expr + _1 = proof_expr { ( [_1] )} | _1 = proof_seq _2 = separator _3 = proof_expr { ( _3::_1 )} proof_expr: -_1 = info_expr + _1 = info_expr { ( _1 )} | _1 = proof_expr_struct { ( _1 )} @@ -345,21 +345,21 @@ _1 = info_expr )} proof_all_expr: -_1 = KWall _2 = formal_arguments_opt _3 = opt_nl _4 = ass_req_opt _5 = ass_imp _6 = ass_ens _7 = KWend + _1 = KWall _2 = formal_arguments_opt _3 = opt_nl _4 = ass_req_opt _5 = ass_imp _6 = ass_ens _7 = KWend { ( let entlst = withinfo (rhs_info 2) _2 in entlst, _4, _5, _6 )} proof_all_expr_inner: -_1 = KWall _2 = formal_arguments _3 = opt_nl _4 = ass_req_opt _5 = ass_imp _6 = ass_ens _7 = KWend + _1 = KWall _2 = formal_arguments _3 = opt_nl _4 = ass_req_opt _5 = ass_imp _6 = ass_ens _7 = KWend { ( let entlst = withinfo (rhs_info 2) _2 in entlst, _4, _5, _6 )} proof_expr_struct: -_1 = ass_req _2 = ass_check _3 = ass_ens _4 = KWend + _1 = ass_req _2 = ass_check _3 = ass_ens _4 = KWend { ( let is_do = false in let impl = Impdefined (None,is_do,_2) in @@ -380,7 +380,7 @@ _1 = ass_req _2 = ass_check _3 = ass_ens _4 = KWend )} ass_imp: - + { ( Impdefined (None,false,[]) )} | _1 = ass_check { ( Impdefined (None,false,_1) )} @@ -395,7 +395,7 @@ ass_imp: )} header_mark: - + { ( No_hmark )} | _1 = KWimmutable { ( Immutable_hmark )} @@ -405,7 +405,7 @@ header_mark: { ( Deferred_hmark )} class_declaration: -_1 = header_mark _2 = KWclass _3 = class_name _4 = class_generics _5 = create_clause _6 = inherit_clause _7 = KWend + _1 = header_mark _2 = KWclass _3 = class_name _4 = class_generics _5 = create_clause _6 = inherit_clause _7 = KWend { ( Class_declaration( withinfo (rhs_info 3) _1, withinfo (rhs_info 3) _3, @@ -415,51 +415,51 @@ _1 = header_mark _2 = KWclass _3 = class_name _4 = class_generics _5 = create_cl )} class_name: -_1 = UIDENTIFIER + _1 = UIDENTIFIER { ( [], _1 )} | _1 = path _2 = UIDENTIFIER { ( _1, _2 )} class_generics: - + { ( [] )} | _1 = LBRACKET _2 = uidentifier_list _3 = RBRACKET { ( _2 )} inherit_clause: - + { ( [] )} | _1 = KWinherit _2 = parent_list { ( _2 )} parent_list: -_1 = parent + _1 = parent { ( [_1] )} | _1 = parent _2 = optsemi _3 = parent_list { ( _1::_3 )} parent: -_1 = optghost _2 = type_nt _3 = feature_adaptation + _1 = optghost _2 = type_nt _3 = feature_adaptation { ( _1, withinfo (rhs_info 2) _2, _3 )} feature_adaptation: - + { ( [] )} | _1 = KWrename _2 = rename_list _3 = KWend { ( _2 )} rename_list: -_1 = rename_item + _1 = rename_item { ( [_1] )} | _1 = rename_item _2 = optsemi _3 = rename_list { ( _1::_3 )} rename_item: -_1 = name_sig _2 = KWas _3 = nameopconst + _1 = name_sig _2 = KWas _3 = nameopconst { ( _1,_3 )} name_sig: -_1 = nameopconst + _1 = nameopconst { ( _1,[],None )} | _1 = nameopconst _2 = LPAREN _3 = type_list _4 = RPAREN { ( _1,_3,None )} @@ -467,41 +467,41 @@ _1 = nameopconst { ( _1,_3, Some _6 )} create_clause: - + { ( withinfo UNKNOWN [] )} | _1 = KWcreate _2 = constructor_list { ( withinfo (rhs_info 1) _2 )} constructor_list: -_1 = constructor + _1 = constructor { ( [_1] )} | _1 = constructor _2 = separator _3 = constructor_list { ( _1::_3 )} constructor: -_1 = nameopconst_info _2 = formal_arguments_opt + _1 = nameopconst_info _2 = formal_arguments_opt { ( _1, _2 )} path: -_1 = dotted_id_list _2 = DOT + _1 = dotted_id_list _2 = DOT { ( _1 )} dotted_id_list: -_1 = LIDENTIFIER %prec LOWEST_PREC + _1 = LIDENTIFIER %prec LOWEST_PREC { ( [_1] )} | _1 = dotted_id_list _2 = DOT _3 = LIDENTIFIER { ( _3::_1 )} type_nt: -_1 = elem_type %prec LOWEST_PREC + _1 = elem_type %prec LOWEST_PREC { ( _1 )} | _1 = arrow_type { ( _1 )} elem_type: -_1 = simple_type + _1 = simple_type { ( _1 )} | _1 = tuple_type { ( _1 )} @@ -515,7 +515,7 @@ _1 = simple_type { ( Paren_type _2 )} simple_type: -_1 = UIDENTIFIER _2 = actual_generics + _1 = UIDENTIFIER _2 = actual_generics { ( Normal_type ([],_1,_2) )} @@ -525,47 +525,47 @@ _1 = UIDENTIFIER _2 = actual_generics )} actual_generics: - %prec LOWEST_PREC + %prec LOWEST_PREC { ([])} | _1 = LBRACKET _2 = type_list _3 = RBRACKET { ( _2 )} arrow_type: -_1 = elem_type _2 = ARROW _3 = type_nt + _1 = elem_type _2 = ARROW _3 = type_nt { ( Arrow_type (_1,_3) )} qmark_type: -_1 = elem_type _2 = QMARK + _1 = elem_type _2 = QMARK { ( QMark_type _1 )} star_type: -_1 = elem_type _2 = TIMES + _1 = elem_type _2 = TIMES { ( Star_type _1 )} list_type: -_1 = LBRACKET _2 = elem_type _3 = RBRACKET + _1 = LBRACKET _2 = elem_type _3 = RBRACKET { ( List_type _2 )} tuple_type: -_1 = LPAREN _2 = type_list_min2 _3 = RPAREN + _1 = LPAREN _2 = type_list_min2 _3 = RPAREN { ( Tuple_type _2 )} type_list_min2: -_1 = type_nt _2 = COMMA _3 = type_nt + _1 = type_nt _2 = COMMA _3 = type_nt { ( [_1;_3] )} | _1 = type_nt _2 = COMMA _3 = type_list_min2 { ( _1::_3 )} type_list: -_1 = type_nt + _1 = type_nt { ( [_1])} | _1 = type_list_min2 { ( _1 )} named_feature: -_1 = nameopconst_info _2 = formal_arguments_info _3 = return_type_opt _4 = optsemi _5 = feature_body_opt + _1 = nameopconst_info _2 = formal_arguments_info _3 = return_type_opt _4 = optsemi _5 = feature_body_opt { ( Named_feature (_1, _2, _3, false, _5, None) )} @@ -583,17 +583,17 @@ _1 = nameopconst_info _2 = formal_arguments_info _3 = return_type_opt _4 = optse )} nameopconst_info: -_1 = nameopconst + _1 = nameopconst { ( withinfo (rhs_info 1) _1 )} nameopconst: -_1 = LIDENTIFIER + _1 = LIDENTIFIER { ( FNname _1 )} | _1 = featopconst { ( _1 )} featopconst: -_1 = LPAREN _2 = operator _3 = RPAREN + _1 = LPAREN _2 = operator _3 = RPAREN { ( FNoperator _2)} | _1 = KWtrue { ( FNtrue )} @@ -603,7 +603,7 @@ _1 = LPAREN _2 = operator _3 = RPAREN { ( FNnumber _1 )} return_type: -_1 = COLON _2 = elem_type + _1 = COLON _2 = elem_type { ( withinfo (rhs_info 2) (_2,false,false) )} | _1 = COLON _2 = KWghost _3 = elem_type { ( withinfo (rhs_info 3) (_3,false,true) )} @@ -611,19 +611,19 @@ _1 = COLON _2 = elem_type { ( withinfo (rhs_info 3) (_3,true,false) )} return_type_opt: - + { ( None )} | _1 = return_type { ( Some _1 )} feature_body_opt: - %prec LOWEST_PREC + %prec LOWEST_PREC { ( None )} | _1 = feature_body { ( Some _1 )} feature_body: -_1 = require_block _2 = feature_implementation _3 = ensure_block _4 = KWend + _1 = require_block _2 = feature_implementation _3 = ensure_block _4 = KWend { ( _1, Some _2, _3 )} | _1 = require_block _2 = feature_implementation _3 = KWend { ( _1, Some _2, [] )} @@ -639,7 +639,7 @@ _1 = require_block _2 = feature_implementation _3 = ensure_block _4 = KWend { ( [], None, _1 )} feature_implementation: -_1 = KWdeferred + _1 = KWdeferred { ( Impdeferred )} | _1 = implementation_note { ( _1 )} @@ -647,43 +647,43 @@ _1 = KWdeferred { ( _1 )} implementation_block: -_1 = local_block _2 = do_block + _1 = local_block _2 = do_block { ( Impdefined(_1,true, _2) )} | _1 = local_block _2 = proof_block { ( Impdefined(_1,false,_2) )} require_block: -_1 = KWrequire _2 = compound + _1 = KWrequire _2 = compound { ( _2 )} require_block_opt: - + { ( [] )} | _1 = require_block { ( _1 )} proof_block: -_1 = KWproof _2 = compound + _1 = KWproof _2 = compound { ( _2 )} do_block: -_1 = KWdo _2 = compound + _1 = KWdo _2 = compound { ( _2 )} local_block: - + { ( None )} | _1 = KWlocal _2 = local_list { ( Some _2 )} local_list: -_1 = local_declaration + _1 = local_declaration { ( [_1] )} | _1 = local_declaration _2 = SEMICOL _3 = local_list { ( _1::_3)} local_declaration: -_1 = entity_list + _1 = entity_list { ( Unassigned _1 )} | _1 = entity_list _2 = ASSIGN _3 = expr { ( Assigned (_1,_3) )} @@ -693,7 +693,7 @@ _1 = entity_list )} implementation_note: -_1 = KWnote _2 = LIDENTIFIER _3 = optsemi + _1 = KWnote _2 = LIDENTIFIER _3 = optsemi { ( let str = ST.string _2 in @@ -704,57 +704,57 @@ _1 = KWnote _2 = LIDENTIFIER _3 = optsemi )} ensure_block: -_1 = KWensure _2 = compound + _1 = KWensure _2 = compound { ( _2 )} entity_list: -_1 = entity_group + _1 = entity_group { ( [_1] )} | _1 = entity_group _2 = COMMA _3 = entity_list { ( _1::_3 )} entity_group: -_1 = identifier_list + _1 = identifier_list { ( Untyped_entities _1 )} | _1 = identifier_list _2 = COLON _3 = type_nt { ( Typed_entities (_1,_3) )} identifier_list: -_1 = LIDENTIFIER %prec LOWEST_PREC + _1 = LIDENTIFIER %prec LOWEST_PREC { ( [_1] )} | _1 = LIDENTIFIER _2 = COMMA _3 = identifier_list { ( _1::_3 )} formal_arguments_info: -_1 = formal_arguments + _1 = formal_arguments { ( withinfo (rhs_info 1) _1 )} formal_arguments_opt: - + { ( [] )} | _1 = formal_arguments { ( _1 )} formal_arguments: -_1 = LPAREN _2 = entity_list _3 = RPAREN + _1 = LPAREN _2 = entity_list _3 = RPAREN { ( _2 )} compound: -_1 = compound_list + _1 = compound_list { ( _1 )} compound_list: -_1 = info_expr _2 = optsemi + _1 = info_expr _2 = optsemi { ( [_1] )} | _1 = info_expr _2 = SEMICOL _3 = compound_list { ( _1::_3 )} info_expr: -_1 = expr %prec LOWEST_PREC + _1 = expr %prec LOWEST_PREC { ( withinfo (rhs_info 1) _1 )} expr: -_1 = atomic_expr + _1 = atomic_expr { ( _1 )} | _1 = operator_expr { ( _1 )} @@ -827,7 +827,7 @@ _1 = atomic_expr { ( _1 )} atomic_expr: -_1 = KWResult + _1 = KWResult { ( ExpResult )} | _1 = NUMBER { ( Expnumber _1 )} @@ -843,7 +843,7 @@ _1 = KWResult )} operator_expr: -_1 = expr _2 = PLUS _3 = expr + _1 = expr _2 = PLUS _3 = expr { ( Binexp (Plusop,_1,_3) )} | _1 = expr _2 = MINUS _3 = expr { ( Binexp (Minusop,_1,_3) )} @@ -897,7 +897,7 @@ _1 = expr _2 = PLUS _3 = expr { ( Binexp (DArrowop,_1,_3) )} operator: -_1 = PLUS + _1 = PLUS { ( Plusop )} | _1 = MINUS { ( Minusop )} @@ -951,25 +951,25 @@ _1 = PLUS { ( Bracketop )} optghost: - + { ( false )} | _1 = KWghost { ( true )} optsemi: - %prec LOWEST_PREC + %prec LOWEST_PREC { (())} | _1 = SEMICOL { (())} uidentifier_list: -_1 = UIDENTIFIER + _1 = UIDENTIFIER { ( [_1] )} | _1 = UIDENTIFIER _2 = COMMA _3 = uidentifier_list { ( _1::_3 )} opt_nl: - + { (())} | _1 = SEMICOL { (())} @@ -977,45 +977,45 @@ opt_nl: { (())} separator: -_1 = SEMICOL + _1 = SEMICOL { (())} | _1 = NEWLINE { (())} exp_conditional: -_1 = KWif _2 = exp_then_part_list _3 = exp_else_part _4 = KWend + _1 = KWif _2 = exp_then_part_list _3 = exp_else_part _4 = KWend { ( Expif (_2,_3) )} exp_then_part_list: -_1 = exp_then_part + _1 = exp_then_part { ( [_1] )} | _1 = exp_then_part _2 = KWelseif _3 = exp_then_part_list { ( _1::_3 )} exp_then_part: -_1 = expr _2 = KWthen _3 = expr + _1 = expr _2 = KWthen _3 = expr { ( _1, _3 )} exp_else_part: - + { ( None )} | _1 = KWelse _2 = expr { ( Some _2 )} exp_inspect: -_1 = KWinspect _2 = expr _3 = exp_case_list _4 = KWend + _1 = KWinspect _2 = expr _3 = exp_case_list _4 = KWend { ( Expinspect (_2,_3) )} exp_case_list: -_1 = exp_case + _1 = exp_case { ( [_1] )} | _1 = exp_case _2 = exp_case_list { ( _1 :: _2 )} exp_case: -_1 = KWcase _2 = expr _3 = KWthen _4 = expr + _1 = KWcase _2 = expr _3 = KWthen _4 = expr { ( _2, _4 )} %% diff --git a/bench/good/alphaCaml-demos-interactive.opp.exp b/bench/good/alphaCaml-demos-interactive.opp.exp index 5b31a5c2416321adcb05cc8213d40c9e35192f21..59bc581e4f51674d17840c4f6130967f43d08f0b 100644 --- a/bench/good/alphaCaml-demos-interactive.opp.exp +++ b/bench/good/alphaCaml-demos-interactive.opp.exp @@ -15,7 +15,7 @@ open Syntax.Raw %% expr: -_1 = VAR + _1 = VAR { ( EVar _1 )} | _1 = CONST { ( EConst _1 )} @@ -25,7 +25,7 @@ _1 = VAR { ( EFail )} declarations: -_1 = VAR _2 = EQUAL _3 = expr _4 = EOF + _1 = VAR _2 = EQUAL _3 = expr _4 = EOF { ( D (_1, _3, Suspension.create (fun () -> !ParserFix.declarations())) )} %% diff --git a/bench/good/alphaCaml-demos-mixins.opp.exp b/bench/good/alphaCaml-demos-mixins.opp.exp index 482964966093639edd712b9ea184a73fa438c478..5926f4b29a44f44e068a867794b94d04d256fe04 100644 --- a/bench/good/alphaCaml-demos-mixins.opp.exp +++ b/bench/good/alphaCaml-demos-mixins.opp.exp @@ -35,7 +35,7 @@ open Mm.Raw %% atomic_expression: -_1 = LIDENT + _1 = LIDENT { ( EVar _1 )} | _1 = LCURLY _2 = record_fields _3 = RCURLY { ( ERecord _2 )} @@ -48,7 +48,7 @@ _1 = LIDENT { ( _2 )} unary_expression: -_1 = atomic_expression + _1 = atomic_expression { ( _1 )} | _1 = CLOSE _2 = unary_expression { ( EClose _2 )} @@ -58,39 +58,39 @@ _1 = atomic_expression { ( EFakeDependency (_7, _2, _5) )} summand_expression: -_1 = unary_expression + _1 = unary_expression { ( _1 )} | _1 = summand_expression _2 = PLUS _3 = unary_expression { ( EComposition (_1, _3) )} expression: -_1 = summand_expression + _1 = summand_expression { ( _1 )} | _1 = LET _2 = REC _3 = bindings _4 = IN _5 = expression { ( ELetRec (List.rev _3, _5) )} bindings: -_1 = binding + _1 = binding { ( [ _1 ] )} | _1 = bindings _2 = AND _3 = binding { ( _3 :: _1 )} binding: -_1 = LIDENT _2 = EQUAL _3 = expression + _1 = LIDENT _2 = EQUAL _3 = expression { ( (_1, _3) )} toplevel: -_1 = expression _2 = EOF + _1 = expression _2 = EOF { ( _1 )} record_fields: - + { ( StringMap.empty )} | _1 = record_fields _2 = VAL _3 = LIDENT _4 = EQUAL _5 = expression { ( StringMap.add _3 _5 _1 )} components: - + { ( 0, StringMap.empty, (StringMap.empty, []) )} | _1 = components _2 = VAL _3 = lident_pun _4 = dependencies _5 = EQUAL _6 = expression { ( let xname, iname = _3 in @@ -108,25 +108,25 @@ components: i+1, input, output )} lident_pun: -_1 = LIDENT _2 = AS _3 = LIDENT + _1 = LIDENT _2 = AS _3 = LIDENT { ( _1, _3 )} | _1 = LIDENT { ( _1, _1 )} fields: - + { ( StringSet.empty )} | _1 = fields _2 = LIDENT { ( StringSet.add _2 _1 )} dependencies: - + { ( [] )} | _1 = LSQUARE _2 = variables _3 = RSQUARE { ( _2 )} variables: - + { ( [] )} | _1 = variables _2 = LIDENT { ( _2 :: _1 )} diff --git a/bench/good/alphaCaml-demos-poplmark.opp.exp b/bench/good/alphaCaml-demos-poplmark.opp.exp index 70df6d7fe8257bedaa40a133fc227feeb0abac3d..9bad3752e0ba51c4b70cc418356b5117296a5604 100644 --- a/bench/good/alphaCaml-demos-poplmark.opp.exp +++ b/bench/good/alphaCaml-demos-poplmark.opp.exp @@ -32,7 +32,7 @@ open Fsub.Raw %% toplevel: -_1 = EOF + _1 = EOF { ( TopEOF )} | _1 = Term _2 = SEMI _3 = toplevel { ( TopEval (_1, _3) )} @@ -42,17 +42,17 @@ _1 = EOF { ( TopTermBind (_1, _2, _4) )} Binder: -_1 = COLON _2 = Type + _1 = COLON _2 = Type { ( _2 )} Type: -_1 = ArrowType + _1 = ArrowType { ( _1 )} | _1 = ALL _2 = UCID _3 = OType _4 = DOT _5 = Type { ( TForall (_2, _3, _5) )} AType: -_1 = LPAREN _2 = Type _3 = RPAREN + _1 = LPAREN _2 = Type _3 = RPAREN { ( _2 )} | _1 = UCID { ( TVar _1 )} @@ -62,19 +62,19 @@ _1 = LPAREN _2 = Type _3 = RPAREN { ( TRecord _2 )} TyBinder: - + { ( TTop )} | _1 = LEQ _2 = Type { ( _2 )} ArrowType: -_1 = AType _2 = ARROW _3 = ArrowType + _1 = AType _2 = ARROW _3 = ArrowType { ( TArrow (_1, _3) )} | _1 = AType { ( _1 )} Term: -_1 = AppTerm + _1 = AppTerm { ( _1 )} | _1 = LAMBDA _2 = LCID _3 = COLON _4 = Type _5 = DOT _6 = Term { ( EAbs (_2, _4, _6) )} @@ -84,7 +84,7 @@ _1 = AppTerm { ( ETyAbs (_2, _3, _5) )} AppTerm: -_1 = PathTerm + _1 = PathTerm { ( _1 )} | _1 = AppTerm _2 = PathTerm { ( EApp (_1, _2) )} @@ -92,31 +92,31 @@ _1 = PathTerm { ( ETyApp (_1, _3) )} PathTerm: -_1 = PathTerm _2 = DOT _3 = LCID + _1 = PathTerm _2 = DOT _3 = LCID { ( EProj (_1, _3) )} | _1 = ATerm { ( _1 )} FieldTypes: - + { ( StringMap.empty )} | _1 = NEFieldTypes { ( _1 )} NEFieldTypes: -_1 = LCID _2 = COLON _3 = Type + _1 = LCID _2 = COLON _3 = Type { ( StringMap.singleton _1 _3 )} | _1 = LCID _2 = COLON _3 = Type _4 = COMMA _5 = NEFieldTypes { ( StringMap.add _1 _3 _5 )} TermSeq: -_1 = Term + _1 = Term { ( _1 )} | _1 = Term _2 = SEMI _3 = TermSeq { ( ELet (PWildcard, _1, _3) )} ATerm: -_1 = LPAREN _2 = TermSeq _3 = RPAREN + _1 = LPAREN _2 = TermSeq _3 = RPAREN { ( _2 )} | _1 = LCID { ( EVar _1 )} @@ -124,25 +124,25 @@ _1 = LPAREN _2 = TermSeq _3 = RPAREN { ( ERecord _2 )} Fields: - + { ( StringMap.empty )} | _1 = NEFields { ( _1 )} NEFields: -_1 = LCID _2 = EQ _3 = Term + _1 = LCID _2 = EQ _3 = Term { ( StringMap.singleton _1 _3 )} | _1 = LCID _2 = EQ _3 = Term _4 = COMMA _5 = NEFields { ( StringMap.add _1 _3 _5 )} OType: - + { ( TTop)} | _1 = LEQ _2 = Type { ( _2 )} Pattern: -_1 = USCORE + _1 = USCORE { ( PWildcard )} | _1 = LCID _2 = COLON _3 = Type { ( PVar (_1, _3) )} @@ -150,13 +150,13 @@ _1 = USCORE { ( PRecord _2 )} PatFields: - + { ( StringMap.empty )} | _1 = NEPatFields { ( _1 )} NEPatFields: -_1 = LCID _2 = EQ _3 = Pattern + _1 = LCID _2 = EQ _3 = Pattern { ( StringMap.singleton _1 _3 )} | _1 = LCID _2 = EQ _3 = Pattern _4 = COMMA _5 = NEPatFields { ( StringMap.add _1 _3 _5 )} diff --git a/bench/good/alphaCaml.opp.exp b/bench/good/alphaCaml.opp.exp index d7c5425c6feb201e29b1a74c6a72723fabca33d1..65a94146617f4d5c14f8d4aabf21e64318ac78e8 100644 --- a/bench/good/alphaCaml.opp.exp +++ b/bench/good/alphaCaml.opp.exp @@ -56,17 +56,17 @@ open Syntax %% typevar: -_1 = QUOTE _2 = LID + _1 = QUOTE _2 = LID { ( _2 )} typevars: -_1 = typevar + _1 = typevar { ( [ _1 ] )} | _1 = typevars _2 = COMMA _3 = typevar { ( _3 :: _1 )} params: - + { ( [] )} | _1 = typevar { ( [ _1 ] )} @@ -74,13 +74,13 @@ params: { ( List.rev _2 )} params_and_set_current: -_1 = params + _1 = params { ( let params = _1 in current_params := params; params )} identifier: -_1 = LID + _1 = LID { ( _1 )} | _1 = UID _2 = DOT _3 = identifier { ( let (pos1, _, id1) = _1 @@ -88,13 +88,13 @@ _1 = LID (pos1, pos2, id1 ^ "." ^ id2) )} container: - + { ( None )} | _1 = identifier { ( Some _1 )} expfactor: -_1 = ATOM _2 = LID + _1 = ATOM _2 = LID { ( EAtom _2 )} | _1 = OCAML { ( EEscape _1 )} @@ -121,7 +121,7 @@ _1 = ATOM _2 = LID { ( error 1 "Invalid expression factor." )} patfactor: -_1 = ATOM _2 = LID + _1 = ATOM _2 = LID { ( PAtom _2 )} | _1 = OCAML { ( PEscape _1 )} @@ -139,7 +139,7 @@ _1 = ATOM _2 = LID { ( error 1 "Invalid pattern factor." )} patmodifier: -_1 = INNER + _1 = INNER { ( MInner )} | _1 = OUTER { ( MOuter )} @@ -147,7 +147,7 @@ _1 = INNER { ( MNeutral )} expfactors: -_1 = expfactor + _1 = expfactor { ( [ (None, _1) ] )} | _1 = expfactors _2 = STAR _3 = expfactor { ( (None, _3) :: _1 )} @@ -155,7 +155,7 @@ _1 = expfactor { ( error 2 "Undetermined syntax error." )} patfactors: -_1 = patfactor + _1 = patfactor { ( [ (None, _1) ] )} | _1 = patfactors _2 = STAR _3 = patfactor { ( (None, _3) :: _1 )} @@ -163,13 +163,13 @@ _1 = patfactor { ( error 2 "Undetermined syntax error." )} explfactor: -_1 = LID _2 = COLON _3 = expfactor + _1 = LID _2 = COLON _3 = expfactor { ( (Some _1, _3) )} | _1 = error { ( error 1 "\"