diff --git a/src/snapshots/old_syntax/ability_demand_value_has_args.md b/src/snapshots/old_syntax/ability_demand_value_has_args.md new file mode 100644 index 0000000000..005640e784 --- /dev/null +++ b/src/snapshots/old_syntax/ability_demand_value_has_args.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ability_demand_value_has_args fail +type=expr +~~~ +# SOURCE +~~~roc +MEq implements + eq b c : a, a -> U64 where a implements MEq + +1 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),KwImplements(1:5-1:15),Newline(1:1-1:1), +LowerIdent(2:5-2:7),LowerIdent(2:8-2:9),LowerIdent(2:10-2:11),OpColon(2:12-2:13),LowerIdent(2:14-2:15),Comma(2:15-2:16),LowerIdent(2:17-2:18),OpArrow(2:19-2:21),UpperIdent(2:22-2:25),KwWhere(2:26-2:31),LowerIdent(2:32-2:33),KwImplements(2:34-2:44),UpperIdent(2:45-2:48),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "MEq")) +~~~ +# FORMATTED +~~~roc +MEq +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "MEq") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[MEq]*")) +~~~ diff --git a/src/snapshots/old_syntax/ability_demands_not_indented_with_first.md b/src/snapshots/old_syntax/ability_demands_not_indented_with_first.md new file mode 100644 index 0000000000..cdd43af70c --- /dev/null +++ b/src/snapshots/old_syntax/ability_demands_not_indented_with_first.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=ability_demands_not_indented_with_first fail +type=expr +~~~ +# SOURCE +~~~roc +MEq implements + eq : a, a -> U64 where a implements MEq + neq : a, a -> U64 where a implements MEq + +1 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),KwImplements(1:5-1:15),Newline(1:1-1:1), +LowerIdent(2:5-2:7),OpColon(2:8-2:9),LowerIdent(2:10-2:11),Comma(2:11-2:12),LowerIdent(2:13-2:14),OpArrow(2:15-2:17),UpperIdent(2:18-2:21),KwWhere(2:22-2:27),LowerIdent(2:28-2:29),KwImplements(2:30-2:40),UpperIdent(2:41-2:44),Newline(1:1-1:1), +LowerIdent(3:9-3:12),OpColon(3:13-3:14),LowerIdent(3:15-3:16),Comma(3:16-3:17),LowerIdent(3:18-3:19),OpArrow(3:20-3:22),UpperIdent(3:23-3:26),KwWhere(3:27-3:32),LowerIdent(3:33-3:34),KwImplements(3:35-3:45),UpperIdent(3:46-3:49),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "MEq")) +~~~ +# FORMATTED +~~~roc +MEq +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "MEq") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[MEq]*")) +~~~ diff --git a/src/snapshots/old_syntax/ability_first_demand_not_indented_enough.md b/src/snapshots/old_syntax/ability_first_demand_not_indented_enough.md new file mode 100644 index 0000000000..d7d1df0680 --- /dev/null +++ b/src/snapshots/old_syntax/ability_first_demand_not_indented_enough.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ability_first_demand_not_indented_enough fail +type=expr +~~~ +# SOURCE +~~~roc +MEq implements +eq : a, a -> U64 where a implements MEq + +1 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),KwImplements(1:5-1:15),Newline(1:1-1:1), +LowerIdent(2:1-2:3),OpColon(2:4-2:5),LowerIdent(2:6-2:7),Comma(2:7-2:8),LowerIdent(2:9-2:10),OpArrow(2:11-2:13),UpperIdent(2:14-2:17),KwWhere(2:18-2:23),LowerIdent(2:24-2:25),KwImplements(2:26-2:36),UpperIdent(2:37-2:40),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "MEq")) +~~~ +# FORMATTED +~~~roc +MEq +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "MEq") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[MEq]*")) +~~~ diff --git a/src/snapshots/old_syntax/ability_non_signature_expression.md b/src/snapshots/old_syntax/ability_non_signature_expression.md new file mode 100644 index 0000000000..fe050d1586 --- /dev/null +++ b/src/snapshots/old_syntax/ability_non_signature_expression.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ability_non_signature_expression fail +type=expr +~~~ +# SOURCE +~~~roc +MEq implements + 123 + +1 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),KwImplements(1:5-1:15),Newline(1:1-1:1), +Int(2:5-2:8),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "MEq")) +~~~ +# FORMATTED +~~~roc +MEq +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "MEq") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[MEq]*")) +~~~ diff --git a/src/snapshots/old_syntax/add_var_with_spaces.md b/src/snapshots/old_syntax/add_var_with_spaces.md new file mode 100644 index 0000000000..ceac0b25d2 --- /dev/null +++ b/src/snapshots/old_syntax/add_var_with_spaces.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=add_var_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +x + 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpPlus(1:3-1:4),Int(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.6 (op "+") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-int @1.5-1.6 (raw "2"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.6 (op "add") (id 76) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.5-1.6 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/add_with_spaces.md b/src/snapshots/old_syntax/add_with_spaces.md new file mode 100644 index 0000000000..1088d661bd --- /dev/null +++ b/src/snapshots/old_syntax/add_with_spaces.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=add_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +1 + 2 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpPlus(1:4-1:5),Int(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.9 (op "+") + (e-int @1.1-1.2 (raw "1")) + (e-int @1.8-1.9 (raw "2"))) +~~~ +# FORMATTED +~~~roc +1 + 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.9 (op "add") (id 75) + (e-int @1.1-1.2 (value "1")) + (e-int @1.8-1.9 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/alias_ann_in_parens.md b/src/snapshots/old_syntax/alias_ann_in_parens.md new file mode 100644 index 0000000000..8219577461 --- /dev/null +++ b/src/snapshots/old_syntax/alias_ann_in_parens.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=alias_ann_in_parens +type=expr +~~~ +# SOURCE +~~~roc +M:( +r) +h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "M")) +~~~ +# FORMATTED +~~~roc +M +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "M") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[M]*")) +~~~ diff --git a/src/snapshots/old_syntax/alias_comment_after_head.md b/src/snapshots/old_syntax/alias_comment_after_head.md new file mode 100644 index 0000000000..9831661c1b --- /dev/null +++ b/src/snapshots/old_syntax/alias_comment_after_head.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=alias_comment_after_head +type=expr +~~~ +# SOURCE +~~~roc +A# + p:e +A +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:3-1:3), +LowerIdent(2:2-2:3),OpColon(2:3-2:4),LowerIdent(2:4-2:5),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/alias_or_opaque_fail.md b/src/snapshots/old_syntax/alias_or_opaque_fail.md new file mode 100644 index 0000000000..39e61eeeaf --- /dev/null +++ b/src/snapshots/old_syntax/alias_or_opaque_fail.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=alias_or_opaque_fail fail +type=expr +~~~ +# SOURCE +~~~roc +(@,B +.e: +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **@,** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**alias_or_opaque_fail.md:1:2:1:4:** +```roc +(@,B +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**alias_or_opaque_fail.md:2:4:2:4:** +```roc +.e: +``` + + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),MalformedOpaqueNameWithoutName(1:2-1:3),Comma(1:3-1:4),UpperIdent(1:4-1:5),Newline(1:1-1:1), +DotLowerIdent(2:1-2:3),OpColon(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-malformed @2.4-2.4 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/alias_parens_comment.md b/src/snapshots/old_syntax/alias_parens_comment.md new file mode 100644 index 0000000000..f9f0e6397f --- /dev/null +++ b/src/snapshots/old_syntax/alias_parens_comment.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=alias_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +K:(# +s) +K +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:5-1:5), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "K")) +~~~ +# FORMATTED +~~~roc +K +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "K") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[K]*")) +~~~ diff --git a/src/snapshots/old_syntax/alias_parens_comment_indent.md b/src/snapshots/old_syntax/alias_parens_comment_indent.md new file mode 100644 index 0000000000..19b0e75674 --- /dev/null +++ b/src/snapshots/old_syntax/alias_parens_comment_indent.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=alias_parens_comment_indent +type=expr +~~~ +# SOURCE +~~~roc +O:O(z +# +) +b# +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),NoSpaceOpenRound(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:1-1:1), +Newline(2:2-2:2), +CloseRound(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "O")) +~~~ +# FORMATTED +~~~roc +O +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "O") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[O]*")) +~~~ diff --git a/src/snapshots/old_syntax/all_the_bangs.md b/src/snapshots/old_syntax/all_the_bangs.md new file mode 100644 index 0000000000..fc3c3fa994 --- /dev/null +++ b/src/snapshots/old_syntax/all_the_bangs.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=all_the_bangs fail +type=expr +~~~ +# SOURCE +~~~roc +p +! +.p!! +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +DotLowerIdent(3:1-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "p")) +~~~ +# FORMATTED +~~~roc +p +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ann_apply_record_with_newlines.md b/src/snapshots/old_syntax/ann_apply_record_with_newlines.md new file mode 100644 index 0000000000..7592886a50 --- /dev/null +++ b/src/snapshots/old_syntax/ann_apply_record_with_newlines.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ann_apply_record_with_newlines +type=expr +~~~ +# SOURCE +~~~roc +8:O + { +} +Q +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +OpenCurly(2:2-2:3),Newline(1:1-1:1), +CloseCurly(3:1-3:2),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "8")) +~~~ +# FORMATTED +~~~roc +8 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "8") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/ann_closed_union.md b/src/snapshots/old_syntax/ann_closed_union.md new file mode 100644 index 0000000000..5e5f89c5f6 --- /dev/null +++ b/src/snapshots/old_syntax/ann_closed_union.md @@ -0,0 +1,99 @@ +# META +~~~ini +description=ann_closed_union +type=expr +~~~ +# SOURCE +~~~roc +{ + foo : [True, Perhaps Thing] + foo = True + + 42 +} +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_ty_close_square_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**ann_closed_union.md:2:26:2:32:** +```roc + foo : [True, Perhaps Thing] +``` + ^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**ann_closed_union.md:2:31:2:31:** +```roc + foo : [True, Perhaps Thing] +``` + + + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +**UNUSED VARIABLE** +Variable ``foo`` is not used anywhere in your code. + +If you don't need this variable, prefix it with an underscore like `_foo` to suppress this warning. +The unused variable is declared here: +**ann_closed_union.md:3:5:3:8:** +```roc + foo = True +``` + ^^^ + + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:5-2:8),OpColon(2:9-2:10),OpenSquare(2:11-2:12),UpperIdent(2:12-2:16),Comma(2:16-2:17),UpperIdent(2:18-2:25),UpperIdent(2:26-2:31),CloseSquare(2:31-2:32),Newline(1:1-1:1), +LowerIdent(3:5-3:8),OpAssign(3:9-3:10),UpperIdent(3:11-3:15),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(5:5-5:7),Newline(1:1-1:1), +CloseCurly(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-6.2 + (statements + (s-type-anno @2.5-2.32 (name "foo") + (ty-malformed @2.26-2.32 (tag "expected_ty_close_square_or_comma"))) + (e-malformed @1.1-1.1 (reason "expr_unexpected_token")) + (s-decl @3.5-3.15 + (p-ident @3.5-3.8 (raw "foo")) + (e-tag @3.11-3.15 (raw "True"))) + (e-int @5.5-5.7 (raw "42")))) +~~~ +# FORMATTED +~~~roc +{ + foo : + + foo = True + + 42 +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-6.2 (id 82) + (s-type-anno @2.5-2.32 (name "foo") + (ty-malformed @2.26-2.32)) + (s-let @3.5-3.15 + (p-assign @3.5-3.8 (ident "foo") (id 77)) + (e-tag @3.11-3.15 (ext-var 78) (name "True") (args "TODO") (id 79))) + (e-int @5.5-5.7 (value "42"))) +~~~ +# TYPES +~~~clojure +(expr (id 82) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/ann_effectful_fn.md b/src/snapshots/old_syntax/ann_effectful_fn.md new file mode 100644 index 0000000000..2d1d4d72c9 --- /dev/null +++ b/src/snapshots/old_syntax/ann_effectful_fn.md @@ -0,0 +1,93 @@ +# META +~~~ini +description=ann_effectful_fn +type=expr +~~~ +# SOURCE +~~~roc +{ + launchTheNukes : {} => Result Bool LaunchNukeErr + launchTheNukes = |{}| { + crash "todo" + } + launchTheNukes({}) +} +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: crash statement + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:5-2:19),OpColon(2:20-2:21),OpenCurly(2:22-2:23),CloseCurly(2:23-2:24),OpFatArrow(2:25-2:27),UpperIdent(2:28-2:34),UpperIdent(2:35-2:39),UpperIdent(2:40-2:53),Newline(1:1-1:1), +LowerIdent(3:5-3:19),OpAssign(3:20-3:21),OpBar(3:22-3:23),OpenCurly(3:23-3:24),CloseCurly(3:24-3:25),OpBar(3:25-3:26),OpenCurly(3:27-3:28),Newline(1:1-1:1), +KwCrash(4:9-4:14),StringStart(4:15-4:16),StringPart(4:16-4:20),StringEnd(4:20-4:21),Newline(1:1-1:1), +CloseCurly(5:5-5:6),Newline(1:1-1:1), +LowerIdent(6:5-6:19),NoSpaceOpenRound(6:19-6:20),OpenCurly(6:20-6:21),CloseCurly(6:21-6:22),CloseRound(6:22-6:23),Newline(1:1-1:1), +CloseCurly(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-7.2 + (statements + (s-type-anno @2.5-2.39 (name "launchTheNukes") + (ty-fn @2.22-2.34 + (ty-record @2.22-2.24) + (ty (name "Result")))) + (e-tag @2.35-2.39 (raw "Bool")) + (e-tag @2.40-2.53 (raw "LaunchNukeErr")) + (s-decl @3.5-5.6 + (p-ident @3.5-3.19 (raw "launchTheNukes")) + (e-lambda @3.22-5.6 + (args + (p-record @3.23-3.25)) + (e-block @3.27-5.6 + (statements + (s-crash @1.1-1.1 + (e-string @4.15-4.21 + (e-string-part @4.16-4.20 (raw "todo")))))))) + (e-apply @6.5-6.23 + (e-ident @6.5-6.19 (qaul "") (raw "launchTheNukes")) + (e-record @6.20-6.22)))) +~~~ +# FORMATTED +~~~roc +{ + launchTheNukes : {} => Result + Bool + LaunchNukeErr + launchTheNukes = |{}| { + crash "todo" + } + launchTheNukes({}) +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-7.2 (id 96) + (s-type-anno @2.5-2.39 (name "launchTheNukes") + (ty-fn @2.22-2.34 (effectful true) + (ty-record @2.22-2.24) + (ty @2.28-2.34 (name "Result")))) + (s-expr @2.35-2.53 + (e-tag @2.35-2.39 (ext-var 78) (name "Bool") (args "TODO"))) + (s-expr @2.40-3.19 + (e-tag @2.40-2.53 (ext-var 81) (name "LaunchNukeErr") (args "TODO"))) + (s-let @3.5-5.6 + (p-assign @3.5-3.19 (ident "launchTheNukes") (id 84)) + (e-lambda @3.22-5.6 (id 90) + (args + (p-record-destructure @3.23-3.25 (id 85) + (destructs))) + (e-block @3.27-5.6 + (e-runtime-error (tag "not_implemented"))))) + (e-call @6.5-6.23 + (e-lookup-local @6.5-6.19 + (pattern (id 84))) + (e-empty_record @6.20-6.22))) +~~~ +# TYPES +~~~clojure +(expr (id 96) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/ann_extra_indented_implements.md b/src/snapshots/old_syntax/ann_extra_indented_implements.md new file mode 100644 index 0000000000..40512fa09f --- /dev/null +++ b/src/snapshots/old_syntax/ann_extra_indented_implements.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=ann_extra_indented_implements +type=expr +~~~ +# SOURCE +~~~roc +2 : + r where e + implements + P +u +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:5-2:6),KwWhere(2:7-2:12),LowerIdent(2:13-2:14),Newline(1:1-1:1), +KwImplements(3:5-3:15),Newline(1:1-1:1), +UpperIdent(4:5-4:6),Newline(1:1-1:1), +LowerIdent(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "2")) +~~~ +# FORMATTED +~~~roc +2 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "2") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/ann_parens_comments.md b/src/snapshots/old_syntax/ann_parens_comments.md new file mode 100644 index 0000000000..527b77136a --- /dev/null +++ b/src/snapshots/old_syntax/ann_parens_comments.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=ann_parens_comments +type=expr +~~~ +# SOURCE +~~~roc +r:( +r +# +# +) +h +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `r` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +Newline(3:2-3:2), +Newline(4:2-4:2), +CloseRound(5:1-5:2),Newline(1:1-1:1), +LowerIdent(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "r")) +~~~ +# FORMATTED +~~~roc +r +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ann_parens_where_implements_func.md b/src/snapshots/old_syntax/ann_parens_where_implements_func.md new file mode 100644 index 0000000000..a97a575719 --- /dev/null +++ b/src/snapshots/old_syntax/ann_parens_where_implements_func.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=ann_parens_where_implements_func +type=expr +~~~ +# SOURCE +~~~roc +x:(a +where +e +implements K->Z) +s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:1-1:1), +KwWhere(2:1-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),Newline(1:1-1:1), +KwImplements(4:1-4:11),UpperIdent(4:12-4:13),OpArrow(4:13-4:15),UpperIdent(4:15-4:16),CloseRound(4:16-4:17),Newline(1:1-1:1), +LowerIdent(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ann_pattern_comment_before_body.md b/src/snapshots/old_syntax/ann_pattern_comment_before_body.md new file mode 100644 index 0000000000..a626621991 --- /dev/null +++ b/src/snapshots/old_syntax/ann_pattern_comment_before_body.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ann_pattern_comment_before_body +type=expr +~~~ +# SOURCE +~~~roc +H:p +(# +s)=p +d# +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:1-1:1), +OpenRound(2:1-2:2),Newline(2:3-2:3), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),OpAssign(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "H")) +~~~ +# FORMATTED +~~~roc +H +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "H") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[H]*")) +~~~ diff --git a/src/snapshots/old_syntax/ann_record_pat_with_comment.md b/src/snapshots/old_syntax/ann_record_pat_with_comment.md new file mode 100644 index 0000000000..652d359591 --- /dev/null +++ b/src/snapshots/old_syntax/ann_record_pat_with_comment.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=ann_record_pat_with_comment +type=expr +~~~ +# SOURCE +~~~roc +{l# +:s}:s +o +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:4-1:4), +OpColon(2:1-2:2),LowerIdent(2:2-2:3),CloseCurly(2:3-2:4),OpColon(2:4-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.4 + (field (field "l") (optional false) + (e-ident @2.2-2.3 (qaul "") (raw "s")))) +~~~ +# FORMATTED +~~~roc +{ + l: s, +} +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-2.4 (ext-var 76) (id 77) + (fields + (field (name "l") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{ l: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/ann_tag_union_newline_comment.md b/src/snapshots/old_syntax/ann_tag_union_newline_comment.md new file mode 100644 index 0000000000..a715035031 --- /dev/null +++ b/src/snapshots/old_syntax/ann_tag_union_newline_comment.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=ann_tag_union_newline_comment +type=expr +~~~ +# SOURCE +~~~roc +k: +[T, +]m# +D +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `k` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),Newline(1:1-1:1), +OpenSquare(2:1-2:2),UpperIdent(2:2-2:3),Comma(2:3-2:4),Newline(1:1-1:1), +CloseSquare(3:1-3:2),LowerIdent(3:2-3:3),Newline(3:4-3:4), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "k")) +~~~ +# FORMATTED +~~~roc +k +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ann_where_e_newline_implements.md b/src/snapshots/old_syntax/ann_where_e_newline_implements.md new file mode 100644 index 0000000000..4f8ae46f26 --- /dev/null +++ b/src/snapshots/old_syntax/ann_where_e_newline_implements.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=ann_where_e_newline_implements +type=expr +~~~ +# SOURCE +~~~roc +J:[ +]where e + implements T +i +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),OpenSquare(1:3-1:4),Newline(1:1-1:1), +CloseSquare(2:1-2:2),KwWhere(2:2-2:7),LowerIdent(2:8-2:9),Newline(1:1-1:1), +KwImplements(3:3-3:13),UpperIdent(3:14-3:15),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "J")) +~~~ +# FORMATTED +~~~roc +J +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "J") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[J]*")) +~~~ diff --git a/src/snapshots/old_syntax/annotate_tuple_func.md b/src/snapshots/old_syntax/annotate_tuple_func.md new file mode 100644 index 0000000000..86ec25e759 --- /dev/null +++ b/src/snapshots/old_syntax/annotate_tuple_func.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=annotate_tuple_func +type=expr +~~~ +# SOURCE +~~~roc +1:(f +,ww->p)e +Mh +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:1-1:1), +Comma(2:1-2:2),LowerIdent(2:2-2:4),OpArrow(2:4-2:6),LowerIdent(2:6-2:7),CloseRound(2:7-2:8),LowerIdent(2:8-2:9),Newline(1:1-1:1), +UpperIdent(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/annotated_empty_record_destructure.md b/src/snapshots/old_syntax/annotated_empty_record_destructure.md new file mode 100644 index 0000000000..1005112066 --- /dev/null +++ b/src/snapshots/old_syntax/annotated_empty_record_destructure.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=annotated_empty_record_destructure +type=expr +~~~ +# SOURCE +~~~roc +E:B +{}=B +B +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +OpenCurly(2:1-2:2),CloseCurly(2:2-2:3),OpAssign(2:3-2:4),UpperIdent(2:4-2:5),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "E")) +~~~ +# FORMATTED +~~~roc +E +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "E") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[E]*")) +~~~ diff --git a/src/snapshots/old_syntax/annotated_record_destructure.md b/src/snapshots/old_syntax/annotated_record_destructure.md new file mode 100644 index 0000000000..82aa7f219e --- /dev/null +++ b/src/snapshots/old_syntax/annotated_record_destructure.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=annotated_record_destructure +type=expr +~~~ +# SOURCE +~~~roc +{ x, y } : Foo +{ x, y } = { x : "foo", y : 3.14 } + +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `y` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:3-1:4),Comma(1:4-1:5),LowerIdent(1:6-1:7),CloseCurly(1:8-1:9),OpColon(1:10-1:11),UpperIdent(1:12-1:15),Newline(1:1-1:1), +OpenCurly(2:1-2:2),LowerIdent(2:3-2:4),Comma(2:4-2:5),LowerIdent(2:6-2:7),CloseCurly(2:8-2:9),OpAssign(2:10-2:11),OpenCurly(2:12-2:13),LowerIdent(2:14-2:15),OpColon(2:16-2:17),StringStart(2:18-2:19),StringPart(2:19-2:22),StringEnd(2:22-2:23),Comma(2:23-2:24),LowerIdent(2:25-2:26),OpColon(2:27-2:28),Float(2:29-2:33),CloseCurly(2:34-2:35),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.9 + (field (field "x") (optional false)) + (field (field "y") (optional false))) +~~~ +# FORMATTED +~~~roc +{ x, y } +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-1.9 (ext-var 79) (id 80) + (fields + (field (name "x") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "y") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "{ x: Error, y: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/annotated_tag_destructure.md b/src/snapshots/old_syntax/annotated_tag_destructure.md new file mode 100644 index 0000000000..6dacb80c4d --- /dev/null +++ b/src/snapshots/old_syntax/annotated_tag_destructure.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=annotated_tag_destructure +type=expr +~~~ +# SOURCE +~~~roc +UserId x : [ UserId I64 ] +UserId x = UserId 42 + +x +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:7),LowerIdent(1:8-1:9),OpColon(1:10-1:11),OpenSquare(1:12-1:13),UpperIdent(1:14-1:20),UpperIdent(1:21-1:24),CloseSquare(1:25-1:26),Newline(1:1-1:1), +UpperIdent(2:1-2:7),LowerIdent(2:8-2:9),OpAssign(2:10-2:11),UpperIdent(2:12-2:18),Int(2:19-2:21),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.7 (raw "UserId")) +~~~ +# FORMATTED +~~~roc +UserId +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.7 (ext-var 73) (name "UserId") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[UserId]*")) +~~~ diff --git a/src/snapshots/old_syntax/annotated_tuple_destructure.md b/src/snapshots/old_syntax/annotated_tuple_destructure.md new file mode 100644 index 0000000000..c4eab69278 --- /dev/null +++ b/src/snapshots/old_syntax/annotated_tuple_destructure.md @@ -0,0 +1,49 @@ +# META +~~~ini +description=annotated_tuple_destructure +type=expr +~~~ +# SOURCE +~~~roc +( x, y ) : Foo +( x, y ) = ( "foo", 3.14 ) + +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `y` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:3-1:4),Comma(1:4-1:5),LowerIdent(1:6-1:7),CloseRound(1:8-1:9),OpColon(1:10-1:11),UpperIdent(1:12-1:15),Newline(1:1-1:1), +OpenRound(2:1-2:2),LowerIdent(2:3-2:4),Comma(2:4-2:5),LowerIdent(2:6-2:7),CloseRound(2:8-2:9),OpAssign(2:10-2:11),OpenRound(2:12-2:13),StringStart(2:14-2:15),StringPart(2:15-2:18),StringEnd(2:18-2:19),Comma(2:19-2:20),Float(2:21-2:25),CloseRound(2:26-2:27),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.9 + (e-ident @1.3-1.4 (qaul "") (raw "x")) + (e-ident @1.6-1.7 (qaul "") (raw "y"))) +~~~ +# FORMATTED +~~~roc +(x, y) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.9 (id 77) + (elems + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "(Error, Error)")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_apply_newlines.md b/src/snapshots/old_syntax/annotation_apply_newlines.md new file mode 100644 index 0000000000..96542d7814 --- /dev/null +++ b/src/snapshots/old_syntax/annotation_apply_newlines.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=annotation_apply_newlines +type=expr +~~~ +# SOURCE +~~~roc +A + p: +e +A +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:2-2:3),OpColon(2:3-2:4),Newline(1:1-1:1), +LowerIdent(3:1-3:2),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_comment_before_as.md b/src/snapshots/old_syntax/annotation_comment_before_as.md new file mode 100644 index 0000000000..833ce4587a --- /dev/null +++ b/src/snapshots/old_syntax/annotation_comment_before_as.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=annotation_comment_before_as +type=expr +~~~ +# SOURCE +~~~roc +e:A# + as H +n +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:5-1:5), +KwAs(2:3-2:5),UpperIdent(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "e")) +~~~ +# FORMATTED +~~~roc +e +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_comment_before_colon.md b/src/snapshots/old_syntax/annotation_comment_before_colon.md new file mode 100644 index 0000000000..24abb9cfe3 --- /dev/null +++ b/src/snapshots/old_syntax/annotation_comment_before_colon.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=annotation_comment_before_colon +type=expr +~~~ +# SOURCE +~~~roc +A + e#g +:A +AA +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(2:4-2:5), +OpColon(3:1-3:2),UpperIdent(3:2-3:3),Newline(1:1-1:1), +UpperIdent(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_double_as.md b/src/snapshots/old_syntax/annotation_double_as.md new file mode 100644 index 0000000000..cd5ad4575a --- /dev/null +++ b/src/snapshots/old_syntax/annotation_double_as.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=annotation_double_as +type=expr +~~~ +# SOURCE +~~~roc +s:(e as A)as A +s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),KwAs(1:6-1:8),UpperIdent(1:9-1:10),CloseRound(1:10-1:11),KwAs(1:11-1:13),UpperIdent(1:14-1:15),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "s")) +~~~ +# FORMATTED +~~~roc +s +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_tag_parens_comment.md b/src/snapshots/old_syntax/annotation_tag_parens_comment.md new file mode 100644 index 0000000000..ac00fa5e9a --- /dev/null +++ b/src/snapshots/old_syntax/annotation_tag_parens_comment.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=annotation_tag_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +g:[T(T# +)] +D +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `g` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),OpenSquare(1:3-1:4),UpperIdent(1:4-1:5),NoSpaceOpenRound(1:5-1:6),UpperIdent(1:6-1:7),Newline(1:8-1:8), +CloseRound(2:1-2:2),CloseSquare(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "g")) +~~~ +# FORMATTED +~~~roc +g +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_tuple_comment.md b/src/snapshots/old_syntax/annotation_tuple_comment.md new file mode 100644 index 0000000000..f44e409b38 --- /dev/null +++ b/src/snapshots/old_syntax/annotation_tuple_comment.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=annotation_tuple_comment +type=expr +~~~ +# SOURCE +~~~roc +3:(# +)n->n +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:5-1:5), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +Int(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "3")) +~~~ +# FORMATTED +~~~roc +3 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "3") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_tuple_newline.md b/src/snapshots/old_syntax/annotation_tuple_newline.md new file mode 100644 index 0000000000..bff920b49e --- /dev/null +++ b/src/snapshots/old_syntax/annotation_tuple_newline.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=annotation_tuple_newline +type=expr +~~~ +# SOURCE +~~~roc +d:(J, +)g +2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `d` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),UpperIdent(1:4-1:5),Comma(1:5-1:6),Newline(1:1-1:1), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),Newline(1:1-1:1), +Int(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "d")) +~~~ +# FORMATTED +~~~roc +d +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_tuple_parens_newlines.md b/src/snapshots/old_syntax/annotation_tuple_parens_newlines.md new file mode 100644 index 0000000000..1f1a3a1bfb --- /dev/null +++ b/src/snapshots/old_syntax/annotation_tuple_parens_newlines.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=annotation_tuple_parens_newlines +type=expr +~~~ +# SOURCE +~~~roc +p:( +)( +i) +{} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +CloseRound(2:1-2:2),NoSpaceOpenRound(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),Newline(1:1-1:1), +OpenCurly(4:1-4:2),CloseCurly(4:2-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "p")) +~~~ +# FORMATTED +~~~roc +p +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/annotation_tuples_ext_galore.md b/src/snapshots/old_syntax/annotation_tuples_ext_galore.md new file mode 100644 index 0000000000..a8e4d252dc --- /dev/null +++ b/src/snapshots/old_syntax/annotation_tuples_ext_galore.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=annotation_tuples_ext_galore +type=expr +~~~ +# SOURCE +~~~roc +1:(()(n# +))(n) +l +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),NoSpaceOpenRound(1:4-1:5),CloseRound(1:5-1:6),NoSpaceOpenRound(1:6-1:7),LowerIdent(1:7-1:8),Newline(1:9-1:9), +CloseRound(2:1-2:2),CloseRound(2:2-2:3),NoSpaceOpenRound(2:3-2:4),LowerIdent(2:4-2:5),CloseRound(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/applies_in_binop.md b/src/snapshots/old_syntax/applies_in_binop.md new file mode 100644 index 0000000000..b254dc74b0 --- /dev/null +++ b/src/snapshots/old_syntax/applies_in_binop.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=applies_in_binop +type=expr +~~~ +# SOURCE +~~~roc +Str.getUnsafe haystack haystackIndex +== +Str.getUnsafe needle needleIndex +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `getUnsafe` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +UpperIdent(1:1-1:4),NoSpaceDotLowerIdent(1:4-1:14),LowerIdent(1:15-1:23),LowerIdent(1:24-1:37),Newline(1:1-1:1), +OpEquals(2:1-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:4),NoSpaceDotLowerIdent(3:4-3:14),LowerIdent(3:15-3:21),LowerIdent(3:22-3:33),EndOfFile(3:33-3:33), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.14 (qaul "Str") (raw ".getUnsafe")) +~~~ +# FORMATTED +~~~roc +Str.getUnsafe +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_bang_bang_closure.md b/src/snapshots/old_syntax/apply_bang_bang_closure.md new file mode 100644 index 0000000000..00e5f962a9 --- /dev/null +++ b/src/snapshots/old_syntax/apply_bang_bang_closure.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=apply_bang_bang_closure +type=expr +~~~ +# SOURCE +~~~roc +!! + \w->2 + n +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!!** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**apply_bang_bang_closure.md:1:1:1:3:** +```roc +!! +``` +^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),OpBang(1:2-1:3),Newline(1:1-1:1), +OpBackslash(2:2-2:3),LowerIdent(2:3-2:4),OpArrow(2:4-2:6),Int(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/apply_binop_switch.md b/src/snapshots/old_syntax/apply_binop_switch.md new file mode 100644 index 0000000000..d9b73954eb --- /dev/null +++ b/src/snapshots/old_syntax/apply_binop_switch.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=apply_binop_switch +type=expr +~~~ +# SOURCE +~~~roc +i<2 +(-6) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpLessThan(1:2-1:3),Int(1:3-1:4),Newline(1:1-1:1), +OpenRound(2:1-2:2),OpBinaryMinus(2:2-2:3),Int(2:3-2:4),CloseRound(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.2 (op "<") + (e-ident @1.1-1.2 (qaul "") (raw "i")) + (e-int @1.3-1.4 (raw "2"))) +~~~ +# FORMATTED +~~~roc +i < 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.2 (op "lt") (id 76) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.3-1.4 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/apply_closure_pizza.md b/src/snapshots/old_syntax/apply_closure_pizza.md new file mode 100644 index 0000000000..d724796678 --- /dev/null +++ b/src/snapshots/old_syntax/apply_closure_pizza.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=apply_closure_pizza +type=expr +~~~ +# SOURCE +~~~roc +foo +|> Dict.keepIf \(k, _v) -> List.contains keysToDelete k |> Bool.not +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `foo` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),Newline(1:1-1:1), +OpPizza(2:1-2:3),UpperIdent(2:4-2:8),NoSpaceDotLowerIdent(2:8-2:15),OpBackslash(2:16-2:17),NoSpaceOpenRound(2:17-2:18),LowerIdent(2:18-2:19),Comma(2:19-2:20),NamedUnderscore(2:21-2:23),CloseRound(2:23-2:24),OpArrow(2:25-2:27),UpperIdent(2:28-2:32),NoSpaceDotLowerIdent(2:32-2:41),LowerIdent(2:42-2:54),LowerIdent(2:55-2:56),OpPizza(2:57-2:59),UpperIdent(2:60-2:64),NoSpaceDotLowerIdent(2:64-2:68),EndOfFile(2:68-2:68), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "foo")) +~~~ +# FORMATTED +~~~roc +foo +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_parenthetical_tag_args.md b/src/snapshots/old_syntax/apply_parenthetical_tag_args.md new file mode 100644 index 0000000000..6f20876b09 --- /dev/null +++ b/src/snapshots/old_syntax/apply_parenthetical_tag_args.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=apply_parenthetical_tag_args +type=expr +~~~ +# SOURCE +~~~roc +Whee (12) (34) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),OpenRound(1:6-1:7),Int(1:7-1:9),CloseRound(1:9-1:10),OpenRound(1:11-1:12),Int(1:12-1:14),CloseRound(1:14-1:15),EndOfFile(1:15-1:15), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.5 (raw "Whee")) +~~~ +# FORMATTED +~~~roc +Whee +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.5 (ext-var 73) (name "Whee") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Whee]*")) +~~~ diff --git a/src/snapshots/old_syntax/apply_record_ann.md b/src/snapshots/old_syntax/apply_record_ann.md new file mode 100644 index 0000000000..7063215d3a --- /dev/null +++ b/src/snapshots/old_syntax/apply_record_ann.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=apply_record_ann +type=expr +~~~ +# SOURCE +~~~roc +a:N{h, +} +g +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),OpenCurly(1:4-1:5),LowerIdent(1:5-1:6),Comma(1:6-1:7),Newline(1:1-1:1), +CloseCurly(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_record_parens_newline_field.md b/src/snapshots/old_syntax/apply_record_parens_newline_field.md new file mode 100644 index 0000000000..b9f013f97b --- /dev/null +++ b/src/snapshots/old_syntax/apply_record_parens_newline_field.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=apply_record_parens_newline_field +type=expr +~~~ +# SOURCE +~~~roc +0{l,xt,l:(se# +)} +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),Comma(1:4-1:5),LowerIdent(1:5-1:7),Comma(1:7-1:8),LowerIdent(1:8-1:9),OpColon(1:9-1:10),NoSpaceOpenRound(1:10-1:11),LowerIdent(1:11-1:13),Newline(1:14-1:14), +CloseRound(2:1-2:2),CloseCurly(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "0")) +~~~ +# FORMATTED +~~~roc +0 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "0") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/apply_tag.md b/src/snapshots/old_syntax/apply_tag.md new file mode 100644 index 0000000000..06280a889e --- /dev/null +++ b/src/snapshots/old_syntax/apply_tag.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=apply_tag +type=expr +~~~ +# SOURCE +~~~roc +Whee 12 34 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),Int(1:6-1:8),Int(1:9-1:11),EndOfFile(1:11-1:11), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.5 (raw "Whee")) +~~~ +# FORMATTED +~~~roc +Whee +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.5 (ext-var 73) (name "Whee") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Whee]*")) +~~~ diff --git a/src/snapshots/old_syntax/apply_tag_pnc.md b/src/snapshots/old_syntax/apply_tag_pnc.md new file mode 100644 index 0000000000..0e7caace48 --- /dev/null +++ b/src/snapshots/old_syntax/apply_tag_pnc.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=apply_tag_pnc +type=expr +~~~ +# SOURCE +~~~roc +Whee(12, 34) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),NoSpaceOpenRound(1:5-1:6),Int(1:6-1:8),Comma(1:8-1:9),Int(1:10-1:12),CloseRound(1:12-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-1.13 + (e-tag @1.1-1.5 (raw "Whee")) + (e-int @1.6-1.8 (raw "12")) + (e-int @1.10-1.12 (raw "34"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-1.13 (id 78) + (e-tag @1.1-1.5 (ext-var 73) (name "Whee") (args "TODO")) + (e-int @1.6-1.8 (value "12")) + (e-int @1.10-1.12 (value "34"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/apply_three_args.md b/src/snapshots/old_syntax/apply_three_args.md new file mode 100644 index 0000000000..9a1ba60ade --- /dev/null +++ b/src/snapshots/old_syntax/apply_three_args.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=apply_three_args +type=expr +~~~ +# SOURCE +~~~roc +a b c d +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),LowerIdent(1:3-1:4),LowerIdent(1:5-1:6),LowerIdent(1:7-1:8),EndOfFile(1:8-1:8), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_tuple_ext_parens_ty.md b/src/snapshots/old_syntax/apply_tuple_ext_parens_ty.md new file mode 100644 index 0000000000..30a9d6f203 --- /dev/null +++ b/src/snapshots/old_syntax/apply_tuple_ext_parens_ty.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=apply_tuple_ext_parens_ty +type=expr +~~~ +# SOURCE +~~~roc +i:M()(Y) c +t +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),NoSpaceOpenRound(1:4-1:5),CloseRound(1:5-1:6),NoSpaceOpenRound(1:6-1:7),UpperIdent(1:7-1:8),CloseRound(1:8-1:9),LowerIdent(1:10-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "i")) +~~~ +# FORMATTED +~~~roc +i +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_two_args.md b/src/snapshots/old_syntax/apply_two_args.md new file mode 100644 index 0000000000..def678c165 --- /dev/null +++ b/src/snapshots/old_syntax/apply_two_args.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=apply_two_args +type=expr +~~~ +# SOURCE +~~~roc +whee 12 34 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:7-1:9),Int(1:11-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "whee")) +~~~ +# FORMATTED +~~~roc +whee +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/apply_two_args_pnc.md b/src/snapshots/old_syntax/apply_two_args_pnc.md new file mode 100644 index 0000000000..33d557d84d --- /dev/null +++ b/src/snapshots/old_syntax/apply_two_args_pnc.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=apply_two_args_pnc +type=expr +~~~ +# SOURCE +~~~roc +whee(12, 34) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),NoSpaceOpenRound(1:5-1:6),Int(1:6-1:8),Comma(1:8-1:9),Int(1:11-1:13),CloseRound(1:13-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-1.14 + (e-ident @1.1-1.5 (qaul "") (raw "whee")) + (e-int @1.6-1.8 (raw "12")) + (e-int @1.11-1.13 (raw "34"))) +~~~ +# FORMATTED +~~~roc +whee(12, 34) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-1.14 (id 78) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.6-1.8 (value "12")) + (e-int @1.11-1.13 (value "34"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/apply_unary_negation.md b/src/snapshots/old_syntax/apply_unary_negation.md new file mode 100644 index 0000000000..372b4d462f --- /dev/null +++ b/src/snapshots/old_syntax/apply_unary_negation.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=apply_unary_negation +type=expr +~~~ +# SOURCE +~~~roc +-whee 12 foo +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-whee** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**apply_unary_negation.md:1:1:1:6:** +```roc +-whee 12 foo +``` +^^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),LowerIdent(1:2-1:6),Int(1:8-1:10),LowerIdent(1:11-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.6 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/apply_unary_not.md b/src/snapshots/old_syntax/apply_unary_not.md new file mode 100644 index 0000000000..c676238018 --- /dev/null +++ b/src/snapshots/old_syntax/apply_unary_not.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=apply_unary_not +type=expr +~~~ +# SOURCE +~~~roc +!whee 12 foo +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!whee** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**apply_unary_not.md:1:1:1:6:** +```roc +!whee 12 foo +``` +^^^^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),LowerIdent(1:2-1:6),Int(1:8-1:10),LowerIdent(1:11-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.6 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/arg_pattern_as.md b/src/snapshots/old_syntax/arg_pattern_as.md new file mode 100644 index 0000000000..58942781db --- /dev/null +++ b/src/snapshots/old_syntax/arg_pattern_as.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=arg_pattern_as +type=expr +~~~ +# SOURCE +~~~roc +\({ x, y } as point), (@Location inner as outer) -> + crash "" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**arg_pattern_as.md:1:1:1:3:** +```roc +\({ x, y } as point), (@Location inner as outer) -> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),OpenCurly(1:3-1:4),LowerIdent(1:5-1:6),Comma(1:6-1:7),LowerIdent(1:8-1:9),CloseCurly(1:10-1:11),KwAs(1:12-1:14),LowerIdent(1:15-1:20),CloseRound(1:20-1:21),Comma(1:21-1:22),OpenRound(1:23-1:24),OpaqueName(1:24-1:33),LowerIdent(1:34-1:39),KwAs(1:40-1:42),LowerIdent(1:43-1:48),CloseRound(1:48-1:49),OpArrow(1:50-1:52),Newline(1:1-1:1), +KwCrash(2:5-2:10),StringStart(2:11-2:12),StringPart(2:12-2:12),StringEnd(2:12-2:13),EndOfFile(2:13-2:13), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/as_in_func_type_args.md b/src/snapshots/old_syntax/as_in_func_type_args.md new file mode 100644 index 0000000000..ba41cbd44c --- /dev/null +++ b/src/snapshots/old_syntax/as_in_func_type_args.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=as_in_func_type_args +type=expr +~~~ +# SOURCE +~~~roc +e:J + as H->A +r +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +KwAs(2:3-2:5),UpperIdent(2:6-2:7),OpArrow(2:7-2:9),UpperIdent(2:9-2:10),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "e")) +~~~ +# FORMATTED +~~~roc +e +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/assign_parens_item_newline_comment.md b/src/snapshots/old_syntax/assign_parens_item_newline_comment.md new file mode 100644 index 0000000000..ca60f1cc10 --- /dev/null +++ b/src/snapshots/old_syntax/assign_parens_item_newline_comment.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=assign_parens_item_newline_comment +type=expr +~~~ +# SOURCE +~~~roc +a=( +i +# +) +r +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +Newline(3:2-3:2), +CloseRound(4:1-4:2),Newline(1:1-1:1), +LowerIdent(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/backslash_closure_last_expr.md b/src/snapshots/old_syntax/backslash_closure_last_expr.md new file mode 100644 index 0000000000..77a155fd75 --- /dev/null +++ b/src/snapshots/old_syntax/backslash_closure_last_expr.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=backslash_closure_last_expr +type=expr +~~~ +# SOURCE +~~~roc +b +\e->s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `b` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpBackslash(2:1-2:2),LowerIdent(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:6),EndOfFile(2:6-2:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "b")) +~~~ +# FORMATTED +~~~roc +b +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/bad_opaque_ref.md b/src/snapshots/old_syntax/bad_opaque_ref.md new file mode 100644 index 0000000000..6a628cb7de --- /dev/null +++ b/src/snapshots/old_syntax/bad_opaque_ref.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=bad_opaque_ref malformed +type=expr +~~~ +# SOURCE +~~~roc +I@ +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),MalformedOpaqueNameWithoutName(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "I")) +~~~ +# FORMATTED +~~~roc +I +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "I") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[I]*")) +~~~ diff --git a/src/snapshots/old_syntax/bang_newline_double_accessor.md b/src/snapshots/old_syntax/bang_newline_double_accessor.md new file mode 100644 index 0000000000..add25406ff --- /dev/null +++ b/src/snapshots/old_syntax/bang_newline_double_accessor.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=bang_newline_double_accessor +type=expr +~~~ +# SOURCE +~~~roc +0 +! +.d +.d +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +DotLowerIdent(3:1-3:3),Newline(1:1-1:1), +DotLowerIdent(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "0")) +~~~ +# FORMATTED +~~~roc +0 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "0") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/bangs_and_tuple_accessors.md b/src/snapshots/old_syntax/bangs_and_tuple_accessors.md new file mode 100644 index 0000000000..e8b5620dba --- /dev/null +++ b/src/snapshots/old_syntax/bangs_and_tuple_accessors.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=bangs_and_tuple_accessors +type=expr +~~~ +# SOURCE +~~~roc +J +! +.1!.0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +DotInt(3:1-3:3),OpBang(3:3-3:4),NoSpaceDotInt(3:4-3:6),EndOfFile(3:6-3:6), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "J")) +~~~ +# FORMATTED +~~~roc +J +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "J") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[J]*")) +~~~ diff --git a/src/snapshots/old_syntax/basic_apply.md b/src/snapshots/old_syntax/basic_apply.md new file mode 100644 index 0000000000..8ee06d99df --- /dev/null +++ b/src/snapshots/old_syntax/basic_apply.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=basic_apply +type=expr +~~~ +# SOURCE +~~~roc +whee 1 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "whee")) +~~~ +# FORMATTED +~~~roc +whee +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/basic_docs.md b/src/snapshots/old_syntax/basic_docs.md new file mode 100644 index 0000000000..8c14c47595 --- /dev/null +++ b/src/snapshots/old_syntax/basic_docs.md @@ -0,0 +1,61 @@ +# META +~~~ini +description=basic_docs +type=expr +~~~ +# SOURCE +~~~roc +## first line of docs +## second line +## third line +## fourth line +## +## sixth line after doc new line +x = 5 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **# first line of docs +## second line** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**basic_docs.md:1:2:2:19:** +```roc +## first line of docs +## second line +``` + + +# TOKENS +~~~zig +Newline(1:2-1:22), +Newline(2:2-2:19), +Newline(3:2-3:15), +Newline(4:2-4:15), +Newline(5:2-5:3), +Newline(6:2-6:33), +LowerIdent(7:1-7:2),OpAssign(7:3-7:4),Int(7:5-7:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(9:1-9:3),EndOfFile(9:3-9:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.19 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/basic_field.md b/src/snapshots/old_syntax/basic_field.md new file mode 100644 index 0000000000..1c0f2f9440 --- /dev/null +++ b/src/snapshots/old_syntax/basic_field.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=basic_field +type=expr +~~~ +# SOURCE +~~~roc +rec.field +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `rec` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),NoSpaceDotLowerIdent(1:4-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-field-access @1.1-1.10 + (e-ident @1.1-1.4 (qaul "") (raw "rec")) + (e-ident @1.4-1.10 (qaul "") (raw ".field"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dot-access @1.1-1.10 (field "field") (id 75) + (receiver + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/basic_tag.md b/src/snapshots/old_syntax/basic_tag.md new file mode 100644 index 0000000000..11eac81634 --- /dev/null +++ b/src/snapshots/old_syntax/basic_tag.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=basic_tag +type=expr +~~~ +# SOURCE +~~~roc +Whee +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.5 (raw "Whee")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.5 (ext-var 73) (name "Whee") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Whee]*")) +~~~ diff --git a/src/snapshots/old_syntax/basic_tuple.md b/src/snapshots/old_syntax/basic_tuple.md new file mode 100644 index 0000000000..e1295df55d --- /dev/null +++ b/src/snapshots/old_syntax/basic_tuple.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=basic_tuple +type=expr +~~~ +# SOURCE +~~~roc +(1, 2, 3) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Int(1:2-1:3),Comma(1:3-1:4),Int(1:5-1:6),Comma(1:6-1:7),Int(1:8-1:9),CloseRound(1:9-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.10 + (e-int @1.2-1.3 (raw "1")) + (e-int @1.5-1.6 (raw "2")) + (e-int @1.8-1.9 (raw "3"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.10 (id 76) + (elems + (e-int @1.2-1.3 (value "1")) + (e-int @1.5-1.6 (value "2")) + (e-int @1.8-1.9 (value "3")))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "(Num(*), Num(*), Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/basic_var.md b/src/snapshots/old_syntax/basic_var.md new file mode 100644 index 0000000000..0e9545e2eb --- /dev/null +++ b/src/snapshots/old_syntax/basic_var.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=basic_var +type=expr +~~~ +# SOURCE +~~~roc +whee +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "whee")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/binop_apply_complex.md b/src/snapshots/old_syntax/binop_apply_complex.md new file mode 100644 index 0000000000..062e1dd8a0 --- /dev/null +++ b/src/snapshots/old_syntax/binop_apply_complex.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=binop_apply_complex +type=expr +~~~ +# SOURCE +~~~roc +Nx + x +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\w** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**binop_closure_apply.md:2:2:2:4:** +```roc + \w->x +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `d` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpPlus(1:2-1:3),Newline(1:1-1:1), +OpBackslash(2:2-2:3),LowerIdent(2:3-2:4),OpArrow(2:4-2:6),LowerIdent(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "+") + (e-ident @1.1-1.2 (qaul "") (raw "d")) + (e-malformed @2.2-2.4 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +d + + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "add") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/binops_comment_indent_change.md b/src/snapshots/old_syntax/binops_comment_indent_change.md new file mode 100644 index 0000000000..2326919b14 --- /dev/null +++ b/src/snapshots/old_syntax/binops_comment_indent_change.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=binops_comment_indent_change +type=expr +~~~ +# SOURCE +~~~roc +r^ +-f +# + -P +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `r` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpCaret(1:2-1:3),Newline(1:1-1:1), +OpUnaryMinus(2:1-2:2),LowerIdent(2:2-2:3),Newline(1:1-1:1), +Newline(3:2-3:2), +OpUnaryMinus(4:2-4:3),UpperIdent(4:3-4:4),EndOfFile(4:4-4:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "r")) +~~~ +# FORMATTED +~~~roc +r +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/block_string_ann.md b/src/snapshots/old_syntax/block_string_ann.md new file mode 100644 index 0000000000..3ff69dc74f --- /dev/null +++ b/src/snapshots/old_syntax/block_string_ann.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=block_string_ann +type=expr +~~~ +# SOURCE +~~~roc +"""${g}""":q +f +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**block_string_ann.md:1:1:1:4:** +```roc +"""${g}""":q +``` +^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:4),OpenStringInterpolation(1:4-1:6),LowerIdent(1:6-1:7),CloseStringInterpolation(1:7-1:8),StringPart(1:8-1:8),MultilineStringEnd(1:8-1:11),OpColon(1:11-1:12),LowerIdent(1:12-1:13),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/body_block_string_apply_string.md b/src/snapshots/old_syntax/body_block_string_apply_string.md new file mode 100644 index 0000000000..23e18f3326 --- /dev/null +++ b/src/snapshots/old_syntax/body_block_string_apply_string.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=body_block_string_apply_string +type=expr +~~~ +# SOURCE +~~~roc +t="""" """"" +S +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `t` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),MultilineStringStart(1:3-1:6),StringPart(1:6-1:8),MultilineStringEnd(1:8-1:11),StringStart(1:11-1:12),StringPart(1:12-1:12),StringEnd(1:12-1:13),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "t")) +~~~ +# FORMATTED +~~~roc +t +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/body_with_unneeded_parens.md b/src/snapshots/old_syntax/body_with_unneeded_parens.md new file mode 100644 index 0000000000..a56ad9d04f --- /dev/null +++ b/src/snapshots/old_syntax/body_with_unneeded_parens.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=body_with_unneeded_parens +type=expr +~~~ +# SOURCE +~~~roc +a=( +6) +a +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +Int(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/bound_variable.md b/src/snapshots/old_syntax/bound_variable.md new file mode 100644 index 0000000000..ca544745b8 --- /dev/null +++ b/src/snapshots/old_syntax/bound_variable.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=bound_variable fail +type=expr +~~~ +# SOURCE +~~~roc +a: +c 0 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/call_bang.md b/src/snapshots/old_syntax/call_bang.md new file mode 100644 index 0000000000..0111574032 --- /dev/null +++ b/src/snapshots/old_syntax/call_bang.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=call_bang +type=expr +~~~ +# SOURCE +~~~roc +launchTheNukes! 123 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `launchTheNukes!` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:16),Int(1:17-1:20),EndOfFile(1:20-1:20), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.16 (qaul "") (raw "launchTheNukes!")) +~~~ +# FORMATTED +~~~roc +launchTheNukes! +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/call_bang_no_space.md b/src/snapshots/old_syntax/call_bang_no_space.md new file mode 100644 index 0000000000..5a439a9956 --- /dev/null +++ b/src/snapshots/old_syntax/call_bang_no_space.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=call_bang_no_space +type=expr +~~~ +# SOURCE +~~~roc +fxFn!arg +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `fxFn!arg` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.9 (qaul "") (raw "fxFn!arg")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/can_ignored_field_in_import.md b/src/snapshots/old_syntax/can_ignored_field_in_import.md new file mode 100644 index 0000000000..904de2e7e9 --- /dev/null +++ b/src/snapshots/old_syntax/can_ignored_field_in_import.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=can_ignored_field_in_import +type=expr +~~~ +# SOURCE +~~~roc +import P{_:h +} +t! +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import P** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**can_ignored_field_in_import.md:1:1:1:9:** +```roc +import P{_:h +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),UpperIdent(1:8-1:9),OpenCurly(1:9-1:10),Underscore(1:10-1:11),OpColon(1:11-1:12),LowerIdent(1:12-1:13),Newline(1:1-1:1), +CloseCurly(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/capture_body_parens_comment.md b/src/snapshots/old_syntax/capture_body_parens_comment.md new file mode 100644 index 0000000000..bb3a3075c7 --- /dev/null +++ b/src/snapshots/old_syntax/capture_body_parens_comment.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=capture_body_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +\L->(E +# +) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**capture_body_parens_comment.md:1:1:1:3:** +```roc +\L->(E +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpArrow(1:3-1:5),NoSpaceOpenRound(1:5-1:6),UpperIdent(1:6-1:7),Newline(1:1-1:1), +Newline(2:2-2:2), +CloseRound(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_arg_parens_then_comment.md b/src/snapshots/old_syntax/closure_arg_parens_then_comment.md new file mode 100644 index 0000000000..da53e12682 --- /dev/null +++ b/src/snapshots/old_syntax/closure_arg_parens_then_comment.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=closure_arg_parens_then_comment +type=expr +~~~ +# SOURCE +~~~roc +\(8)->T# +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_arg_parens_then_comment.md:1:1:1:3:** +```roc +\(8)->T# +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),CloseRound(1:4-1:5),OpArrow(1:5-1:7),UpperIdent(1:7-1:8),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_complex_pattern_indent_issue.md b/src/snapshots/old_syntax/closure_complex_pattern_indent_issue.md new file mode 100644 index 0000000000..43eedc653f --- /dev/null +++ b/src/snapshots/old_syntax/closure_complex_pattern_indent_issue.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=closure_complex_pattern_indent_issue +type=expr +~~~ +# SOURCE +~~~roc +\I{p?Y + Y}[ +]-> + K#( +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\I** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_complex_pattern_indent_issue.md:1:1:1:3:** +```roc +\I{p?Y +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpenCurly(1:3-1:4),LowerIdent(1:4-1:5),NoSpaceOpQuestion(1:5-1:6),UpperIdent(1:6-1:7),Newline(1:1-1:1), +UpperIdent(2:2-2:3),CloseCurly(2:3-2:4),OpenSquare(2:4-2:5),Newline(1:1-1:1), +CloseSquare(3:1-3:2),OpArrow(3:2-3:4),Newline(1:1-1:1), +UpperIdent(4:2-4:3),EndOfFile(4:5-4:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_in_apply_in_binop.md b/src/snapshots/old_syntax/closure_in_apply_in_binop.md new file mode 100644 index 0000000000..43810c7b9d --- /dev/null +++ b/src/snapshots/old_syntax/closure_in_apply_in_binop.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=closure_in_apply_in_binop +type=expr +~~~ +# SOURCE +~~~roc +m0\w->w?e +/s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `m0` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:3),OpBackslash(1:3-1:4),LowerIdent(1:4-1:5),OpArrow(1:5-1:7),LowerIdent(1:7-1:8),NoSpaceOpQuestion(1:8-1:9),LowerIdent(1:9-1:10),Newline(1:1-1:1), +OpSlash(2:1-2:2),LowerIdent(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.3 (qaul "") (raw "m0")) +~~~ +# FORMATTED +~~~roc +m0 +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/closure_in_binop_with_spaces.md b/src/snapshots/old_syntax/closure_in_binop_with_spaces.md new file mode 100644 index 0000000000..e1aee7d4b3 --- /dev/null +++ b/src/snapshots/old_syntax/closure_in_binop_with_spaces.md @@ -0,0 +1,56 @@ +# META +~~~ini +description=closure_in_binop_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +i>\s->s +-a +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\s** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_in_binop_with_spaces.md:1:3:1:5:** +```roc +i>\s->s +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpGreaterThan(1:2-1:3),OpBackslash(1:3-1:4),LowerIdent(1:4-1:5),OpArrow(1:5-1:7),LowerIdent(1:7-1:8),Newline(1:1-1:1), +OpUnaryMinus(2:1-2:2),LowerIdent(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.5 (op ">") + (e-ident @1.1-1.2 (qaul "") (raw "i")) + (e-malformed @1.3-1.5 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +i > +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.5 (op "gt") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/closure_newline_empty_record_newline.md b/src/snapshots/old_syntax/closure_newline_empty_record_newline.md new file mode 100644 index 0000000000..6d09ad5401 --- /dev/null +++ b/src/snapshots/old_syntax/closure_newline_empty_record_newline.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=closure_newline_empty_record_newline +type=expr +~~~ +# SOURCE +~~~roc +\L-> + { +} +Θ +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_newline_empty_record_newline.md:1:1:1:3:** +```roc +\L-> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpArrow(1:3-1:5),Newline(1:1-1:1), +OpenCurly(2:2-2:3),Newline(1:1-1:1), +CloseCurly(3:1-3:2),Newline(1:1-1:1), +MalformedUnicodeIdent(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_parens_double_newlines.md b/src/snapshots/old_syntax/closure_parens_double_newlines.md new file mode 100644 index 0000000000..483fd7af9d --- /dev/null +++ b/src/snapshots/old_syntax/closure_parens_double_newlines.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=closure_parens_double_newlines +type=expr +~~~ +# SOURCE +~~~roc +\L((z +) +)->42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_parens_double_newlines.md:1:1:1:3:** +```roc +\L((z +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),NoSpaceOpenRound(1:3-1:4),NoSpaceOpenRound(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:1-1:1), +CloseRound(2:1-2:2),Newline(1:1-1:1), +CloseRound(3:1-3:2),OpArrow(3:2-3:4),Int(3:4-3:6),EndOfFile(3:6-3:6), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_pat_reccord_comment.md b/src/snapshots/old_syntax/closure_pat_reccord_comment.md new file mode 100644 index 0000000000..30f8d591ad --- /dev/null +++ b/src/snapshots/old_syntax/closure_pat_reccord_comment.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=closure_pat_reccord_comment +type=expr +~~~ +# SOURCE +~~~roc +\{i# +,e}->a +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_pat_reccord_comment.md:1:1:1:3:** +```roc +\{i# +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:5-1:5), +Comma(2:1-2:2),LowerIdent(2:2-2:3),CloseCurly(2:3-2:4),OpArrow(2:4-2:6),LowerIdent(2:6-2:7),EndOfFile(2:7-2:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/closure_with_binops_and_unary.md b/src/snapshots/old_syntax/closure_with_binops_and_unary.md new file mode 100644 index 0000000000..0175a56c92 --- /dev/null +++ b/src/snapshots/old_syntax/closure_with_binops_and_unary.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=closure_with_binops_and_unary +type=expr +~~~ +# SOURCE +~~~roc +m + ^ -\w->m + w +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `m` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpCaret(2:2-2:3),OpUnaryMinus(2:4-2:5),OpBackslash(2:5-2:6),LowerIdent(2:6-2:7),OpArrow(2:7-2:9),LowerIdent(2:9-2:10),Newline(1:1-1:1), +LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "m")) +~~~ +# FORMATTED +~~~roc +m +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/closure_with_underscores.md b/src/snapshots/old_syntax/closure_with_underscores.md new file mode 100644 index 0000000000..98e4709a47 --- /dev/null +++ b/src/snapshots/old_syntax/closure_with_underscores.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=closure_with_underscores +type=expr +~~~ +# SOURCE +~~~roc +\_, _name -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\_** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**closure_with_underscores.md:1:1:1:3:** +```roc +\_, _name -> 42 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),Underscore(1:2-1:3),Comma(1:3-1:4),NamedUnderscore(1:5-1:10),OpArrow(1:11-1:13),Int(1:14-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/comma_prefixed_indented_record.md b/src/snapshots/old_syntax/comma_prefixed_indented_record.md new file mode 100644 index 0000000000..770edeb3de --- /dev/null +++ b/src/snapshots/old_syntax/comma_prefixed_indented_record.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=comma_prefixed_indented_record +type=expr +~~~ +# SOURCE +~~~roc +Model position : + { evaluated : Set position + , openSet : Set position + , costs : Dict.Dict position F64 + , cameFrom : Dict.Dict position position + } + +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:6),LowerIdent(1:7-1:15),OpColon(1:16-1:17),Newline(1:1-1:1), +OpenCurly(2:5-2:6),LowerIdent(2:7-2:16),OpColon(2:17-2:18),UpperIdent(2:19-2:22),LowerIdent(2:23-2:31),Newline(1:1-1:1), +Comma(3:5-3:6),LowerIdent(3:7-3:14),OpColon(3:15-3:16),UpperIdent(3:17-3:20),LowerIdent(3:21-3:29),Newline(1:1-1:1), +Comma(4:5-4:6),LowerIdent(4:7-4:12),OpColon(4:13-4:14),UpperIdent(4:15-4:19),NoSpaceDotUpperIdent(4:19-4:24),LowerIdent(4:25-4:33),UpperIdent(4:34-4:37),Newline(1:1-1:1), +Comma(5:5-5:6),LowerIdent(5:7-5:15),OpColon(5:16-5:17),UpperIdent(5:18-5:22),NoSpaceDotUpperIdent(5:22-5:27),LowerIdent(5:28-5:36),LowerIdent(5:37-5:45),Newline(1:1-1:1), +CloseCurly(6:5-6:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(8:1-8:2),EndOfFile(8:2-8:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.6 (raw "Model")) +~~~ +# FORMATTED +~~~roc +Model +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.6 (ext-var 73) (name "Model") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Model]*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_after_annotation.md b/src/snapshots/old_syntax/comment_after_annotation.md new file mode 100644 index 0000000000..cf569578cf --- /dev/null +++ b/src/snapshots/old_syntax/comment_after_annotation.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=comment_after_annotation +type=expr +~~~ +# SOURCE +~~~roc +F:e# + + +q +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:5-1:5), +Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "F")) +~~~ +# FORMATTED +~~~roc +F +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "F") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[F]*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_after_dbg_in_empty_record_assignment.md b/src/snapshots/old_syntax/comment_after_dbg_in_empty_record_assignment.md new file mode 100644 index 0000000000..ea41649702 --- /dev/null +++ b/src/snapshots/old_syntax/comment_after_dbg_in_empty_record_assignment.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=comment_after_dbg_in_empty_record_assignment +type=expr +~~~ +# SOURCE +~~~roc +{}=dbg l# +n +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),KwDbg(1:4-1:7),LowerIdent(1:8-1:9),Newline(1:10-1:10), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/comment_after_expr_in_parens.md b/src/snapshots/old_syntax/comment_after_expr_in_parens.md new file mode 100644 index 0000000000..c95ce21851 --- /dev/null +++ b/src/snapshots/old_syntax/comment_after_expr_in_parens.md @@ -0,0 +1,41 @@ +# META +~~~ini +description=comment_after_expr_in_parens +type=expr +~~~ +# SOURCE +~~~roc +(i#abc +) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:4-1:7), +CloseRound(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.2 + (e-ident @1.2-1.3 (qaul "") (raw "i"))) +~~~ +# FORMATTED +~~~roc +( + i, # abc +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.2 (id 75) + (elems + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/comment_after_op.md b/src/snapshots/old_syntax/comment_after_op.md new file mode 100644 index 0000000000..0ed82fabd8 --- /dev/null +++ b/src/snapshots/old_syntax/comment_after_op.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_after_op +type=expr +~~~ +# SOURCE +~~~roc +12 * # test! + 92 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:3),OpStar(1:5-1:6),Newline(1:8-1:14), +Int(2:2-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "*") + (e-int @1.1-1.3 (raw "12")) + (e-int @2.2-2.4 (raw "92"))) +~~~ +# FORMATTED +~~~roc +12 * # test! + 92 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "mul") (id 75) + (e-int @1.1-1.3 (value "12")) + (e-int @2.2-2.4 (value "92"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_after_whitespace_apply_arg_inside_pnc_apply.md b/src/snapshots/old_syntax/comment_after_whitespace_apply_arg_inside_pnc_apply.md new file mode 100644 index 0000000000..3f7e4f6b67 --- /dev/null +++ b/src/snapshots/old_syntax/comment_after_whitespace_apply_arg_inside_pnc_apply.md @@ -0,0 +1,60 @@ +# META +~~~ini +description=comment_after_whitespace_apply_arg_inside_pnc_apply +type=expr +~~~ +# SOURCE +~~~roc +PP(P@P(P +P(PPP(P +PPP +) +) +PP(mport#<|"P +) +) +) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_apply_close_round` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**comment_after_whitespace_apply_arg_inside_pnc_apply.md:1:1:1:4:** +```roc +PP(P@P(P +``` +^^^ + + +# TOKENS +~~~zig +UpperIdent(1:1-1:3),NoSpaceOpenRound(1:3-1:4),UpperIdent(1:4-1:5),OpaqueName(1:5-1:7),NoSpaceOpenRound(1:7-1:8),UpperIdent(1:8-1:9),Newline(1:1-1:1), +UpperIdent(2:1-2:2),NoSpaceOpenRound(2:2-2:3),UpperIdent(2:3-2:6),NoSpaceOpenRound(2:6-2:7),UpperIdent(2:7-2:8),Newline(1:1-1:1), +UpperIdent(3:1-3:4),Newline(1:1-1:1), +CloseRound(4:1-4:2),Newline(1:1-1:1), +CloseRound(5:1-5:2),Newline(1:1-1:1), +UpperIdent(6:1-6:3),NoSpaceOpenRound(6:3-6:4),LowerIdent(6:4-6:9),Newline(6:10-6:14), +CloseRound(7:1-7:2),Newline(1:1-1:1), +CloseRound(8:1-8:2),Newline(1:1-1:1), +CloseRound(9:1-9:2),EndOfFile(9:2-9:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expected_expr_apply_close_round")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/comment_before_colon_def.md b/src/snapshots/old_syntax/comment_before_colon_def.md new file mode 100644 index 0000000000..265432b526 --- /dev/null +++ b/src/snapshots/old_syntax/comment_before_colon_def.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_before_colon_def +type=expr +~~~ +# SOURCE +~~~roc +w# +:n +Q +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `w` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:3-1:3), +OpColon(2:1-2:2),LowerIdent(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "w")) +~~~ +# FORMATTED +~~~roc +w +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/comment_before_comma_in_tuple_type_with_func.md b/src/snapshots/old_syntax/comment_before_comma_in_tuple_type_with_func.md new file mode 100644 index 0000000000..5e4b0491b5 --- /dev/null +++ b/src/snapshots/old_syntax/comment_before_comma_in_tuple_type_with_func.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=comment_before_comma_in_tuple_type_with_func +type=expr +~~~ +# SOURCE +~~~roc +1:(M,b#, +,h->g)e +h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),UpperIdent(1:4-1:5),Comma(1:5-1:6),LowerIdent(1:6-1:7),Newline(1:8-1:9), +Comma(2:1-2:2),LowerIdent(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:6),CloseRound(2:6-2:7),LowerIdent(2:7-2:8),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/comment_before_equals_def.md b/src/snapshots/old_syntax/comment_before_equals_def.md new file mode 100644 index 0000000000..3a4b627c24 --- /dev/null +++ b/src/snapshots/old_syntax/comment_before_equals_def.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_before_equals_def +type=expr +~~~ +# SOURCE +~~~roc +t# +=3 +e +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `t` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:3-1:3), +OpAssign(2:1-2:2),Int(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "t")) +~~~ +# FORMATTED +~~~roc +t +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/comment_before_op.md b/src/snapshots/old_syntax/comment_before_op.md new file mode 100644 index 0000000000..6404991ad6 --- /dev/null +++ b/src/snapshots/old_syntax/comment_before_op.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_before_op +type=expr +~~~ +# SOURCE +~~~roc +3 # test! ++ 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:5-1:11), +OpPlus(2:1-2:2),Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "+") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 # test! + + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "add") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_before_pat_in_parens.md b/src/snapshots/old_syntax/comment_before_pat_in_parens.md new file mode 100644 index 0000000000..f12f8a0c0b --- /dev/null +++ b/src/snapshots/old_syntax/comment_before_pat_in_parens.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=comment_before_pat_in_parens +type=expr +~~~ +# SOURCE +~~~roc +( +# +6):s +h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +Newline(2:2-2:2), +Int(3:1-3:2),CloseRound(3:2-3:3),OpColon(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-3.3 + (e-int @3.1-3.2 (raw "6"))) +~~~ +# FORMATTED +~~~roc +( + + 6, +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-3.3 (id 74) + (elems + (e-int @3.1-3.2 (value "6")))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "(Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/comment_in_closure_pat.md b/src/snapshots/old_syntax/comment_in_closure_pat.md new file mode 100644 index 0000000000..076a47fba2 --- /dev/null +++ b/src/snapshots/old_syntax/comment_in_closure_pat.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=comment_in_closure_pat +type=expr +~~~ +# SOURCE +~~~roc +\L# + i->-e +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**comment_in_closure_pat.md:1:1:1:3:** +```roc +\L# +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),Newline(1:4-1:4), +LowerIdent(2:2-2:3),OpArrow(2:3-2:5),OpBinaryMinus(2:5-2:6),LowerIdent(2:6-2:7),EndOfFile(2:7-2:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/comment_in_closure_pat_apply.md b/src/snapshots/old_syntax/comment_in_closure_pat_apply.md new file mode 100644 index 0000000000..5aecec0888 --- /dev/null +++ b/src/snapshots/old_syntax/comment_in_closure_pat_apply.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=comment_in_closure_pat_apply +type=expr +~~~ +# SOURCE +~~~roc +\L,M# + Q->f8 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**comment_in_closure_pat_apply.md:1:1:1:3:** +```roc +\L,M# +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),Comma(1:3-1:4),UpperIdent(1:4-1:5),Newline(1:6-1:6), +UpperIdent(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:7),EndOfFile(2:7-2:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/comment_in_tuple_ext.md b/src/snapshots/old_syntax/comment_in_tuple_ext.md new file mode 100644 index 0000000000..889df1558a --- /dev/null +++ b/src/snapshots/old_syntax/comment_in_tuple_ext.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=comment_in_tuple_ext +type=expr +~~~ +# SOURCE +~~~roc +t:()(n# +# +) +p# +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `t` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),CloseRound(1:4-1:5),NoSpaceOpenRound(1:5-1:6),LowerIdent(1:6-1:7),Newline(1:8-1:8), +Newline(2:2-2:2), +CloseRound(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "t")) +~~~ +# FORMATTED +~~~roc +t +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/comment_indent_in_parens.md b/src/snapshots/old_syntax/comment_indent_in_parens.md new file mode 100644 index 0000000000..e8a88e9f75 --- /dev/null +++ b/src/snapshots/old_syntax/comment_indent_in_parens.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=comment_indent_in_parens +type=expr +~~~ +# SOURCE +~~~roc +1((0# +)# +):gi +M +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),Newline(1:6-1:6), +CloseRound(2:1-2:2),Newline(2:3-2:3), +CloseRound(3:1-3:2),OpColon(3:2-3:3),LowerIdent(3:3-3:5),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-3.2 + (e-int @1.1-1.2 (raw "1")) + (e-tuple @1.3-2.2 + (e-int @1.4-1.5 (raw "0")))) +~~~ +# FORMATTED +~~~roc +1( + ( + 0, + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-3.2 (id 77) + (e-int @1.1-1.2 (value "1")) + (e-tuple @1.3-2.2 + (elems + (e-int @1.4-1.5 (value "0"))))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_inside_empty_list.md b/src/snapshots/old_syntax/comment_inside_empty_list.md new file mode 100644 index 0000000000..a6a54509f5 --- /dev/null +++ b/src/snapshots/old_syntax/comment_inside_empty_list.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=comment_inside_empty_list +type=expr +~~~ +# SOURCE +~~~roc +[#comment +] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Newline(1:3-1:10), +CloseSquare(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-list @1.1-2.2) +~~~ +# FORMATTED +~~~roc +[] +~~~ +# CANONICALIZE +~~~clojure +(e-empty_list @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "List(*)")) +~~~ diff --git a/src/snapshots/old_syntax/comment_parens_in_typ_annotation_record_field.md b/src/snapshots/old_syntax/comment_parens_in_typ_annotation_record_field.md new file mode 100644 index 0000000000..a94664a7ef --- /dev/null +++ b/src/snapshots/old_syntax/comment_parens_in_typ_annotation_record_field.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_parens_in_typ_annotation_record_field +type=expr +~~~ +# SOURCE +~~~roc +i:{t:(J# +)} +A +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),OpenCurly(1:3-1:4),LowerIdent(1:4-1:5),OpColon(1:5-1:6),NoSpaceOpenRound(1:6-1:7),UpperIdent(1:7-1:8),Newline(1:9-1:9), +CloseRound(2:1-2:2),CloseCurly(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "i")) +~~~ +# FORMATTED +~~~roc +i +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/comment_with_non_ascii.md b/src/snapshots/old_syntax/comment_with_non_ascii.md new file mode 100644 index 0000000000..ff8dd63c9e --- /dev/null +++ b/src/snapshots/old_syntax/comment_with_non_ascii.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=comment_with_non_ascii +type=expr +~~~ +# SOURCE +~~~roc +3 # 2 × 2 ++ 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:5-1:12), +OpPlus(2:1-2:2),Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "+") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 # 2 × 2 + + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "add") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/comment_with_tab.md b/src/snapshots/old_syntax/comment_with_tab.md new file mode 100644 index 0000000000..e312630cb3 --- /dev/null +++ b/src/snapshots/old_syntax/comment_with_tab.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=comment_with_tab fail +type=expr +~~~ +# SOURCE +~~~roc +# comment with a +4 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** comment with a +4** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**comment_with_tab.md:1:2:2:2:** +```roc +# comment with a +4 +``` + + +# TOKENS +~~~zig +Newline(1:2-1:19), +Int(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/compare_apply_record.md b/src/snapshots/old_syntax/compare_apply_record.md new file mode 100644 index 0000000000..42f8b120cb --- /dev/null +++ b/src/snapshots/old_syntax/compare_apply_record.md @@ -0,0 +1,49 @@ +# META +~~~ini +description=compare_apply_record +type=expr +~~~ +# SOURCE +~~~roc +x> +x{ + +}") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-ident @2.1-2.2 (qaul "") (raw "x"))) +~~~ +# FORMATTED +~~~roc +x > + x +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.3 (op "gt") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/control_characters_in_scalar.md b/src/snapshots/old_syntax/control_characters_in_scalar.md new file mode 100644 index 0000000000..c6e6a2f66e --- /dev/null +++ b/src/snapshots/old_syntax/control_characters_in_scalar.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=control_characters_in_scalar +type=expr +~~~ +# SOURCE +~~~roc +'' +~~~ +# PROBLEMS +**UNCLOSED SINGLE QUOTE** +This character literal is missing a closing single quote. + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **''** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**control_characters_in_scalar.md:1:1:1:4:** +```roc +'' +``` +^^^ + + +# TOKENS +~~~zig +SingleQuote(1:1-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/crash.md b/src/snapshots/old_syntax/crash.md new file mode 100644 index 0000000000..0064399e47 --- /dev/null +++ b/src/snapshots/old_syntax/crash.md @@ -0,0 +1,60 @@ +# META +~~~ini +description=crash +type=expr +~~~ +# SOURCE +~~~roc +_ = crash "" +_ = crash "" "" +_ = crash 15 123 +_ = try foo (\_ -> crash "") +_ = + _ = crash "" + crash + +{ f: crash "" } +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **_ =** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**crash.md:1:1:1:4:** +```roc +_ = crash "" +``` +^^^ + + +# TOKENS +~~~zig +Underscore(1:1-1:2),OpAssign(1:3-1:4),KwCrash(1:5-1:10),StringStart(1:11-1:12),StringPart(1:12-1:12),StringEnd(1:12-1:13),Newline(1:1-1:1), +Underscore(2:1-2:2),OpAssign(2:3-2:4),KwCrash(2:5-2:10),StringStart(2:11-2:12),StringPart(2:12-2:12),StringEnd(2:12-2:13),StringStart(2:14-2:15),StringPart(2:15-2:15),StringEnd(2:15-2:16),Newline(1:1-1:1), +Underscore(3:1-3:2),OpAssign(3:3-3:4),KwCrash(3:5-3:10),Int(3:11-3:13),Int(3:14-3:17),Newline(1:1-1:1), +Underscore(4:1-4:2),OpAssign(4:3-4:4),LowerIdent(4:5-4:8),LowerIdent(4:9-4:12),OpenRound(4:13-4:14),OpBackslash(4:14-4:15),Underscore(4:15-4:16),OpArrow(4:17-4:19),KwCrash(4:20-4:25),StringStart(4:26-4:27),StringPart(4:27-4:27),StringEnd(4:27-4:28),CloseRound(4:28-4:29),Newline(1:1-1:1), +Underscore(5:1-5:2),OpAssign(5:3-5:4),Newline(1:1-1:1), +Underscore(6:3-6:4),OpAssign(6:5-6:6),KwCrash(6:7-6:12),StringStart(6:13-6:14),StringPart(6:14-6:14),StringEnd(6:14-6:15),Newline(1:1-1:1), +KwCrash(7:3-7:8),Newline(1:1-1:1), +Newline(1:1-1:1), +OpenCurly(9:1-9:2),LowerIdent(9:3-9:4),OpColon(9:4-9:5),KwCrash(9:6-9:11),StringStart(9:12-9:13),StringPart(9:13-9:13),StringEnd(9:13-9:14),CloseCurly(9:15-9:16),EndOfFile(9:16-9:16), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/crazy_annotation_left.md b/src/snapshots/old_syntax/crazy_annotation_left.md new file mode 100644 index 0000000000..ca5a5d26a4 --- /dev/null +++ b/src/snapshots/old_syntax/crazy_annotation_left.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=crazy_annotation_left +type=expr +~~~ +# SOURCE +~~~roc +1((0(# +0) +))f:f +t +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),NoSpaceOpenRound(1:5-1:6),Newline(1:7-1:7), +Int(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +CloseRound(3:1-3:2),CloseRound(3:2-3:3),LowerIdent(3:3-3:4),OpColon(3:4-3:5),LowerIdent(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-3.3 + (e-int @1.1-1.2 (raw "1")) + (e-tuple @1.3-3.2 + (e-apply @1.4-2.3 + (e-int @1.4-1.5 (raw "0")) + (e-int @2.1-2.2 (raw "0"))))) +~~~ +# FORMATTED +~~~roc +1( + ( + 0( + 0, + ), + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-3.3 (id 80) + (e-int @1.1-1.2 (value "1")) + (e-tuple @1.3-3.2 + (elems + (e-call @1.4-2.3 + (e-int @1.4-1.5 (value "0")) + (e-int @2.1-2.2 (value "0")))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/crazy_annotation_left2.md b/src/snapshots/old_syntax/crazy_annotation_left2.md new file mode 100644 index 0000000000..55c172c483 --- /dev/null +++ b/src/snapshots/old_syntax/crazy_annotation_left2.md @@ -0,0 +1,62 @@ +# META +~~~ini +description=crazy_annotation_left2 +type=expr +~~~ +# SOURCE +~~~roc +1(ts((0 +) +# +) +)f:i7f +e +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `ts` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:5),NoSpaceOpenRound(1:5-1:6),NoSpaceOpenRound(1:6-1:7),Int(1:7-1:8),Newline(1:1-1:1), +CloseRound(2:1-2:2),Newline(1:1-1:1), +Newline(3:2-3:2), +CloseRound(4:1-4:2),Newline(1:1-1:1), +CloseRound(5:1-5:2),LowerIdent(5:2-5:3),OpColon(5:3-5:4),LowerIdent(5:4-5:7),Newline(1:1-1:1), +LowerIdent(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-5.2 + (e-int @1.1-1.2 (raw "1")) + (e-apply @1.3-4.2 + (e-ident @1.3-1.5 (qaul "") (raw "ts")) + (e-tuple @1.6-2.2 + (e-int @1.7-1.8 (raw "0"))))) +~~~ +# FORMATTED +~~~roc +1( + ts( + ( + 0, + ), + + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-5.2 (id 81) + (e-int @1.1-1.2 (value "1")) + (e-call @1.3-4.2 + (e-runtime-error (tag "ident_not_in_scope")) + (e-tuple @1.6-2.2 + (elems + (e-int @1.7-1.8 (value "0")))))) +~~~ +# TYPES +~~~clojure +(expr (id 81) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/crazy_implements_bangs.md b/src/snapshots/old_syntax/crazy_implements_bangs.md new file mode 100644 index 0000000000..2cc80b5623 --- /dev/null +++ b/src/snapshots/old_syntax/crazy_implements_bangs.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=crazy_implements_bangs +type=expr +~~~ +# SOURCE +~~~roc +P:=p# + implements[] +n +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColonEqual(1:2-1:4),LowerIdent(1:4-1:5),Newline(1:6-1:6), +KwImplements(2:3-2:13),OpenSquare(2:13-2:14),CloseSquare(2:14-2:15),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "P")) +~~~ +# FORMATTED +~~~roc +P +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "P") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[P]*")) +~~~ diff --git a/src/snapshots/old_syntax/crazy_parens_multiline_str_question_etc.md b/src/snapshots/old_syntax/crazy_parens_multiline_str_question_etc.md new file mode 100644 index 0000000000..67a235566a --- /dev/null +++ b/src/snapshots/old_syntax/crazy_parens_multiline_str_question_etc.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=crazy_parens_multiline_str_question_etc +type=expr +~~~ +# SOURCE +~~~roc +((d +-""""""()?))Y +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**crazy_parens_multiline_str_question_etc.md:2:9:2:11:** +```roc +-""""""()?))Y +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**crazy_parens_multiline_str_question_etc.md:2:11:2:13:** +```roc +-""""""()?))Y +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:1-1:1), +OpUnaryMinus(2:1-2:2),MultilineStringStart(2:2-2:5),StringPart(2:5-2:5),MultilineStringEnd(2:5-2:8),NoSpaceOpenRound(2:8-2:9),CloseRound(2:9-2:10),NoSpaceOpQuestion(2:10-2:11),CloseRound(2:11-2:12),CloseRound(2:12-2:13),UpperIdent(2:13-2:14),EndOfFile(2:14-2:14), +~~~ +# PARSE +~~~clojure +(e-malformed @2.11-2.13 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/crazy_pat_ann.md b/src/snapshots/old_syntax/crazy_pat_ann.md new file mode 100644 index 0000000000..abe5b4683e --- /dev/null +++ b/src/snapshots/old_syntax/crazy_pat_ann.md @@ -0,0 +1,55 @@ +# META +~~~ini +description=crazy_pat_ann +type=expr +~~~ +# SOURCE +~~~roc +((((0) +)# +))f:f +t +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),NoSpaceOpenRound(1:4-1:5),Int(1:5-1:6),CloseRound(1:6-1:7),Newline(1:1-1:1), +CloseRound(2:1-2:2),Newline(2:3-2:3), +CloseRound(3:1-3:2),CloseRound(3:2-3:3),LowerIdent(3:3-3:4),OpColon(3:4-3:5),LowerIdent(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-3.3 + (e-tuple @1.2-3.2 + (e-tuple @1.3-2.2 + (e-tuple @1.4-1.7 + (e-int @1.5-1.6 (raw "0")))))) +~~~ +# FORMATTED +~~~roc +( + ( + ( + (0), + ), + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-3.3 (id 77) + (elems + (e-tuple @1.2-3.2 + (elems + (e-tuple @1.3-2.2 + (elems + (e-tuple @1.4-1.7 + (elems + (e-int @1.5-1.6 (value "0")))))))))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "(Num(*), (Num(*)), (Num(*), (Num(*))), (Num(*), (Num(*)), (Num(*), (Num(*)))))")) +~~~ diff --git a/src/snapshots/old_syntax/curried_function_type.md b/src/snapshots/old_syntax/curried_function_type.md new file mode 100644 index 0000000000..7045931635 --- /dev/null +++ b/src/snapshots/old_syntax/curried_function_type.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=curried_function_type +type=expr +~~~ +# SOURCE +~~~roc +1:(w->w->p) +h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),OpArrow(1:5-1:7),LowerIdent(1:7-1:8),OpArrow(1:8-1:10),LowerIdent(1:10-1:11),CloseRound(1:11-1:12),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/d_assign_return_bang.md b/src/snapshots/old_syntax/d_assign_return_bang.md new file mode 100644 index 0000000000..b866b94400 --- /dev/null +++ b/src/snapshots/old_syntax/d_assign_return_bang.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=d_assign_return_bang fail +type=expr +~~~ +# SOURCE +~~~roc +D=return!- + e +z# +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpAssign(1:2-1:3),LowerIdent(1:3-1:10),OpBinaryMinus(1:10-1:11),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "D")) +~~~ +# FORMATTED +~~~roc +D +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "D") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[D]*")) +~~~ diff --git a/src/snapshots/old_syntax/dbg.md b/src/snapshots/old_syntax/dbg.md new file mode 100644 index 0000000000..3f18198484 --- /dev/null +++ b/src/snapshots/old_syntax/dbg.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=dbg +type=expr +~~~ +# SOURCE +~~~roc +dbg 1 +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),Int(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-int @1.5-1.6 (raw "1"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_bang_neg_bang_if_bang.md b/src/snapshots/old_syntax/dbg_bang_neg_bang_if_bang.md new file mode 100644 index 0000000000..6c4ce26119 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_bang_neg_bang_if_bang.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=dbg_bang_neg_bang_if_bang fail +type=expr +~~~ +# SOURCE +~~~roc +dbg!-!if! +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!if!** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**dbg_bang_neg_bang_if_bang.md:1:6:1:10:** +```roc +dbg!-!if! +``` + ^^^^ + + +**UNDEFINED VARIABLE** +Nothing is named `dbg!` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpBinaryMinus(1:5-1:6),OpBang(1:6-1:7),LowerIdent(1:7-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.10 (op "-") + (e-ident @1.1-1.5 (qaul "") (raw "dbg!")) + (e-malformed @1.6-1.10 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +dbg! - +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.10 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_double.md b/src/snapshots/old_syntax/dbg_double.md new file mode 100644 index 0000000000..8f3e9dc9fe --- /dev/null +++ b/src/snapshots/old_syntax/dbg_double.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=dbg_double +type=expr +~~~ +# SOURCE +~~~roc +dbg dbg g g +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),KwDbg(1:5-1:8),LowerIdent(1:9-1:10),LowerIdent(1:11-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-dbg + (e-ident @1.9-1.10 (qaul "") (raw "g")))) +~~~ +# FORMATTED +~~~roc +dbg dbg g +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_double_newline.md b/src/snapshots/old_syntax/dbg_double_newline.md new file mode 100644 index 0000000000..ab1f444c34 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_double_newline.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=dbg_double_newline +type=expr +~~~ +# SOURCE +~~~roc +dbg dbg + a g +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),KwDbg(1:5-1:8),Newline(1:1-1:1), +LowerIdent(2:2-2:3),LowerIdent(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-dbg + (e-ident @2.2-2.3 (qaul "") (raw "a")))) +~~~ +# FORMATTED +~~~roc +dbg dbg + a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_extra_parens.md b/src/snapshots/old_syntax/dbg_extra_parens.md new file mode 100644 index 0000000000..ae98e023de --- /dev/null +++ b/src/snapshots/old_syntax/dbg_extra_parens.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=dbg_extra_parens +type=expr +~~~ +# SOURCE +~~~roc +{ +}=dbg d z +dd +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +CloseCurly(2:1-2:2),OpAssign(2:2-2:3),KwDbg(2:3-2:6),LowerIdent(2:7-2:8),LowerIdent(2:9-2:10),Newline(1:1-1:1), +LowerIdent(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.2) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_newline_apply.md b/src/snapshots/old_syntax/dbg_newline_apply.md new file mode 100644 index 0000000000..6421a19f86 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_newline_apply.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=dbg_newline_apply +type=expr +~~~ +# SOURCE +~~~roc +dbg + + izzb + interfacesb +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:2-3:6),Newline(1:1-1:1), +LowerIdent(4:3-4:14),EndOfFile(4:14-4:14), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-ident @3.2-3.6 (qaul "") (raw "izzb"))) +~~~ +# FORMATTED +~~~roc +dbg + + izzb +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_pnc_a_over_a.md b/src/snapshots/old_syntax/dbg_pnc_a_over_a.md new file mode 100644 index 0000000000..eae6c7726f --- /dev/null +++ b/src/snapshots/old_syntax/dbg_pnc_a_over_a.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=dbg_pnc_a_over_a +type=expr +~~~ +# SOURCE +~~~roc +dbg(a/a) +d +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),NoSpaceOpenRound(1:4-1:5),LowerIdent(1:5-1:6),OpSlash(1:6-1:7),LowerIdent(1:7-1:8),CloseRound(1:8-1:9),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-tuple @1.4-1.9 + (e-binop @1.5-1.9 (op "/") + (e-ident @1.5-1.6 (qaul "") (raw "a")) + (e-ident @1.7-1.8 (qaul "") (raw "a"))))) +~~~ +# FORMATTED +~~~roc +dbg (a / a) +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_pnc_in_double_parens.md b/src/snapshots/old_syntax/dbg_pnc_in_double_parens.md new file mode 100644 index 0000000000..41bb9fdd6d --- /dev/null +++ b/src/snapshots/old_syntax/dbg_pnc_in_double_parens.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=dbg_pnc_in_double_parens +type=expr +~~~ +# SOURCE +~~~roc +((dbg(r)) +r) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**dbg_pnc_in_double_parens.md:2:2:2:3:** +```roc +r) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),KwDbg(1:3-1:6),NoSpaceOpenRound(1:6-1:7),LowerIdent(1:7-1:8),CloseRound(1:8-1:9),CloseRound(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @2.2-2.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/dbg_pnc_zero_args.md b/src/snapshots/old_syntax/dbg_pnc_zero_args.md new file mode 100644 index 0000000000..4bc0ac6052 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_pnc_zero_args.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=dbg_pnc_zero_args +type=expr +~~~ +# SOURCE +~~~roc +dbg() +d +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),NoSpaceOpenRound(1:4-1:5),CloseRound(1:5-1:6),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-tuple @1.4-1.6)) +~~~ +# FORMATTED +~~~roc +dbg () +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_stmt.md b/src/snapshots/old_syntax/dbg_stmt.md new file mode 100644 index 0000000000..c245a680e0 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_stmt.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=dbg_stmt +type=expr +~~~ +# SOURCE +~~~roc + +dbg (1 == 1) + +4 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** +dbg** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**dbg_stmt.md:1:1:2:4:** +```roc + +dbg (1 == 1) +``` + + +# TOKENS +~~~zig +Newline(1:1-1:1), +KwDbg(2:1-2:4),OpenRound(2:5-2:6),Int(2:6-2:7),OpEquals(2:8-2:10),Int(2:11-2:12),CloseRound(2:12-2:13),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-2.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/dbg_stmt_in_parens.md b/src/snapshots/old_syntax/dbg_stmt_in_parens.md new file mode 100644 index 0000000000..42140da9a9 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_stmt_in_parens.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=dbg_stmt_in_parens +type=expr +~~~ +# SOURCE +~~~roc +(dbg D + q +h) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**dbg_stmt_in_parens.md:3:2:3:3:** +```roc +h) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),KwDbg(1:2-1:5),UpperIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @3.2-3.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/dbg_stmt_multiline.md b/src/snapshots/old_syntax/dbg_stmt_multiline.md new file mode 100644 index 0000000000..54f8f56477 --- /dev/null +++ b/src/snapshots/old_syntax/dbg_stmt_multiline.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=dbg_stmt_multiline +type=expr +~~~ +# SOURCE +~~~roc +dbg (5, + 666) + +4 +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),OpenRound(1:5-1:6),Int(1:6-1:7),Comma(1:7-1:8),Newline(1:1-1:1), +Int(2:5-2:8),CloseRound(2:8-2:9),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-tuple @1.5-2.9 + (e-int @1.6-1.7 (raw "5")) + (e-int @2.5-2.8 (raw "666")))) +~~~ +# FORMATTED +~~~roc +dbg ( + 5, + 666, +) +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_stmt_two_exprs.md b/src/snapshots/old_syntax/dbg_stmt_two_exprs.md new file mode 100644 index 0000000000..84f67844bf --- /dev/null +++ b/src/snapshots/old_syntax/dbg_stmt_two_exprs.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=dbg_stmt_two_exprs +type=expr +~~~ +# SOURCE +~~~roc +dbg + (q + qt) +g + qt +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**dbg_stmt_two_exprs.md:3:7:3:7:** +```roc + qt) +``` + + + +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),Newline(1:1-1:1), +OpenRound(2:2-2:3),LowerIdent(2:3-2:4),Newline(1:1-1:1), +LowerIdent(3:5-3:7),CloseRound(3:7-3:8),Newline(1:1-1:1), +LowerIdent(4:1-4:2),Newline(1:1-1:1), +LowerIdent(5:2-5:4),EndOfFile(5:4-5:4), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-malformed @1.1-1.1 (reason "expected_expr_close_round_or_comma"))) +~~~ +# FORMATTED +~~~roc +dbg +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/dbg_then_double_parens_cont.md b/src/snapshots/old_syntax/dbg_then_double_parens_cont.md new file mode 100644 index 0000000000..9885c3e4cc --- /dev/null +++ b/src/snapshots/old_syntax/dbg_then_double_parens_cont.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=dbg_then_double_parens_cont +type=expr +~~~ +# SOURCE +~~~roc +dbg g +((L +))# +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +KwDbg(1:1-1:4),LowerIdent(1:5-1:6),Newline(1:1-1:1), +OpenRound(2:1-2:2),NoSpaceOpenRound(2:2-2:3),UpperIdent(2:3-2:4),Newline(1:1-1:1), +CloseRound(3:1-3:2),CloseRound(3:2-3:3),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-dbg + (e-ident @1.5-1.6 (qaul "") (raw "g"))) +~~~ +# FORMATTED +~~~roc +dbg g +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/def_bang.md b/src/snapshots/old_syntax/def_bang.md new file mode 100644 index 0000000000..e6ec47998d --- /dev/null +++ b/src/snapshots/old_syntax/def_bang.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=def_bang +type=expr +~~~ +# SOURCE +~~~roc +launchTheNukes! = \{} -> + boom + +launchTheNukes! {} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `launchTheNukes!` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:16),OpAssign(1:17-1:18),OpBackslash(1:19-1:20),OpenCurly(1:20-1:21),CloseCurly(1:21-1:22),OpArrow(1:23-1:25),Newline(1:1-1:1), +LowerIdent(2:5-2:9),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:16),OpenCurly(4:17-4:18),CloseCurly(4:18-4:19),EndOfFile(4:19-4:19), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.16 (qaul "") (raw "launchTheNukes!")) +~~~ +# FORMATTED +~~~roc +launchTheNukes! +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/def_missing_final_expression.md b/src/snapshots/old_syntax/def_missing_final_expression.md new file mode 100644 index 0000000000..1d0925950c --- /dev/null +++ b/src/snapshots/old_syntax/def_missing_final_expression.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=def_missing_final_expression fail +type=expr +~~~ +# SOURCE +~~~roc +f : Foo.foo +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),NoSpaceDotLowerIdent(1:8-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/def_multistring_apply.md b/src/snapshots/old_syntax/def_multistring_apply.md new file mode 100644 index 0000000000..8d43d6f9c9 --- /dev/null +++ b/src/snapshots/old_syntax/def_multistring_apply.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=def_multistring_apply +type=expr +~~~ +# SOURCE +~~~roc +e=""""""a +p +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),MultilineStringStart(1:3-1:6),StringPart(1:6-1:6),MultilineStringEnd(1:6-1:9),LowerIdent(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "e")) +~~~ +# FORMATTED +~~~roc +e +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/def_without_newline.md b/src/snapshots/old_syntax/def_without_newline.md new file mode 100644 index 0000000000..cebd076468 --- /dev/null +++ b/src/snapshots/old_syntax/def_without_newline.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=def_without_newline fail +type=expr +~~~ +# SOURCE +~~~roc +a:b i +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:4),LowerIdent(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/deprecated_interpolated_string.md b/src/snapshots/old_syntax/deprecated_interpolated_string.md new file mode 100644 index 0000000000..8fb86a8d3e --- /dev/null +++ b/src/snapshots/old_syntax/deprecated_interpolated_string.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=deprecated_interpolated_string fail +type=expr +~~~ +# SOURCE +~~~roc +"\(e)" +~~~ +# PROBLEMS +**INVALID ESCAPE SEQUENCE** +This escape sequence is not recognized. + +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:6),StringEnd(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.7 + (e-string-part @1.2-1.6 (raw "\(e)"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.7 (id 74) + (e-literal @1.2-1.6 (string "\(e)"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/destructure_tag_assignment.md b/src/snapshots/old_syntax/destructure_tag_assignment.md new file mode 100644 index 0000000000..0fb5e90393 --- /dev/null +++ b/src/snapshots/old_syntax/destructure_tag_assignment.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=destructure_tag_assignment +type=expr +~~~ +# SOURCE +~~~roc +Email str = Email "blah@example.com" +str +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:6),LowerIdent(1:7-1:10),OpAssign(1:11-1:12),UpperIdent(1:13-1:18),StringStart(1:19-1:20),StringPart(1:20-1:36),StringEnd(1:36-1:37),Newline(1:1-1:1), +LowerIdent(2:1-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.6 (raw "Email")) +~~~ +# FORMATTED +~~~roc +Email +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.6 (ext-var 73) (name "Email") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Email]*")) +~~~ diff --git a/src/snapshots/old_syntax/docs.md b/src/snapshots/old_syntax/docs.md new file mode 100644 index 0000000000..c0199d8b9a --- /dev/null +++ b/src/snapshots/old_syntax/docs.md @@ -0,0 +1,59 @@ +# META +~~~ini +description=docs +type=expr +~~~ +# SOURCE +~~~roc +####### +### not docs! +##actually docs +## +###### +x = 5 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **###### +### not docs!** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**docs.md:1:2:2:14:** +```roc +####### +### not docs! +``` + + +# TOKENS +~~~zig +Newline(1:2-1:8), +Newline(2:2-2:14), +Newline(3:2-3:16), +Newline(4:2-4:3), +Newline(5:2-5:7), +LowerIdent(6:1-6:2),OpAssign(6:3-6:4),Int(6:5-6:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(8:1-8:3),EndOfFile(8:3-8:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.14 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/double_closure_newlines_binop.md b/src/snapshots/old_syntax/double_closure_newlines_binop.md new file mode 100644 index 0000000000..58f3e3d8d8 --- /dev/null +++ b/src/snapshots/old_syntax/double_closure_newlines_binop.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=double_closure_newlines_binop +type=expr +~~~ +# SOURCE +~~~roc +\j->e\B + ->B + >s +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\j** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**double_closure_newlines_binop.md:1:1:1:3:** +```roc +\j->e\B +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),OpArrow(1:3-1:5),LowerIdent(1:5-1:6),OpBackslash(1:6-1:7),UpperIdent(1:7-1:8),Newline(1:1-1:1), +OpArrow(2:2-2:4),UpperIdent(2:4-2:5),Newline(1:1-1:1), +OpGreaterThan(3:2-3:3),LowerIdent(3:3-3:4),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/double_function_tuple.md b/src/snapshots/old_syntax/double_function_tuple.md new file mode 100644 index 0000000000..df669d7720 --- /dev/null +++ b/src/snapshots/old_syntax/double_function_tuple.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=double_function_tuple +type=expr +~~~ +# SOURCE +~~~roc +1:(w->p, +w->p) +h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),OpArrow(1:5-1:7),LowerIdent(1:7-1:8),Comma(1:8-1:9),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpArrow(2:2-2:4),LowerIdent(2:4-2:5),CloseRound(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/double_parens_comment_tuple_pat.md b/src/snapshots/old_syntax/double_parens_comment_tuple_pat.md new file mode 100644 index 0000000000..de2e6b8def --- /dev/null +++ b/src/snapshots/old_syntax/double_parens_comment_tuple_pat.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=double_parens_comment_tuple_pat +type=expr +~~~ +# SOURCE +~~~roc +((0# +)e,(0# +)p):f +t# +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**double_parens_comment_tuple_pat.md:3:1:3:3:** +```roc +)p):f +``` +^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),Newline(1:5-1:5), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),Comma(2:3-2:4),NoSpaceOpenRound(2:4-2:5),Int(2:5-2:6),Newline(2:7-2:7), +CloseRound(3:1-3:2),LowerIdent(3:2-3:3),CloseRound(3:3-3:4),OpColon(3:4-3:5),LowerIdent(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-malformed @3.1-3.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/double_plus.md b/src/snapshots/old_syntax/double_plus.md new file mode 100644 index 0000000000..5aa3926ca5 --- /dev/null +++ b/src/snapshots/old_syntax/double_plus.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=double_plus fail +type=expr +~~~ +# SOURCE +~~~roc +main = + [] ++ [] +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `main` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),Newline(1:1-1:1), +OpenSquare(2:5-2:6),CloseSquare(2:6-2:7),OpPlus(2:8-2:9),OpPlus(2:9-2:10),OpenSquare(2:11-2:12),CloseSquare(2:12-2:13),EndOfFile(2:13-2:13), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "main")) +~~~ +# FORMATTED +~~~roc +main +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/double_question_binop.md b/src/snapshots/old_syntax/double_question_binop.md new file mode 100644 index 0000000000..7fad47f386 --- /dev/null +++ b/src/snapshots/old_syntax/double_question_binop.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=double_question_binop +type=expr +~~~ +# SOURCE +~~~roc +get_name! {} ?? "Bob" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `get_name!` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:10),OpenCurly(1:11-1:12),CloseCurly(1:12-1:13),OpDoubleQuestion(1:14-1:16),StringStart(1:17-1:18),StringPart(1:18-1:21),StringEnd(1:21-1:22),EndOfFile(1:22-1:22), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.10 (qaul "") (raw "get_name!")) +~~~ +# FORMATTED +~~~roc +get_name! +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/double_space_before.md b/src/snapshots/old_syntax/double_space_before.md new file mode 100644 index 0000000000..bc6d2e4731 --- /dev/null +++ b/src/snapshots/old_syntax/double_space_before.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=double_space_before +type=expr +~~~ +# SOURCE +~~~roc +1:( +( +M))w +ah +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +OpenRound(2:1-2:2),Newline(1:1-1:1), +UpperIdent(3:1-3:2),CloseRound(3:2-3:3),CloseRound(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/effectful_closure_statements.md b/src/snapshots/old_syntax/effectful_closure_statements.md new file mode 100644 index 0000000000..569aa32699 --- /dev/null +++ b/src/snapshots/old_syntax/effectful_closure_statements.md @@ -0,0 +1,64 @@ +# META +~~~ini +description=effectful_closure_statements +type=expr +~~~ +# SOURCE +~~~roc +\{} -> + echo "Welcome to the DMV!" + age = readInt + + if age < 16 then + echo "You're too young to drive!" + exit 1 + else + {} + + echo "Let's get started on your driver's license application." +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**effectful_closure_statements.md:1:1:1:3:** +```roc +\{} -> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),OpenCurly(1:2-1:3),CloseCurly(1:3-1:4),OpArrow(1:5-1:7),Newline(1:1-1:1), +LowerIdent(2:5-2:9),StringStart(2:10-2:11),StringPart(2:11-2:30),StringEnd(2:30-2:31),Newline(1:1-1:1), +LowerIdent(3:5-3:8),OpAssign(3:9-3:10),LowerIdent(3:11-3:18),Newline(1:1-1:1), +Newline(1:1-1:1), +KwIf(5:5-5:7),LowerIdent(5:8-5:11),OpLessThan(5:12-5:13),Int(5:14-5:16),LowerIdent(5:17-5:21),Newline(1:1-1:1), +LowerIdent(6:9-6:13),StringStart(6:14-6:15),StringPart(6:15-6:41),StringEnd(6:41-6:42),Newline(1:1-1:1), +LowerIdent(7:9-7:13),Int(7:14-7:15),Newline(1:1-1:1), +KwElse(8:5-8:9),Newline(1:1-1:1), +OpenCurly(9:9-9:10),CloseCurly(9:10-9:11),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(11:5-11:9),StringStart(11:10-11:11),StringPart(11:11-11:66),StringEnd(11:66-11:67),EndOfFile(11:67-11:67), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/elm_function_syntax.md b/src/snapshots/old_syntax/elm_function_syntax.md new file mode 100644 index 0000000000..b5100905e4 --- /dev/null +++ b/src/snapshots/old_syntax/elm_function_syntax.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=elm_function_syntax fail +type=expr +~~~ +# SOURCE +~~~roc +f x y = x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),LowerIdent(1:3-1:4),LowerIdent(1:5-1:6),OpAssign(1:7-1:8),LowerIdent(1:9-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/empty_list.md b/src/snapshots/old_syntax/empty_list.md new file mode 100644 index 0000000000..44b9df2bf9 --- /dev/null +++ b/src/snapshots/old_syntax/empty_list.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=empty_list +type=expr +~~~ +# SOURCE +~~~roc +[] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),CloseSquare(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-list @1.1-1.3) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-empty_list @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "List(*)")) +~~~ diff --git a/src/snapshots/old_syntax/empty_or_pattern.md b/src/snapshots/old_syntax/empty_or_pattern.md new file mode 100644 index 0000000000..9bef9ed465 --- /dev/null +++ b/src/snapshots/old_syntax/empty_or_pattern.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=empty_or_pattern fail +type=expr +~~~ +# SOURCE +~~~roc +when Just 4 is + Just 4 | -> + 4 + + _ -> + 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),UpperIdent(1:6-1:10),Int(1:11-1:12),LowerIdent(1:13-1:15),Newline(1:1-1:1), +UpperIdent(2:5-2:9),Int(2:10-2:11),OpBar(2:12-2:13),OpArrow(2:14-2:16),Newline(1:1-1:1), +Int(3:9-3:10),Newline(1:1-1:1), +Newline(1:1-1:1), +Underscore(5:5-5:6),OpArrow(5:7-5:9),Newline(1:1-1:1), +Int(6:9-6:10),EndOfFile(6:10-6:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record.md b/src/snapshots/old_syntax/empty_record.md new file mode 100644 index 0000000000..0b692647b6 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=empty_record +type=expr +~~~ +# SOURCE +~~~roc +{} +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assign_dbg.md b/src/snapshots/old_syntax/empty_record_assign_dbg.md new file mode 100644 index 0000000000..8c67035591 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assign_dbg.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=empty_record_assign_dbg +type=expr +~~~ +# SOURCE +~~~roc +{}= + dbg c + c +e +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),Newline(1:1-1:1), +KwDbg(2:2-2:5),LowerIdent(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assign_expect_bang.md b/src/snapshots/old_syntax/empty_record_assign_expect_bang.md new file mode 100644 index 0000000000..bb5c0c597c --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assign_expect_bang.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=empty_record_assign_expect_bang fail +type=expr +~~~ +# SOURCE +~~~roc +{}=expect!w +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),LowerIdent(1:4-1:12),Newline(1:1-1:1), +Int(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assign_implements.md b/src/snapshots/old_syntax/empty_record_assign_implements.md new file mode 100644 index 0000000000..996b6ae818 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assign_implements.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=empty_record_assign_implements +type=expr +~~~ +# SOURCE +~~~roc +{}=O{}implements +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),UpperIdent(1:4-1:5),OpenCurly(1:5-1:6),CloseCurly(1:6-1:7),KwImplements(1:7-1:17),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assign_return.md b/src/snapshots/old_syntax/empty_record_assign_return.md new file mode 100644 index 0000000000..b77688e4fb --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assign_return.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=empty_record_assign_return +type=expr +~~~ +# SOURCE +~~~roc +{}= +return f +d +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),Newline(1:1-1:1), +KwReturn(2:1-2:7),LowerIdent(2:8-2:9),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assign_tag.md b/src/snapshots/old_syntax/empty_record_assign_tag.md new file mode 100644 index 0000000000..d3daeb4d35 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assign_tag.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=empty_record_assign_tag +type=expr +~~~ +# SOURCE +~~~roc +{}= + P +O +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),Newline(1:1-1:1), +UpperIdent(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assignment.md b/src/snapshots/old_syntax/empty_record_assignment.md new file mode 100644 index 0000000000..ac6bc385df --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assignment.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=empty_record_assignment +type=expr +~~~ +# SOURCE +~~~roc +{}=B +I +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),UpperIdent(1:4-1:5),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_assignment_d_when_bang.md b/src/snapshots/old_syntax/empty_record_assignment_d_when_bang.md new file mode 100644 index 0000000000..91fdab3d8a --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_assignment_d_when_bang.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=empty_record_assignment_d_when_bang fail +type=expr +~~~ +# SOURCE +~~~roc +{ +}=d when! +s +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +CloseCurly(2:1-2:2),OpAssign(2:2-2:3),LowerIdent(2:3-2:4),LowerIdent(2:5-2:10),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.2) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_eq_dbg.md b/src/snapshots/old_syntax/empty_record_eq_dbg.md new file mode 100644 index 0000000000..f6574f8862 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_eq_dbg.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=empty_record_eq_dbg +type=expr +~~~ +# SOURCE +~~~roc +{ +} +=dbg n +d +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +CloseCurly(2:1-2:2),Newline(1:1-1:1), +OpAssign(3:1-3:2),KwDbg(3:2-3:5),LowerIdent(3:6-3:7),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.2) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_eq_newlines_doubleeq.md b/src/snapshots/old_syntax/empty_record_eq_newlines_doubleeq.md new file mode 100644 index 0000000000..a00eeb748b --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_eq_newlines_doubleeq.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=empty_record_eq_newlines_doubleeq +type=expr +~~~ +# SOURCE +~~~roc +{ +} +=d== + g +d +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +CloseCurly(2:1-2:2),Newline(1:1-1:1), +OpAssign(3:1-3:2),LowerIdent(3:2-3:3),OpEquals(3:3-3:5),Newline(1:1-1:1), +LowerIdent(4:2-4:3),Newline(1:1-1:1), +LowerIdent(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.2) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_newline_assign.md b/src/snapshots/old_syntax/empty_record_newline_assign.md new file mode 100644 index 0000000000..46fd8cdadf --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_newline_assign.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=empty_record_newline_assign +type=expr +~~~ +# SOURCE +~~~roc + +{} +={} +I +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** +{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**empty_record_newline_assign.md:1:1:2:2:** +```roc + +{} +``` + + +# TOKENS +~~~zig +Newline(1:1-1:1), +OpenCurly(2:1-2:2),CloseCurly(2:2-2:3),Newline(1:1-1:1), +OpAssign(3:1-3:2),OpenCurly(3:2-3:3),CloseCurly(3:3-3:4),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/empty_record_update.md b/src/snapshots/old_syntax/empty_record_update.md new file mode 100644 index 0000000000..d300f09f37 --- /dev/null +++ b/src/snapshots/old_syntax/empty_record_update.md @@ -0,0 +1,55 @@ +# META +~~~ini +description=empty_record_update +type=expr +~~~ +# SOURCE +~~~roc +{e&} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **&}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**empty_record_update.md:1:3:1:5:** +```roc +{e&} +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),OpAmpersand(1:3-1:4),CloseCurly(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-block @1.1-1.5 + (statements + (e-ident @1.2-1.3 (qaul "") (raw "e")) + (e-malformed @1.3-1.5 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +{ + e + +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-1.5 (id 77) + (s-expr @1.2-1.4 + (e-runtime-error (tag "ident_not_in_scope"))) + (e-empty_record @1.1-1.5)) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/empty_return.md b/src/snapshots/old_syntax/empty_return.md new file mode 100644 index 0000000000..39bf708596 --- /dev/null +++ b/src/snapshots/old_syntax/empty_return.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=empty_return fail +type=expr +~~~ +# SOURCE +~~~roc +return +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**empty_return.md:1:1:1:7:** +```roc +return +``` +^^^^^^ + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.7 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/empty_string.md b/src/snapshots/old_syntax/empty_string.md new file mode 100644 index 0000000000..d903b83e80 --- /dev/null +++ b/src/snapshots/old_syntax/empty_string.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=empty_string +type=expr +~~~ +# SOURCE +~~~roc +"" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:2),StringEnd(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.3 + (e-string-part @1.2-1.2 (raw ""))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.3 (id 74) + (e-literal @1.2-1.2 (string ""))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/empty_try_pnc.md b/src/snapshots/old_syntax/empty_try_pnc.md new file mode 100644 index 0000000000..8bf661e53d --- /dev/null +++ b/src/snapshots/old_syntax/empty_try_pnc.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=empty_try_pnc +type=expr +~~~ +# SOURCE +~~~roc +try()t +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `try` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),NoSpaceOpenRound(1:4-1:5),CloseRound(1:5-1:6),LowerIdent(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-1.6 + (e-ident @1.1-1.4 (qaul "") (raw "try"))) +~~~ +# FORMATTED +~~~roc +try() +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-1.6 (id 76) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/equals.md b/src/snapshots/old_syntax/equals.md new file mode 100644 index 0000000000..30574d3923 --- /dev/null +++ b/src/snapshots/old_syntax/equals.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=equals +type=expr +~~~ +# SOURCE +~~~roc +x==y +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `y` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpEquals(1:2-1:4),LowerIdent(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.5 (op "==") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-ident @1.4-1.5 (qaul "") (raw "y"))) +~~~ +# FORMATTED +~~~roc +x == y +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.5 (op "eq") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/equals_with_spaces.md b/src/snapshots/old_syntax/equals_with_spaces.md new file mode 100644 index 0000000000..7d039db24f --- /dev/null +++ b/src/snapshots/old_syntax/equals_with_spaces.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=equals_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +x == y +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `y` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpEquals(1:3-1:5),LowerIdent(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.7 (op "==") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-ident @1.6-1.7 (qaul "") (raw "y"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.7 (op "eq") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/error_inline_alias_argument_uppercase.md b/src/snapshots/old_syntax/error_inline_alias_argument_uppercase.md new file mode 100644 index 0000000000..dae7425deb --- /dev/null +++ b/src/snapshots/old_syntax/error_inline_alias_argument_uppercase.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=error_inline_alias_argument_uppercase fail +type=expr +~~~ +# SOURCE +~~~roc +f : List elem -> [Nil, Cons elem a] as LinkedList U +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:9),LowerIdent(1:10-1:14),OpArrow(1:15-1:17),OpenSquare(1:18-1:19),UpperIdent(1:19-1:22),Comma(1:22-1:23),UpperIdent(1:24-1:28),LowerIdent(1:29-1:33),LowerIdent(1:34-1:35),CloseSquare(1:35-1:36),KwAs(1:37-1:39),UpperIdent(1:40-1:50),UpperIdent(1:51-1:52),EndOfFile(1:52-1:52), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/error_inline_alias_not_an_alias.md b/src/snapshots/old_syntax/error_inline_alias_not_an_alias.md new file mode 100644 index 0000000000..2c9caf3cfe --- /dev/null +++ b/src/snapshots/old_syntax/error_inline_alias_not_an_alias.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=error_inline_alias_not_an_alias fail +type=expr +~~~ +# SOURCE +~~~roc +f : List elem -> [Nil, Cons elem a] as a +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:9),LowerIdent(1:10-1:14),OpArrow(1:15-1:17),OpenSquare(1:18-1:19),UpperIdent(1:19-1:22),Comma(1:22-1:23),UpperIdent(1:24-1:28),LowerIdent(1:29-1:33),LowerIdent(1:34-1:35),CloseSquare(1:35-1:36),KwAs(1:37-1:39),LowerIdent(1:40-1:41),EndOfFile(1:41-1:41), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/error_inline_alias_qualified.md b/src/snapshots/old_syntax/error_inline_alias_qualified.md new file mode 100644 index 0000000000..d522df2f78 --- /dev/null +++ b/src/snapshots/old_syntax/error_inline_alias_qualified.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=error_inline_alias_qualified fail +type=expr +~~~ +# SOURCE +~~~roc +f : List elem -> [Nil, Cons elem a] as Module.LinkedList a +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:9),LowerIdent(1:10-1:14),OpArrow(1:15-1:17),OpenSquare(1:18-1:19),UpperIdent(1:19-1:22),Comma(1:22-1:23),UpperIdent(1:24-1:28),LowerIdent(1:29-1:33),LowerIdent(1:34-1:35),CloseSquare(1:35-1:36),KwAs(1:37-1:39),UpperIdent(1:40-1:46),NoSpaceDotUpperIdent(1:46-1:57),LowerIdent(1:58-1:59),EndOfFile(1:59-1:59), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/expect.md b/src/snapshots/old_syntax/expect.md new file mode 100644 index 0000000000..71aebfbe82 --- /dev/null +++ b/src/snapshots/old_syntax/expect.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=expect +type=expr +~~~ +# SOURCE +~~~roc +expect 1 == 1 + +4 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **expect 1** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**expect.md:1:1:1:9:** +```roc +expect 1 == 1 +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwExpect(1:1-1:7),Int(1:8-1:9),OpEquals(1:10-1:12),Int(1:13-1:14),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/expect_single_line.md b/src/snapshots/old_syntax/expect_single_line.md new file mode 100644 index 0000000000..6c42b088e8 --- /dev/null +++ b/src/snapshots/old_syntax/expect_single_line.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=expect_single_line +type=expr +~~~ +# SOURCE +~~~roc +x = 5 + +expect x == y + +expect y == z + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),Int(1:5-1:6),Newline(1:1-1:1), +Newline(1:1-1:1), +KwExpect(3:1-3:7),LowerIdent(3:8-3:9),OpEquals(3:10-3:12),LowerIdent(3:13-3:14),Newline(1:1-1:1), +Newline(1:1-1:1), +KwExpect(5:1-5:7),LowerIdent(5:8-5:9),OpEquals(5:10-5:12),LowerIdent(5:13-5:14),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(7:1-7:3),EndOfFile(7:3-7:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/exponential_else_branch_parsing_repro.md b/src/snapshots/old_syntax/exponential_else_branch_parsing_repro.md new file mode 100644 index 0000000000..2050df2242 --- /dev/null +++ b/src/snapshots/old_syntax/exponential_else_branch_parsing_repro.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=exponential_else_branch_parsing_repro fail +type=expr +~~~ +# SOURCE +~~~roc +ee&&i!efs@&exp5/osif.!see&e@&ex/if.!see&&ifss@osif.!see&e@&ex/if.!see&&ifss@5/if.!if.!&ex/if.!see&&ifss@5/if.!is5/if.osif.!see&e@&ex/if.!see&&ifss@5/if.!if.!xpAs5/if.!see&e@&e&&ifss@5/if.!is5/if.osif.!see&e@&ex/if.!see&&ifss@5/if.!if.!xpAs5/if.!see&e@&expos5/if.!if.!poxpos5/if.!if.!pos5/if.!xp#' +then#f#,w +{ +}&&ifs!s- + +t__T+_____^_zese +else +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `ee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:3),OpAmpersand(1:3-1:4),OpAmpersand(1:4-1:5),LowerIdent(1:5-1:10),MalformedOpaqueNameWithoutName(1:10-1:11),OpAmpersand(1:11-1:12),LowerIdent(1:12-1:16),OpSlash(1:16-1:17),LowerIdent(1:17-1:21),Dot(1:21-1:22),OpBang(1:22-1:23),LowerIdent(1:23-1:26),OpAmpersand(1:26-1:27),LowerIdent(1:27-1:28),MalformedOpaqueNameWithoutName(1:28-1:29),OpAmpersand(1:29-1:30),LowerIdent(1:30-1:32),OpSlash(1:32-1:33),KwIf(1:33-1:35),Dot(1:35-1:36),OpBang(1:36-1:37),LowerIdent(1:37-1:40),OpAmpersand(1:40-1:41),OpAmpersand(1:41-1:42),LowerIdent(1:42-1:46),OpaqueName(1:46-1:51),Dot(1:51-1:52),OpBang(1:52-1:53),LowerIdent(1:53-1:56),OpAmpersand(1:56-1:57),LowerIdent(1:57-1:58),MalformedOpaqueNameWithoutName(1:58-1:59),OpAmpersand(1:59-1:60),LowerIdent(1:60-1:62),OpSlash(1:62-1:63),KwIf(1:63-1:65),Dot(1:65-1:66),OpBang(1:66-1:67),LowerIdent(1:67-1:70),OpAmpersand(1:70-1:71),OpAmpersand(1:71-1:72),LowerIdent(1:72-1:76),OpaqueName(1:76-1:78),OpSlash(1:78-1:79),KwIf(1:79-1:81),Dot(1:81-1:82),OpBang(1:82-1:83),KwIf(1:83-1:85),Dot(1:85-1:86),OpBang(1:86-1:87),OpAmpersand(1:87-1:88),LowerIdent(1:88-1:90),OpSlash(1:90-1:91),KwIf(1:91-1:93),Dot(1:93-1:94),OpBang(1:94-1:95),LowerIdent(1:95-1:98),OpAmpersand(1:98-1:99),OpAmpersand(1:99-1:100),LowerIdent(1:100-1:104),OpaqueName(1:104-1:106),OpSlash(1:106-1:107),KwIf(1:107-1:109),Dot(1:109-1:110),OpBang(1:110-1:111),LowerIdent(1:111-1:114),OpSlash(1:114-1:115),KwIf(1:115-1:117),NoSpaceDotLowerIdent(1:117-1:122),Dot(1:122-1:123),OpBang(1:123-1:124),LowerIdent(1:124-1:127),OpAmpersand(1:127-1:128),LowerIdent(1:128-1:129),MalformedOpaqueNameWithoutName(1:129-1:130),OpAmpersand(1:130-1:131),LowerIdent(1:131-1:133),OpSlash(1:133-1:134),KwIf(1:134-1:136),Dot(1:136-1:137),OpBang(1:137-1:138),LowerIdent(1:138-1:141),OpAmpersand(1:141-1:142),OpAmpersand(1:142-1:143),LowerIdent(1:143-1:147),OpaqueName(1:147-1:149),OpSlash(1:149-1:150),KwIf(1:150-1:152),Dot(1:152-1:153),OpBang(1:153-1:154),KwIf(1:154-1:156),Dot(1:156-1:157),OpBang(1:157-1:158),LowerIdent(1:158-1:163),OpSlash(1:163-1:164),KwIf(1:164-1:166),Dot(1:166-1:167),OpBang(1:167-1:168),LowerIdent(1:168-1:171),OpAmpersand(1:171-1:172),LowerIdent(1:172-1:173),MalformedOpaqueNameWithoutName(1:173-1:174),OpAmpersand(1:174-1:175),LowerIdent(1:175-1:176),OpAmpersand(1:176-1:177),OpAmpersand(1:177-1:178),LowerIdent(1:178-1:182),OpaqueName(1:182-1:184),OpSlash(1:184-1:185),KwIf(1:185-1:187),Dot(1:187-1:188),OpBang(1:188-1:189),LowerIdent(1:189-1:192),OpSlash(1:192-1:193),KwIf(1:193-1:195),NoSpaceDotLowerIdent(1:195-1:200),Dot(1:200-1:201),OpBang(1:201-1:202),LowerIdent(1:202-1:205),OpAmpersand(1:205-1:206),LowerIdent(1:206-1:207),MalformedOpaqueNameWithoutName(1:207-1:208),OpAmpersand(1:208-1:209),LowerIdent(1:209-1:211),OpSlash(1:211-1:212),KwIf(1:212-1:214),Dot(1:214-1:215),OpBang(1:215-1:216),LowerIdent(1:216-1:219),OpAmpersand(1:219-1:220),OpAmpersand(1:220-1:221),LowerIdent(1:221-1:225),OpaqueName(1:225-1:227),OpSlash(1:227-1:228),KwIf(1:228-1:230),Dot(1:230-1:231),OpBang(1:231-1:232),KwIf(1:232-1:234),Dot(1:234-1:235),OpBang(1:235-1:236),LowerIdent(1:236-1:241),OpSlash(1:241-1:242),KwIf(1:242-1:244),Dot(1:244-1:245),OpBang(1:245-1:246),LowerIdent(1:246-1:249),OpAmpersand(1:249-1:250),LowerIdent(1:250-1:251),MalformedOpaqueNameWithoutName(1:251-1:252),OpAmpersand(1:252-1:253),LowerIdent(1:253-1:259),OpSlash(1:259-1:260),KwIf(1:260-1:262),Dot(1:262-1:263),OpBang(1:263-1:264),KwIf(1:264-1:266),Dot(1:266-1:267),OpBang(1:267-1:268),LowerIdent(1:268-1:275),OpSlash(1:275-1:276),KwIf(1:276-1:278),Dot(1:278-1:279),OpBang(1:279-1:280),KwIf(1:280-1:282),Dot(1:282-1:283),OpBang(1:283-1:284),LowerIdent(1:284-1:288),OpSlash(1:288-1:289),KwIf(1:289-1:291),Dot(1:291-1:292),OpBang(1:292-1:293),LowerIdent(1:293-1:295),Newline(1:296-1:297), +LowerIdent(2:1-2:5),Newline(2:6-2:10), +OpenCurly(3:1-3:2),Newline(1:1-1:1), +CloseCurly(4:1-4:2),OpAmpersand(4:2-4:3),OpAmpersand(4:3-4:4),LowerIdent(4:4-4:9),OpBinaryMinus(4:9-4:10),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(6:1-6:5),OpPlus(6:5-6:6),Underscore(6:6-6:7),Underscore(6:7-6:8),Underscore(6:8-6:9),Underscore(6:9-6:10),Underscore(6:10-6:11),OpCaret(6:11-6:12),NamedUnderscore(6:12-6:17),Newline(1:1-1:1), +KwElse(7:1-7:5),EndOfFile(7:5-7:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.3 (qaul "") (raw "ee")) +~~~ +# FORMATTED +~~~roc +ee +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/expr_to_pattern_fail.md b/src/snapshots/old_syntax/expr_to_pattern_fail.md new file mode 100644 index 0000000000..a040a43c2b --- /dev/null +++ b/src/snapshots/old_syntax/expr_to_pattern_fail.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=expr_to_pattern_fail fail +type=expr +~~~ +# SOURCE +~~~roc +.e, +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.e,** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**expr_to_pattern_fail.md:1:1:1:4:** +```roc +.e, +``` +^^^ + + +# TOKENS +~~~zig +DotLowerIdent(1:1-1:3),Comma(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/ext_on_fn_ty.md b/src/snapshots/old_syntax/ext_on_fn_ty.md new file mode 100644 index 0000000000..c40012af0e --- /dev/null +++ b/src/snapshots/old_syntax/ext_on_fn_ty.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=ext_on_fn_ty +type=expr +~~~ +# SOURCE +~~~roc +t:(w=>p)a +t +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `t` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),OpFatArrow(1:5-1:7),LowerIdent(1:7-1:8),CloseRound(1:8-1:9),LowerIdent(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "t")) +~~~ +# FORMATTED +~~~roc +t +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/extra_newline.md b/src/snapshots/old_syntax/extra_newline.md new file mode 100644 index 0000000000..05b27e2770 --- /dev/null +++ b/src/snapshots/old_syntax/extra_newline.md @@ -0,0 +1,52 @@ +# META +~~~ini +description=extra_newline +type=expr +~~~ +# SOURCE +~~~roc +if foo then + x = a # 1 + x # 2 +else # 3 + c # 4 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**extra_newline.md:2:5:2:8:** +```roc + x = a # 1 +``` + ^^^ + + +# TOKENS +~~~zig +KwIf(1:1-1:3),LowerIdent(1:4-1:7),LowerIdent(1:8-1:12),Newline(1:1-1:1), +LowerIdent(2:5-2:6),OpAssign(2:7-2:8),LowerIdent(2:9-2:10),Newline(2:12-2:14), +LowerIdent(3:5-3:6),Newline(3:8-3:10), +KwElse(4:1-4:5),Newline(4:7-4:9), +LowerIdent(5:5-5:6),EndOfFile(5:10-5:10), +~~~ +# PARSE +~~~clojure +(e-malformed @2.5-2.8 (reason "no_else")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/extra_newline_in_parens.md b/src/snapshots/old_syntax/extra_newline_in_parens.md new file mode 100644 index 0000000000..a8a5d34bf1 --- /dev/null +++ b/src/snapshots/old_syntax/extra_newline_in_parens.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=extra_newline_in_parens +type=expr +~~~ +# SOURCE +~~~roc +B:{} + +( +a) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),OpenCurly(1:3-1:4),CloseCurly(1:4-1:5),Newline(1:1-1:1), +Newline(1:1-1:1), +OpenRound(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),CloseRound(4:2-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "B")) +~~~ +# FORMATTED +~~~roc +B +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "B") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[B]*")) +~~~ diff --git a/src/snapshots/old_syntax/f_not_not_f.md b/src/snapshots/old_syntax/f_not_not_f.md new file mode 100644 index 0000000000..70667c0697 --- /dev/null +++ b/src/snapshots/old_syntax/f_not_not_f.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=f_not_not_f +type=expr +~~~ +# SOURCE +~~~roc +f +! +!f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +OpBang(3:1-3:2),LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/float_with_underscores.md b/src/snapshots/old_syntax/float_with_underscores.md new file mode 100644 index 0000000000..d077807fc3 --- /dev/null +++ b/src/snapshots/old_syntax/float_with_underscores.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=float_with_underscores +type=expr +~~~ +# SOURCE +~~~roc +-1_23_456.0_1_23_456 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:21),EndOfFile(1:21-1:21), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.21 (raw "-1_23_456.0_1_23_456")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-frac-dec @1.1-1.21 (value "-123456.01234560001") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/fn_with_record_arg.md b/src/snapshots/old_syntax/fn_with_record_arg.md new file mode 100644 index 0000000000..666b71a7cf --- /dev/null +++ b/src/snapshots/old_syntax/fn_with_record_arg.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=fn_with_record_arg +type=expr +~~~ +# SOURCE +~~~roc +table : { + height : Pixels + } -> Table +table = \{height} -> crash "not implemented" +table +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `table` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:6),OpColon(1:7-1:8),OpenCurly(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:5-2:11),OpColon(2:12-2:13),UpperIdent(2:14-2:20),Newline(1:1-1:1), +CloseCurly(3:5-3:6),OpArrow(3:7-3:9),UpperIdent(3:10-3:15),Newline(1:1-1:1), +LowerIdent(4:1-4:6),OpAssign(4:7-4:8),OpBackslash(4:9-4:10),OpenCurly(4:10-4:11),LowerIdent(4:11-4:17),CloseCurly(4:17-4:18),OpArrow(4:19-4:21),KwCrash(4:22-4:27),StringStart(4:28-4:29),StringPart(4:29-4:44),StringEnd(4:44-4:45),Newline(1:1-1:1), +LowerIdent(5:1-5:6),EndOfFile(5:6-5:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.6 (qaul "") (raw "table")) +~~~ +# FORMATTED +~~~roc +table +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/func_ty_parens_crazyness.md b/src/snapshots/old_syntax/func_ty_parens_crazyness.md new file mode 100644 index 0000000000..bf471ba2ae --- /dev/null +++ b/src/snapshots/old_syntax/func_ty_parens_crazyness.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=func_ty_parens_crazyness +type=expr +~~~ +# SOURCE +~~~roc +N:(((f->((( +u)))I->*))) +I +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),NoSpaceOpenRound(1:4-1:5),NoSpaceOpenRound(1:5-1:6),LowerIdent(1:6-1:7),OpArrow(1:7-1:9),NoSpaceOpenRound(1:9-1:10),NoSpaceOpenRound(1:10-1:11),NoSpaceOpenRound(1:11-1:12),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),CloseRound(2:3-2:4),CloseRound(2:4-2:5),UpperIdent(2:5-2:6),OpArrow(2:6-2:8),OpStar(2:8-2:9),CloseRound(2:9-2:10),CloseRound(2:10-2:11),CloseRound(2:11-2:12),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "N")) +~~~ +# FORMATTED +~~~roc +N +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "N") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[N]*")) +~~~ diff --git a/src/snapshots/old_syntax/function_with_tuple_ext_type.md b/src/snapshots/old_syntax/function_with_tuple_ext_type.md new file mode 100644 index 0000000000..72f2369985 --- /dev/null +++ b/src/snapshots/old_syntax/function_with_tuple_ext_type.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=function_with_tuple_ext_type +type=expr +~~~ +# SOURCE +~~~roc +f : (Str)a -> (Str)a +f = \x -> x + +f ("Str", 42) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenRound(1:5-1:6),UpperIdent(1:6-1:9),CloseRound(1:9-1:10),LowerIdent(1:10-1:11),OpArrow(1:12-1:14),OpenRound(1:15-1:16),UpperIdent(1:16-1:19),CloseRound(1:19-1:20),LowerIdent(1:20-1:21),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),OpBackslash(2:5-2:6),LowerIdent(2:6-2:7),OpArrow(2:8-2:10),LowerIdent(2:11-2:12),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),OpenRound(4:3-4:4),StringStart(4:4-4:5),StringPart(4:5-4:8),StringEnd(4:8-4:9),Comma(4:9-4:10),Int(4:11-4:13),CloseRound(4:13-4:14),EndOfFile(4:14-4:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/function_with_tuple_type.md b/src/snapshots/old_syntax/function_with_tuple_type.md new file mode 100644 index 0000000000..6bb8eb692b --- /dev/null +++ b/src/snapshots/old_syntax/function_with_tuple_type.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=function_with_tuple_type +type=expr +~~~ +# SOURCE +~~~roc +f : I64 -> (I64, I64) +f = \x -> (x, x + 1) + +f 42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),OpArrow(1:9-1:11),OpenRound(1:12-1:13),UpperIdent(1:13-1:16),Comma(1:16-1:17),UpperIdent(1:18-1:21),CloseRound(1:21-1:22),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),OpBackslash(2:5-2:6),LowerIdent(2:6-2:7),OpArrow(2:8-2:10),OpenRound(2:11-2:12),LowerIdent(2:12-2:13),Comma(2:13-2:14),LowerIdent(2:15-2:16),OpPlus(2:17-2:18),Int(2:19-2:20),CloseRound(2:20-2:21),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),Int(4:3-4:5),EndOfFile(4:5-4:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/h_greater_comment_minus_div.md b/src/snapshots/old_syntax/h_greater_comment_minus_div.md new file mode 100644 index 0000000000..4e3a270369 --- /dev/null +++ b/src/snapshots/old_syntax/h_greater_comment_minus_div.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=h_greater_comment_minus_div +type=expr +~~~ +# SOURCE +~~~roc +h># + -h/d +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-h** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**h_greater_comment_minus_div.md:2:2:2:4:** +```roc + -h/d +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `h` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpGreaterThan(1:2-1:3),Newline(1:4-1:4), +OpUnaryMinus(2:2-2:3),LowerIdent(2:3-2:4),OpSlash(2:4-2:5),LowerIdent(2:5-2:6),EndOfFile(2:6-2:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op ">") + (e-ident @1.1-1.2 (qaul "") (raw "h")) + (e-malformed @2.2-2.4 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +h > + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "gt") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/h_parens_as_parens_h_ann.md b/src/snapshots/old_syntax/h_parens_as_parens_h_ann.md new file mode 100644 index 0000000000..1b8d4718b3 --- /dev/null +++ b/src/snapshots/old_syntax/h_parens_as_parens_h_ann.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=h_parens_as_parens_h_ann +type=expr +~~~ +# SOURCE +~~~roc +N:A((H)as H) H +I +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),NoSpaceOpenRound(1:4-1:5),NoSpaceOpenRound(1:5-1:6),UpperIdent(1:6-1:7),CloseRound(1:7-1:8),KwAs(1:8-1:10),UpperIdent(1:11-1:12),CloseRound(1:12-1:13),UpperIdent(1:14-1:15),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "N")) +~~~ +# FORMATTED +~~~roc +N +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "N") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[N]*")) +~~~ diff --git a/src/snapshots/old_syntax/highest_float.md b/src/snapshots/old_syntax/highest_float.md new file mode 100644 index 0000000000..050cf9ac58 --- /dev/null +++ b/src/snapshots/old_syntax/highest_float.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=highest_float +type=expr +~~~ +# SOURCE +~~~roc +179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:312),EndOfFile(1:312-1:312), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.312 (raw "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-frac-f64 @1.1-1.312 (value "1.7976931348623157e308") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/highest_int.md b/src/snapshots/old_syntax/highest_int.md new file mode 100644 index 0000000000..4f574e6077 --- /dev/null +++ b/src/snapshots/old_syntax/highest_int.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=highest_int +type=expr +~~~ +# SOURCE +~~~roc +9223372036854775807 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:20),EndOfFile(1:20-1:20), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.20 (raw "9223372036854775807")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.20 (value "9223372036854775807") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/i_over_not_g.md b/src/snapshots/old_syntax/i_over_not_g.md new file mode 100644 index 0000000000..3e12402ba6 --- /dev/null +++ b/src/snapshots/old_syntax/i_over_not_g.md @@ -0,0 +1,59 @@ +# META +~~~ini +description=i_over_not_g +type=expr +~~~ +# SOURCE +~~~roc +i/ + ! + g +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**i_over_not_g.md:2:2:2:2:** +```roc + ! +``` + + + +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpSlash(1:2-1:3),Newline(1:1-1:1), +OpBang(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.1 (op "/") + (e-ident @1.1-1.2 (qaul "") (raw "i")) + (e-malformed @1.1-1.1 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +i / + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.1 (op "div") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/if_bang_then_bang_indented_else.md b/src/snapshots/old_syntax/if_bang_then_bang_indented_else.md new file mode 100644 index 0000000000..1975243c36 --- /dev/null +++ b/src/snapshots/old_syntax/if_bang_then_bang_indented_else.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=if_bang_then_bang_indented_else +type=expr +~~~ +# SOURCE +~~~roc + if!a!then +t + else + l +5 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `if!a!then` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:2-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +KwElse(3:3-3:7),Newline(1:1-1:1), +LowerIdent(4:2-4:3),Newline(1:1-1:1), +Int(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.2-1.11 (qaul "") (raw "if!a!then")) +~~~ +# FORMATTED +~~~roc +if!a!then +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_bang_then_else_one_line.md b/src/snapshots/old_syntax/if_bang_then_else_one_line.md new file mode 100644 index 0000000000..222f829257 --- /dev/null +++ b/src/snapshots/old_syntax/if_bang_then_else_one_line.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=if_bang_then_else_one_line +type=expr +~~~ +# SOURCE +~~~roc +f=if!b!then""else + e +"" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),LowerIdent(1:3-1:12),StringStart(1:12-1:13),StringPart(1:13-1:13),StringEnd(1:13-1:14),KwElse(1:14-1:18),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(1:1-1:1), +StringStart(3:1-3:2),StringPart(3:2-3:2),StringEnd(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_def.md b/src/snapshots/old_syntax/if_def.md new file mode 100644 index 0000000000..4940a27eda --- /dev/null +++ b/src/snapshots/old_syntax/if_def.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=if_def +type=expr +~~~ +# SOURCE +~~~roc +iffy=5 + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `iffy` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:5-1:6),Int(1:6-1:7),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "iffy")) +~~~ +# FORMATTED +~~~roc +iffy +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_guard_without_condition.md b/src/snapshots/old_syntax/if_guard_without_condition.md new file mode 100644 index 0000000000..04efb5509f --- /dev/null +++ b/src/snapshots/old_syntax/if_guard_without_condition.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=if_guard_without_condition fail +type=expr +~~~ +# SOURCE +~~~roc +when Just 4 is + Just if -> + 4 + + _ -> + 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),UpperIdent(1:6-1:10),Int(1:11-1:12),LowerIdent(1:13-1:15),Newline(1:1-1:1), +UpperIdent(2:5-2:9),KwIf(2:10-2:12),OpArrow(2:13-2:15),Newline(1:1-1:1), +Int(3:9-3:10),Newline(1:1-1:1), +Newline(1:1-1:1), +Underscore(5:5-5:6),OpArrow(5:7-5:9),Newline(1:1-1:1), +Int(6:9-6:10),EndOfFile(6:10-6:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_in_record_field_opt_pat.md b/src/snapshots/old_syntax/if_in_record_field_opt_pat.md new file mode 100644 index 0000000000..332b4f69a3 --- /dev/null +++ b/src/snapshots/old_syntax/if_in_record_field_opt_pat.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=if_in_record_field_opt_pat malformed +type=expr +~~~ +# SOURCE +~~~roc +O{p?if +a +then +A +else&m}# +:e +i +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),NoSpaceOpQuestion(1:4-1:5),KwIf(1:5-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:5),Newline(1:1-1:1), +UpperIdent(4:1-4:2),Newline(1:1-1:1), +KwElse(5:1-5:5),OpAmpersand(5:5-5:6),LowerIdent(5:6-5:7),CloseCurly(5:7-5:8),Newline(5:9-5:9), +OpColon(6:1-6:2),LowerIdent(6:2-6:3),Newline(1:1-1:1), +LowerIdent(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "O")) +~~~ +# FORMATTED +~~~roc +O +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "O") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[O]*")) +~~~ diff --git a/src/snapshots/old_syntax/if_missing_else.md b/src/snapshots/old_syntax/if_missing_else.md new file mode 100644 index 0000000000..2a757de4d8 --- /dev/null +++ b/src/snapshots/old_syntax/if_missing_else.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=if_missing_else fail +type=expr +~~~ +# SOURCE +~~~roc +if 5 == 5 then 2 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**if_missing_else.md:1:16:1:17:** +```roc +if 5 == 5 then 2 +``` + ^ + + +# TOKENS +~~~zig +KwIf(1:1-1:3),Int(1:4-1:5),OpEquals(1:6-1:8),Int(1:9-1:10),LowerIdent(1:11-1:15),Int(1:16-1:17),EndOfFile(1:17-1:17), +~~~ +# PARSE +~~~clojure +(e-malformed @1.16-1.17 (reason "no_else")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/if_newline_then_negate_else_recordupdater.md b/src/snapshots/old_syntax/if_newline_then_negate_else_recordupdater.md new file mode 100644 index 0000000000..56f7c3f026 --- /dev/null +++ b/src/snapshots/old_syntax/if_newline_then_negate_else_recordupdater.md @@ -0,0 +1,75 @@ +# META +~~~ini +description=if_newline_then_negate_else_recordupdater +type=expr +~~~ +# SOURCE +~~~roc +if +h +then!f# +else&m +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **&m** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**if_newline_then_negate_else_recordupdater.md:4:5:4:7:** +```roc +else&m +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `h` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `then!f` in this scope. +Is there an `import` or `exposing` missing up-top? + +**INVALID IF BRANCH** +The `else` branch of this `if` expression could not be processed. + +The `else` branch must contain a valid expression. Check for syntax errors or missing values. + +Note: Every `if` expression in Roc must have an `else` branch, and both branches must have the same type. + +# TOKENS +~~~zig +KwIf(1:1-1:3),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:7),Newline(3:8-3:8), +KwElse(4:1-4:5),OpAmpersand(4:5-4:6),LowerIdent(4:6-4:7),EndOfFile(4:7-4:7), +~~~ +# PARSE +~~~clojure +(e-if-then-else @1.1-4.7 + (e-ident @2.1-2.2 (qaul "") (raw "h")) + (e-ident @3.1-3.7 (qaul "") (raw "then!f")) + (e-malformed @4.5-4.7 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +if + h + then!f + else +~~~ +# CANONICALIZE +~~~clojure +(e-if @1.1-4.7 (id 80) + (if-branches + (if-branch + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")))) + (if-else + (e-runtime-error (tag "if_else_not_canonicalized")))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_outdented_else_branch.md b/src/snapshots/old_syntax/if_outdented_else_branch.md new file mode 100644 index 0000000000..daf5dd7076 --- /dev/null +++ b/src/snapshots/old_syntax/if_outdented_else_branch.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=if_outdented_else_branch fail +type=expr +~~~ +# SOURCE +~~~roc +if thing then + whatever +else +something better +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**if_outdented_else_branch.md:2:5:2:5:** +```roc + whatever +``` + + + +# TOKENS +~~~zig +KwIf(1:1-1:3),LowerIdent(1:4-1:9),LowerIdent(1:10-1:14),Newline(1:1-1:1), +LowerIdent(2:5-2:13),Newline(1:1-1:1), +KwElse(3:1-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:10),LowerIdent(4:11-4:17),EndOfFile(4:17-4:17), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "no_else")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/if_outdented_then.md b/src/snapshots/old_syntax/if_outdented_then.md new file mode 100644 index 0000000000..e846eb4e79 --- /dev/null +++ b/src/snapshots/old_syntax/if_outdented_then.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=if_outdented_then fail +type=expr +~~~ +# SOURCE +~~~roc +x = + if 5 == 5 +then 2 else 3 + +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),Newline(1:1-1:1), +KwIf(2:5-2:7),Int(2:8-2:9),OpEquals(2:10-2:12),Int(2:13-2:14),Newline(1:1-1:1), +LowerIdent(3:1-3:5),Int(3:6-3:7),KwElse(3:8-3:12),Int(3:13-3:14),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/if_then_weird_indent.md b/src/snapshots/old_syntax/if_then_weird_indent.md new file mode 100644 index 0000000000..a56f31ba9d --- /dev/null +++ b/src/snapshots/old_syntax/if_then_weird_indent.md @@ -0,0 +1,56 @@ +# META +~~~ini +description=if_then_weird_indent +type=expr +~~~ +# SOURCE +~~~roc +if +k +then +A + else + e +r +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**if_then_weird_indent.md:4:1:4:1:** +```roc +A +``` + + + +# TOKENS +~~~zig +KwIf(1:1-1:3),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:5),Newline(1:1-1:1), +UpperIdent(4:1-4:2),Newline(1:1-1:1), +KwElse(5:2-5:6),Newline(1:1-1:1), +LowerIdent(6:2-6:3),Newline(1:1-1:1), +LowerIdent(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "no_else")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/ifbang_eqeq.md b/src/snapshots/old_syntax/ifbang_eqeq.md new file mode 100644 index 0000000000..ef6c6159eb --- /dev/null +++ b/src/snapshots/old_syntax/ifbang_eqeq.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=ifbang_eqeq fail +type=expr +~~~ +# SOURCE +~~~roc +if!==9 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `if!` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpEquals(1:4-1:6),Int(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.7 (op "==") + (e-ident @1.1-1.4 (qaul "") (raw "if!")) + (e-int @1.6-1.7 (raw "9"))) +~~~ +# FORMATTED +~~~roc +if! == 9 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.7 (op "eq") (id 76) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.6-1.7 (value "9"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_after_comment_with_newline.md b/src/snapshots/old_syntax/implements_after_comment_with_newline.md new file mode 100644 index 0000000000..71e8e573d0 --- /dev/null +++ b/src/snapshots/old_syntax/implements_after_comment_with_newline.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=implements_after_comment_with_newline malformed +type=expr +~~~ +# SOURCE +~~~roc +C 4 # + implements e:m +C +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Int(1:3-1:4),Newline(1:6-1:6), +KwImplements(2:2-2:12),LowerIdent(2:13-2:14),OpColon(2:14-2:15),LowerIdent(2:15-2:16),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "C")) +~~~ +# FORMATTED +~~~roc +C +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "C") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[C]*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_annotation_comment.md b/src/snapshots/old_syntax/implements_annotation_comment.md new file mode 100644 index 0000000000..06dc0d5033 --- /dev/null +++ b/src/snapshots/old_syntax/implements_annotation_comment.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=implements_annotation_comment +type=expr +~~~ +# SOURCE +~~~roc +S implements i:(a# +# +) +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),KwImplements(1:3-1:13),LowerIdent(1:14-1:15),OpColon(1:15-1:16),NoSpaceOpenRound(1:16-1:17),LowerIdent(1:17-1:18),Newline(1:19-1:19), +Newline(2:2-2:2), +CloseRound(3:1-3:2),Newline(1:1-1:1), +Int(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "S")) +~~~ +# FORMATTED +~~~roc +S +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "S") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[S]*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_in_pat_after_comment.md b/src/snapshots/old_syntax/implements_in_pat_after_comment.md new file mode 100644 index 0000000000..727e174559 --- /dev/null +++ b/src/snapshots/old_syntax/implements_in_pat_after_comment.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=implements_in_pat_after_comment +type=expr +~~~ +# SOURCE +~~~roc +s# + implements:s +s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:3-1:3), +KwImplements(2:2-2:12),OpColon(2:12-2:13),LowerIdent(2:13-2:14),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "s")) +~~~ +# FORMATTED +~~~roc +s +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/implements_in_pnc_pattern.md b/src/snapshots/old_syntax/implements_in_pnc_pattern.md new file mode 100644 index 0000000000..03aadb0434 --- /dev/null +++ b/src/snapshots/old_syntax/implements_in_pnc_pattern.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=implements_in_pnc_pattern +type=expr +~~~ +# SOURCE +~~~roc +g(implements,x)=c +c +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **implements,** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**implements_in_pnc_pattern.md:1:3:1:14:** +```roc +g(implements,x)=c +``` + ^^^^^^^^^^^ + + +**UNDEFINED VARIABLE** +Nothing is named `g` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),NoSpaceOpenRound(1:2-1:3),KwImplements(1:3-1:13),Comma(1:13-1:14),LowerIdent(1:14-1:15),CloseRound(1:15-1:16),OpAssign(1:16-1:17),LowerIdent(1:17-1:18),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-1.16 + (e-ident @1.1-1.2 (qaul "") (raw "g")) + (e-malformed @1.3-1.14 (reason "expr_unexpected_token")) + (e-ident @1.14-1.15 (qaul "") (raw "x"))) +~~~ +# FORMATTED +~~~roc +g(, x) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-1.16 (id 78) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_newline_in_fn_ty.md b/src/snapshots/old_syntax/implements_newline_in_fn_ty.md new file mode 100644 index 0000000000..017f965e9f --- /dev/null +++ b/src/snapshots/old_syntax/implements_newline_in_fn_ty.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=implements_newline_in_fn_ty +type=expr +~~~ +# SOURCE +~~~roc +A implements q:U + e->p +d +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),KwImplements(1:3-1:13),LowerIdent(1:14-1:15),OpColon(1:15-1:16),UpperIdent(1:16-1:17),Newline(1:1-1:1), +LowerIdent(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_newlines_comments.md b/src/snapshots/old_syntax/implements_newlines_comments.md new file mode 100644 index 0000000000..02d6723f43 --- /dev/null +++ b/src/snapshots/old_syntax/implements_newlines_comments.md @@ -0,0 +1,41 @@ +# META +~~~ini +description=implements_newlines_comments +type=expr +~~~ +# SOURCE +~~~roc +M# + im# + implements + de:J + +s +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:3-1:3), +LowerIdent(2:2-2:4),Newline(2:5-2:5), +KwImplements(3:2-3:12),Newline(1:1-1:1), +LowerIdent(4:2-4:4),OpColon(4:4-4:5),UpperIdent(4:5-4:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "M")) +~~~ +# FORMATTED +~~~roc +M +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "M") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[M]*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_not_keyword.md b/src/snapshots/old_syntax/implements_not_keyword.md new file mode 100644 index 0000000000..2c1b92592b --- /dev/null +++ b/src/snapshots/old_syntax/implements_not_keyword.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=implements_not_keyword +type=expr +~~~ +# SOURCE +~~~roc +A=B implements + +s +1 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpAssign(1:2-1:3),UpperIdent(1:3-1:4),KwImplements(1:5-1:15),Newline(1:1-1:1), +OpPlus(2:2-2:3),LowerIdent(2:3-2:4),Newline(1:1-1:1), +Int(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/implements_record_destructure.md b/src/snapshots/old_syntax/implements_record_destructure.md new file mode 100644 index 0000000000..bde66add14 --- /dev/null +++ b/src/snapshots/old_syntax/implements_record_destructure.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=implements_record_destructure +type=expr +~~~ +# SOURCE +~~~roc +{implements}=d +I +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **implements}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**implements_record_destructure.md:1:2:1:13:** +```roc +{implements}=d +``` + ^^^^^^^^^^^ + + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),KwImplements(1:2-1:12),CloseCurly(1:12-1:13),OpAssign(1:13-1:14),LowerIdent(1:14-1:15),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-1.13 + (statements + (e-malformed @1.2-1.13 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-1.13 (id 74) + (e-empty_record @1.1-1.13)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/import_backslash_as_m.md b/src/snapshots/old_syntax/import_backslash_as_m.md new file mode 100644 index 0000000000..e85116ce50 --- /dev/null +++ b/src/snapshots/old_syntax/import_backslash_as_m.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=import_backslash_as_m +type=expr +~~~ +# SOURCE +~~~roc +import"\\"as m +e +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import"** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**import_backslash_as_m.md:1:1:1:8:** +```roc +import"\\"as m +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),StringStart(1:7-1:8),StringPart(1:8-1:10),StringEnd(1:10-1:11),KwAs(1:11-1:13),LowerIdent(1:14-1:15),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/import_in_closure_with_curlies_after.md b/src/snapshots/old_syntax/import_in_closure_with_curlies_after.md new file mode 100644 index 0000000000..5984bf3ad7 --- /dev/null +++ b/src/snapshots/old_syntax/import_in_closure_with_curlies_after.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=import_in_closure_with_curlies_after +type=expr +~~~ +# SOURCE +~~~roc +\L-> + import U + {}e +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\L** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**import_in_closure_with_curlies_after.md:1:1:1:3:** +```roc +\L-> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpArrow(1:3-1:5),Newline(1:1-1:1), +KwImport(2:2-2:8),UpperIdent(2:9-2:10),Newline(1:1-1:1), +OpenCurly(3:2-3:3),CloseCurly(3:3-3:4),LowerIdent(3:4-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/inline_hastype.md b/src/snapshots/old_syntax/inline_hastype.md new file mode 100644 index 0000000000..8291f346de --- /dev/null +++ b/src/snapshots/old_syntax/inline_hastype.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=inline_hastype fail +type=expr +~~~ +# SOURCE +~~~roc +main = + (\x -> x) : I64 + + 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `main` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),Newline(1:1-1:1), +OpenRound(2:5-2:6),OpBackslash(2:6-2:7),LowerIdent(2:7-2:8),OpArrow(2:9-2:11),LowerIdent(2:12-2:13),CloseRound(2:13-2:14),OpColon(2:15-2:16),UpperIdent(2:17-2:20),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:5-4:6),EndOfFile(4:6-4:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "main")) +~~~ +# FORMATTED +~~~roc +main +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/inline_import.md b/src/snapshots/old_syntax/inline_import.md new file mode 100644 index 0000000000..0a1c0ceb1a --- /dev/null +++ b/src/snapshots/old_syntax/inline_import.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=inline_import +type=expr +~~~ +# SOURCE +~~~roc +import Json exposing [int] +import Json.Encode as JE + +JE.encode (int 42) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import Json** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**inline_import.md:1:1:1:12:** +```roc +import Json exposing [int] +``` +^^^^^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),UpperIdent(1:8-1:12),KwExposing(1:13-1:21),OpenSquare(1:22-1:23),LowerIdent(1:23-1:26),CloseSquare(1:26-1:27),Newline(1:1-1:1), +KwImport(2:1-2:7),UpperIdent(2:8-2:12),NoSpaceDotUpperIdent(2:12-2:19),KwAs(2:20-2:22),UpperIdent(2:23-2:25),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(4:1-4:3),NoSpaceDotLowerIdent(4:3-4:10),OpenRound(4:11-4:12),LowerIdent(4:12-4:15),Int(4:16-4:18),CloseRound(4:18-4:19),EndOfFile(4:19-4:19), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.12 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/inline_ingested_file.md b/src/snapshots/old_syntax/inline_ingested_file.md new file mode 100644 index 0000000000..70c1e3706f --- /dev/null +++ b/src/snapshots/old_syntax/inline_ingested_file.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=inline_ingested_file +type=expr +~~~ +# SOURCE +~~~roc +import "users.json" as data : Str + +parseJson data +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import "** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**inline_ingested_file.md:1:1:1:9:** +```roc +import "users.json" as data : Str +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),StringStart(1:8-1:9),StringPart(1:9-1:19),StringEnd(1:19-1:20),KwAs(1:21-1:23),LowerIdent(1:24-1:28),OpColon(1:29-1:30),UpperIdent(1:31-1:34),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:10),LowerIdent(3:11-3:15),EndOfFile(3:15-3:15), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/inline_ingested_file_no_ann.md b/src/snapshots/old_syntax/inline_ingested_file_no_ann.md new file mode 100644 index 0000000000..4355ff213f --- /dev/null +++ b/src/snapshots/old_syntax/inline_ingested_file_no_ann.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=inline_ingested_file_no_ann +type=expr +~~~ +# SOURCE +~~~roc +import "users.json" as data + +parseJson data +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import "** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**inline_ingested_file_no_ann.md:1:1:1:9:** +```roc +import "users.json" as data +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),StringStart(1:8-1:9),StringPart(1:9-1:19),StringEnd(1:19-1:20),KwAs(1:21-1:23),LowerIdent(1:24-1:28),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:10),LowerIdent(3:11-3:15),EndOfFile(3:15-3:15), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/int_with_underscore.md b/src/snapshots/old_syntax/int_with_underscore.md new file mode 100644 index 0000000000..0b53fe3e99 --- /dev/null +++ b/src/snapshots/old_syntax/int_with_underscore.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=int_with_underscore +type=expr +~~~ +# SOURCE +~~~roc +1__23 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.6 (raw "1__23")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.6 (value "123") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/invalid_operator.md b/src/snapshots/old_syntax/invalid_operator.md new file mode 100644 index 0000000000..99e61c7359 --- /dev/null +++ b/src/snapshots/old_syntax/invalid_operator.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=invalid_operator fail +type=expr +~~~ +# SOURCE +~~~roc +main = + 5 ** 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `main` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),Newline(1:1-1:1), +Int(2:5-2:6),OpStar(2:7-2:8),OpStar(2:8-2:9),Int(2:10-2:11),EndOfFile(2:11-2:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "main")) +~~~ +# FORMATTED +~~~roc +main +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/lambda_double_comma.md b/src/snapshots/old_syntax/lambda_double_comma.md new file mode 100644 index 0000000000..5e35759ce2 --- /dev/null +++ b/src/snapshots/old_syntax/lambda_double_comma.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=lambda_double_comma fail +type=expr +~~~ +# SOURCE +~~~roc +\a,,b -> 1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\a** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**lambda_double_comma.md:1:1:1:3:** +```roc +\a,,b -> 1 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),Comma(1:3-1:4),Comma(1:4-1:5),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),Int(1:10-1:11),EndOfFile(1:11-1:11), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/lambda_extra_comma.md b/src/snapshots/old_syntax/lambda_extra_comma.md new file mode 100644 index 0000000000..730dd360a0 --- /dev/null +++ b/src/snapshots/old_syntax/lambda_extra_comma.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=lambda_extra_comma fail +type=expr +~~~ +# SOURCE +~~~roc +\,x -> 1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\,** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**lambda_extra_comma.md:1:1:1:3:** +```roc +\,x -> 1 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),Comma(1:2-1:3),LowerIdent(1:3-1:4),OpArrow(1:5-1:7),Int(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/lambda_in_chain.md b/src/snapshots/old_syntax/lambda_in_chain.md new file mode 100644 index 0000000000..9b07d61e16 --- /dev/null +++ b/src/snapshots/old_syntax/lambda_in_chain.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=lambda_in_chain +type=expr +~~~ +# SOURCE +~~~roc +"a string" +|> Str.toUtf8 +|> List.map \byte -> byte + 1 +|> List.reverse +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:10),StringEnd(1:10-1:11),Newline(1:1-1:1), +OpPizza(2:1-2:3),UpperIdent(2:4-2:7),NoSpaceDotLowerIdent(2:7-2:14),Newline(1:1-1:1), +OpPizza(3:1-3:3),UpperIdent(3:4-3:8),NoSpaceDotLowerIdent(3:8-3:12),OpBackslash(3:13-3:14),LowerIdent(3:14-3:18),OpArrow(3:19-3:21),LowerIdent(3:22-3:26),OpPlus(3:27-3:28),Int(3:29-3:30),Newline(1:1-1:1), +OpPizza(4:1-4:3),UpperIdent(4:4-4:8),NoSpaceDotLowerIdent(4:8-4:16),EndOfFile(4:16-4:16), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.11 + (e-string-part @1.2-1.10 (raw "a string"))) +~~~ +# FORMATTED +~~~roc +"a string" +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.11 (id 74) + (e-literal @1.2-1.10 (string "a string"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/lambda_indent.md b/src/snapshots/old_syntax/lambda_indent.md new file mode 100644 index 0000000000..accea819dd --- /dev/null +++ b/src/snapshots/old_syntax/lambda_indent.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=lambda_indent +type=expr +~~~ +# SOURCE +~~~roc +\x -> + 1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**lambda_indent.md:1:1:1:3:** +```roc +\x -> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),OpArrow(1:4-1:6),Newline(1:1-1:1), +Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/lambda_leading_comma.md b/src/snapshots/old_syntax/lambda_leading_comma.md new file mode 100644 index 0000000000..aa7ab1db8a --- /dev/null +++ b/src/snapshots/old_syntax/lambda_leading_comma.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=lambda_leading_comma fail +type=expr +~~~ +# SOURCE +~~~roc +\,b -> 1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\,** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**lambda_leading_comma.md:1:1:1:3:** +```roc +\,b -> 1 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),Comma(1:2-1:3),LowerIdent(1:3-1:4),OpArrow(1:5-1:7),Int(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/lambda_missing_indent.md b/src/snapshots/old_syntax/lambda_missing_indent.md new file mode 100644 index 0000000000..c5518bf978 --- /dev/null +++ b/src/snapshots/old_syntax/lambda_missing_indent.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=lambda_missing_indent fail +type=expr +~~~ +# SOURCE +~~~roc +\x -> +1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**lambda_missing_indent.md:1:1:1:3:** +```roc +\x -> +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),OpArrow(1:4-1:6),Newline(1:1-1:1), +Int(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/large_tuple_index.md b/src/snapshots/old_syntax/large_tuple_index.md new file mode 100644 index 0000000000..fff4a492f6 --- /dev/null +++ b/src/snapshots/old_syntax/large_tuple_index.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=large_tuple_index +type=expr +~~~ +# SOURCE +~~~roc +.18888888888888888888 + h.22222222222222222222 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.18888888888888888888 +** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**large_tuple_index.md:1:1:1:24:** +```roc +.18888888888888888888 + h.22222222222222222222 +``` +^^^^^^^^^^^^^^^^^^^^^^^ + + +# TOKENS +~~~zig +DotInt(1:1-1:22),OpPlus(1:23-1:24),LowerIdent(1:25-1:26),NoSpaceDotInt(1:26-1:47),EndOfFile(1:47-1:47), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.24 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/list_closing_indent_not_enough.md b/src/snapshots/old_syntax/list_closing_indent_not_enough.md new file mode 100644 index 0000000000..2adb6d969e --- /dev/null +++ b/src/snapshots/old_syntax/list_closing_indent_not_enough.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=list_closing_indent_not_enough +type=expr +~~~ +# SOURCE +~~~roc +myList = [ + 0, + [ + a, + b, +], + 1, +] +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `myList` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:7),OpAssign(1:8-1:9),OpenSquare(1:10-1:11),Newline(1:1-1:1), +Int(2:5-2:6),Comma(2:6-2:7),Newline(1:1-1:1), +OpenSquare(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:9-4:10),Comma(4:10-4:11),Newline(1:1-1:1), +LowerIdent(5:9-5:10),Comma(5:10-5:11),Newline(1:1-1:1), +CloseSquare(6:1-6:2),Comma(6:2-6:3),Newline(1:1-1:1), +Int(7:5-7:6),Comma(7:6-7:7),Newline(1:1-1:1), +CloseSquare(8:1-8:2),Newline(1:1-1:1), +Int(9:1-9:3),EndOfFile(9:3-9:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.7 (qaul "") (raw "myList")) +~~~ +# FORMATTED +~~~roc +myList +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_closing_same_indent_no_trailing_comma.md b/src/snapshots/old_syntax/list_closing_same_indent_no_trailing_comma.md new file mode 100644 index 0000000000..fdc2a04474 --- /dev/null +++ b/src/snapshots/old_syntax/list_closing_same_indent_no_trailing_comma.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=list_closing_same_indent_no_trailing_comma +type=expr +~~~ +# SOURCE +~~~roc +myList = [ + 0, + 1 +] +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `myList` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:7),OpAssign(1:8-1:9),OpenSquare(1:10-1:11),Newline(1:1-1:1), +Int(2:5-2:6),Comma(2:6-2:7),Newline(1:1-1:1), +Int(3:5-3:6),Newline(1:1-1:1), +CloseSquare(4:1-4:2),Newline(1:1-1:1), +Int(5:1-5:3),EndOfFile(5:3-5:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.7 (qaul "") (raw "myList")) +~~~ +# FORMATTED +~~~roc +myList +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_closing_same_indent_with_trailing_comma.md b/src/snapshots/old_syntax/list_closing_same_indent_with_trailing_comma.md new file mode 100644 index 0000000000..294d48fce9 --- /dev/null +++ b/src/snapshots/old_syntax/list_closing_same_indent_with_trailing_comma.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=list_closing_same_indent_with_trailing_comma +type=expr +~~~ +# SOURCE +~~~roc +myList = [ + 0, + 1, +] +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `myList` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:7),OpAssign(1:8-1:9),OpenSquare(1:10-1:11),Newline(1:1-1:1), +Int(2:5-2:6),Comma(2:6-2:7),Newline(1:1-1:1), +Int(3:5-3:6),Comma(3:6-3:7),Newline(1:1-1:1), +CloseSquare(4:1-4:2),Newline(1:1-1:1), +Int(5:1-5:3),EndOfFile(5:3-5:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.7 (qaul "") (raw "myList")) +~~~ +# FORMATTED +~~~roc +myList +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_comma_newlines.md b/src/snapshots/old_syntax/list_comma_newlines.md new file mode 100644 index 0000000000..8dc4e8045b --- /dev/null +++ b/src/snapshots/old_syntax/list_comma_newlines.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=list_comma_newlines +type=expr +~~~ +# SOURCE +~~~roc +[s +, +] +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:1-1:1), +Comma(2:1-2:2),Newline(1:1-1:1), +CloseSquare(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-list @1.1-3.2 + (e-ident @1.2-1.3 (qaul "") (raw "s"))) +~~~ +# FORMATTED +~~~roc +[ + s, +] +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-3.2 (elem-var 74) (id 75) + (elems + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "List(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/list_comment_newline.md b/src/snapshots/old_syntax/list_comment_newline.md new file mode 100644 index 0000000000..8937768b49 --- /dev/null +++ b/src/snapshots/old_syntax/list_comment_newline.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=list_comment_newline +type=expr +~~~ +# SOURCE +~~~roc +[L# +, + +] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),UpperIdent(1:2-1:3),Newline(1:4-1:4), +Comma(2:1-2:2),Newline(1:1-1:1), +Newline(1:1-1:1), +CloseSquare(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-list @1.1-4.2 + (e-tag @1.2-1.3 (raw "L"))) +~~~ +# FORMATTED +~~~roc +[ + L, + +] +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-4.2 (elem-var 74) (id 75) + (elems + (e-tag @1.2-1.3 (ext-var 73) (name "L") (args "TODO")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "List([L]*)")) +~~~ diff --git a/src/snapshots/old_syntax/list_double_comma.md b/src/snapshots/old_syntax/list_double_comma.md new file mode 100644 index 0000000000..049115418a --- /dev/null +++ b/src/snapshots/old_syntax/list_double_comma.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=list_double_comma fail +type=expr +~~~ +# SOURCE +~~~roc +[1, 2, , 3] +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, 3** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**list_double_comma.md:1:8:1:11:** +```roc +[1, 2, , 3] +``` + ^^^ + + +**LIST NOT CLOSED** +This list is missing a closing bracket or has a syntax error. +Lists must be closed with **]** and list items must be separated by commas. +For example: [1, 2, 3] + +Here is the problematic code: +**list_double_comma.md:1:11:1:12:** +```roc +[1, 2, , 3] +``` + ^ + + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Int(1:2-1:3),Comma(1:3-1:4),Int(1:5-1:6),Comma(1:6-1:7),Comma(1:8-1:9),Int(1:10-1:11),CloseSquare(1:11-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-malformed @1.11-1.12 (reason "expected_expr_close_square_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/list_lots_of_spaces.md b/src/snapshots/old_syntax/list_lots_of_spaces.md new file mode 100644 index 0000000000..4ce8ae0312 --- /dev/null +++ b/src/snapshots/old_syntax/list_lots_of_spaces.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=list_lots_of_spaces +type=expr +~~~ +# SOURCE +~~~roc +[J +# +, + +# +u] +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `u` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),UpperIdent(1:2-1:3),Newline(1:1-1:1), +Newline(2:2-2:2), +Comma(3:1-3:2),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(5:2-5:2), +LowerIdent(6:1-6:2),CloseSquare(6:2-6:3),EndOfFile(6:3-6:3), +~~~ +# PARSE +~~~clojure +(e-list @1.1-6.3 + (e-tag @1.2-1.3 (raw "J")) + (e-ident @6.1-6.2 (qaul "") (raw "u"))) +~~~ +# FORMATTED +~~~roc +[ + J, + + + u, +] +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-6.3 (elem-var 74) (id 77) + (elems + (e-tag @1.2-1.3 (ext-var 73) (name "J") (args "TODO")) + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "List(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/list_minus_newlines.md b/src/snapshots/old_syntax/list_minus_newlines.md new file mode 100644 index 0000000000..ef6f4ba4b5 --- /dev/null +++ b/src/snapshots/old_syntax/list_minus_newlines.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=list_minus_newlines +type=expr +~~~ +# SOURCE +~~~roc +[K, +]-i +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),UpperIdent(1:2-1:3),Comma(1:3-1:4),Newline(1:1-1:1), +CloseSquare(2:1-2:2),OpBinaryMinus(2:2-2:3),LowerIdent(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "-") + (e-list @1.1-2.2 + (e-tag @1.2-1.3 (raw "K"))) + (e-ident @2.3-2.4 (qaul "") (raw "i"))) +~~~ +# FORMATTED +~~~roc +[ + K, +] - i +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "sub") (id 78) + (e-list @1.1-2.2 (elem-var 74) + (elems + (e-tag @1.2-1.3 (ext-var 73) (name "K") (args "TODO")))) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/list_pattern_not_terminated.md b/src/snapshots/old_syntax/list_pattern_not_terminated.md new file mode 100644 index 0000000000..14167a5e8b --- /dev/null +++ b/src/snapshots/old_syntax/list_pattern_not_terminated.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=list_pattern_not_terminated fail +type=expr +~~~ +# SOURCE +~~~roc +when [] is + [1, 2, -> "" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenSquare(1:6-1:7),CloseSquare(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +OpenSquare(2:5-2:6),Int(2:6-2:7),Comma(2:7-2:8),Int(2:9-2:10),Comma(2:10-2:11),OpArrow(2:12-2:14),StringStart(2:15-2:16),StringPart(2:16-2:16),StringEnd(2:16-2:17),EndOfFile(2:17-2:17), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_pattern_weird_indent.md b/src/snapshots/old_syntax/list_pattern_weird_indent.md new file mode 100644 index 0000000000..f48828f79e --- /dev/null +++ b/src/snapshots/old_syntax/list_pattern_weird_indent.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=list_pattern_weird_indent +type=expr +~~~ +# SOURCE +~~~roc +when [] is + [1, 2, +3] -> "" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenSquare(1:6-1:7),CloseSquare(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +OpenSquare(2:5-2:6),Int(2:6-2:7),Comma(2:7-2:8),Int(2:9-2:10),Comma(2:10-2:11),Newline(1:1-1:1), +Int(3:1-3:2),CloseSquare(3:2-3:3),OpArrow(3:4-3:6),StringStart(3:7-3:8),StringPart(3:8-3:8),StringEnd(3:8-3:9),EndOfFile(3:9-3:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_pattern_weird_rest_pattern.md b/src/snapshots/old_syntax/list_pattern_weird_rest_pattern.md new file mode 100644 index 0000000000..e61fc31e32 --- /dev/null +++ b/src/snapshots/old_syntax/list_pattern_weird_rest_pattern.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=list_pattern_weird_rest_pattern fail +type=expr +~~~ +# SOURCE +~~~roc +when [] is + [...] -> "" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenSquare(1:6-1:7),CloseSquare(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +OpenSquare(2:5-2:6),TripleDot(2:6-2:9),CloseSquare(2:9-2:10),OpArrow(2:11-2:13),StringStart(2:14-2:15),StringPart(2:15-2:15),StringEnd(2:15-2:16),EndOfFile(2:16-2:16), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_patterns.md b/src/snapshots/old_syntax/list_patterns.md new file mode 100644 index 0000000000..d36c969e2d --- /dev/null +++ b/src/snapshots/old_syntax/list_patterns.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=list_patterns +type=expr +~~~ +# SOURCE +~~~roc +when [] is + [] -> {} + [..] -> {} + [_, .., _, ..] -> {} + [a, b, c, d] -> {} + [a, b, ..] -> {} + [.., c, d] -> {} + [[A], [..], [a]] -> {} + [[[], []], [[], x]] -> {} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenSquare(1:6-1:7),CloseSquare(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +OpenSquare(2:3-2:4),CloseSquare(2:4-2:5),OpArrow(2:6-2:8),OpenCurly(2:9-2:10),CloseCurly(2:10-2:11),Newline(1:1-1:1), +OpenSquare(3:3-3:4),DoubleDot(3:4-3:6),CloseSquare(3:6-3:7),OpArrow(3:8-3:10),OpenCurly(3:11-3:12),CloseCurly(3:12-3:13),Newline(1:1-1:1), +OpenSquare(4:3-4:4),Underscore(4:4-4:5),Comma(4:5-4:6),DoubleDot(4:7-4:9),Comma(4:9-4:10),Underscore(4:11-4:12),Comma(4:12-4:13),DoubleDot(4:14-4:16),CloseSquare(4:16-4:17),OpArrow(4:18-4:20),OpenCurly(4:21-4:22),CloseCurly(4:22-4:23),Newline(1:1-1:1), +OpenSquare(5:3-5:4),LowerIdent(5:4-5:5),Comma(5:5-5:6),LowerIdent(5:7-5:8),Comma(5:8-5:9),LowerIdent(5:10-5:11),Comma(5:11-5:12),LowerIdent(5:13-5:14),CloseSquare(5:14-5:15),OpArrow(5:16-5:18),OpenCurly(5:19-5:20),CloseCurly(5:20-5:21),Newline(1:1-1:1), +OpenSquare(6:3-6:4),LowerIdent(6:4-6:5),Comma(6:5-6:6),LowerIdent(6:7-6:8),Comma(6:8-6:9),DoubleDot(6:10-6:12),CloseSquare(6:12-6:13),OpArrow(6:14-6:16),OpenCurly(6:17-6:18),CloseCurly(6:18-6:19),Newline(1:1-1:1), +OpenSquare(7:3-7:4),DoubleDot(7:4-7:6),Comma(7:6-7:7),LowerIdent(7:8-7:9),Comma(7:9-7:10),LowerIdent(7:11-7:12),CloseSquare(7:12-7:13),OpArrow(7:14-7:16),OpenCurly(7:17-7:18),CloseCurly(7:18-7:19),Newline(1:1-1:1), +OpenSquare(8:3-8:4),OpenSquare(8:4-8:5),UpperIdent(8:5-8:6),CloseSquare(8:6-8:7),Comma(8:7-8:8),OpenSquare(8:9-8:10),DoubleDot(8:10-8:12),CloseSquare(8:12-8:13),Comma(8:13-8:14),OpenSquare(8:15-8:16),LowerIdent(8:16-8:17),CloseSquare(8:17-8:18),CloseSquare(8:18-8:19),OpArrow(8:20-8:22),OpenCurly(8:23-8:24),CloseCurly(8:24-8:25),Newline(1:1-1:1), +OpenSquare(9:3-9:4),OpenSquare(9:4-9:5),OpenSquare(9:5-9:6),CloseSquare(9:6-9:7),Comma(9:7-9:8),OpenSquare(9:9-9:10),CloseSquare(9:10-9:11),CloseSquare(9:11-9:12),Comma(9:12-9:13),OpenSquare(9:14-9:15),OpenSquare(9:15-9:16),CloseSquare(9:16-9:17),Comma(9:17-9:18),LowerIdent(9:19-9:20),CloseSquare(9:20-9:21),CloseSquare(9:21-9:22),OpArrow(9:23-9:25),OpenCurly(9:26-9:27),CloseCurly(9:27-9:28),EndOfFile(9:28-9:28), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/list_without_end.md b/src/snapshots/old_syntax/list_without_end.md new file mode 100644 index 0000000000..5a6fcf90e1 --- /dev/null +++ b/src/snapshots/old_syntax/list_without_end.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=list_without_end fail +type=expr +~~~ +# SOURCE +~~~roc +[1, 2, +~~~ +# PROBLEMS +**LIST NOT CLOSED** +This list is missing a closing bracket or has a syntax error. +Lists must be closed with **]** and list items must be separated by commas. +For example: [1, 2, 3] + +Here is the problematic code: +**list_without_end.md:1:7:1:7:** +```roc +[1, 2, +``` + + + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Int(1:2-1:3),Comma(1:3-1:4),Int(1:5-1:6),Comma(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.7-1.7 (reason "expected_expr_close_square_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/long_complex_application_with_pnc.md b/src/snapshots/old_syntax/long_complex_application_with_pnc.md new file mode 100644 index 0000000000..a7129c833a --- /dev/null +++ b/src/snapshots/old_syntax/long_complex_application_with_pnc.md @@ -0,0 +1,104 @@ +# META +~~~ini +description=long_complex_application_with_pnc +type=expr +~~~ +# SOURCE +~~~roc +combine(mix(vodka, gin), Juices({ + color: Colors.orange, + flavor: Flavors.orange, + amount: 1 + 2 +})) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `combine` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `mix` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `vodka` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `gin` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `orange` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `orange` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:8),NoSpaceOpenRound(1:8-1:9),LowerIdent(1:9-1:12),NoSpaceOpenRound(1:12-1:13),LowerIdent(1:13-1:18),Comma(1:18-1:19),LowerIdent(1:20-1:23),CloseRound(1:23-1:24),Comma(1:24-1:25),UpperIdent(1:26-1:32),NoSpaceOpenRound(1:32-1:33),OpenCurly(1:33-1:34),Newline(1:1-1:1), +LowerIdent(2:5-2:10),OpColon(2:10-2:11),UpperIdent(2:12-2:18),NoSpaceDotLowerIdent(2:18-2:25),Comma(2:25-2:26),Newline(1:1-1:1), +LowerIdent(3:5-3:11),OpColon(3:11-3:12),UpperIdent(3:13-3:20),NoSpaceDotLowerIdent(3:20-3:27),Comma(3:27-3:28),Newline(1:1-1:1), +LowerIdent(4:5-4:11),OpColon(4:11-4:12),Int(4:13-4:14),OpPlus(4:15-4:16),Int(4:17-4:18),Newline(1:1-1:1), +CloseCurly(5:1-5:2),CloseRound(5:2-5:3),CloseRound(5:3-5:4),EndOfFile(5:4-5:4), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-5.4 + (e-ident @1.1-1.8 (qaul "") (raw "combine")) + (e-apply @1.9-1.24 + (e-ident @1.9-1.12 (qaul "") (raw "mix")) + (e-ident @1.13-1.18 (qaul "") (raw "vodka")) + (e-ident @1.20-1.23 (qaul "") (raw "gin"))) + (e-apply @1.26-5.3 + (e-tag @1.26-1.32 (raw "Juices")) + (e-record @1.33-5.2 + (field (field "color") (optional false) + (e-ident @2.12-2.25 (qaul "Colors") (raw ".orange"))) + (field (field "flavor") (optional false) + (e-ident @3.13-3.27 (qaul "Flavors") (raw ".orange"))) + (field (field "amount") (optional false) + (e-binop @4.13-5.2 (op "+") + (e-int @4.13-4.14 (raw "1")) + (e-int @4.17-4.18 (raw "2"))))))) +~~~ +# FORMATTED +~~~roc +combine( + mix(vodka, gin), + Juices( + { + color: Colors.orange, + flavor: Flavors.orange, + amount: 1 + 2, + }, + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-5.4 (id 103) + (e-runtime-error (tag "ident_not_in_scope")) + (e-call @1.9-1.24 + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) + (e-call @1.26-5.3 + (e-tag @1.26-1.32 (ext-var 83) (name "Juices") (args "TODO")) + (e-record @1.33-5.2 (ext-var 95) + (fields + (field (name "color") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "flavor") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "amount") + (e-binop @4.13-5.2 (op "add") + (e-int @4.13-4.14 (value "1")) + (e-int @4.17-4.18 (value "2")))))))) +~~~ +# TYPES +~~~clojure +(expr (id 103) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/looks_like_implements.md b/src/snapshots/old_syntax/looks_like_implements.md new file mode 100644 index 0000000000..535711ccbd --- /dev/null +++ b/src/snapshots/old_syntax/looks_like_implements.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=looks_like_implements malformed +type=expr +~~~ +# SOURCE +~~~roc +N (implements) h (0):B +T +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenRound(1:3-1:4),KwImplements(1:4-1:14),CloseRound(1:14-1:15),LowerIdent(1:16-1:17),OpenRound(1:18-1:19),Int(1:19-1:20),CloseRound(1:20-1:21),OpColon(1:21-1:22),UpperIdent(1:22-1:23),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "N")) +~~~ +# FORMATTED +~~~roc +N +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "N") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[N]*")) +~~~ diff --git a/src/snapshots/old_syntax/lowest_float.md b/src/snapshots/old_syntax/lowest_float.md new file mode 100644 index 0000000000..9e0cabf3ba --- /dev/null +++ b/src/snapshots/old_syntax/lowest_float.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=lowest_float +type=expr +~~~ +# SOURCE +~~~roc +-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:313),EndOfFile(1:313-1:313), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.313 (raw "-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-frac-f64 @1.1-1.313 (value "-1.7976931348623157e308") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/lowest_int.md b/src/snapshots/old_syntax/lowest_int.md new file mode 100644 index 0000000000..877585d7db --- /dev/null +++ b/src/snapshots/old_syntax/lowest_int.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=lowest_int +type=expr +~~~ +# SOURCE +~~~roc +-9223372036854775808 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:21),EndOfFile(1:21-1:21), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.21 (raw "-9223372036854775808")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.21 (value "-9223372036854775808") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/m_at_s_minus_s_implements.md b/src/snapshots/old_syntax/m_at_s_minus_s_implements.md new file mode 100644 index 0000000000..bd5cd6471a --- /dev/null +++ b/src/snapshots/old_syntax/m_at_s_minus_s_implements.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=m_at_s_minus_s_implements fail +type=expr +~~~ +# SOURCE +~~~roc +M@S -S implements +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpaqueName(1:2-1:4),OpUnaryMinus(1:5-1:6),UpperIdent(1:6-1:7),KwImplements(1:8-1:18),EndOfFile(1:18-1:18), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "M")) +~~~ +# FORMATTED +~~~roc +M +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "M") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[M]*")) +~~~ diff --git a/src/snapshots/old_syntax/malformed_pattern_field_access.md b/src/snapshots/old_syntax/malformed_pattern_field_access.md new file mode 100644 index 0000000000..fb7a76a444 --- /dev/null +++ b/src/snapshots/old_syntax/malformed_pattern_field_access.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=malformed_pattern_field_access malformed +type=expr +~~~ +# SOURCE +~~~roc +when x is + bar.and -> 1 + _ -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +LowerIdent(2:5-2:8),NoSpaceDotLowerIdent(2:8-2:12),OpArrow(2:13-2:15),Int(2:16-2:17),Newline(1:1-1:1), +Underscore(3:5-3:6),OpArrow(3:7-3:9),Int(3:10-3:11),EndOfFile(3:11-3:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/malformed_pattern_module_name.md b/src/snapshots/old_syntax/malformed_pattern_module_name.md new file mode 100644 index 0000000000..143a94174e --- /dev/null +++ b/src/snapshots/old_syntax/malformed_pattern_module_name.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=malformed_pattern_module_name malformed +type=expr +~~~ +# SOURCE +~~~roc +when x is + Foo.val -> 1 + _ -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +UpperIdent(2:5-2:8),NoSpaceDotLowerIdent(2:8-2:12),OpArrow(2:13-2:15),Int(2:16-2:17),Newline(1:1-1:1), +Underscore(3:5-3:6),OpArrow(3:7-3:9),Int(3:10-3:11),EndOfFile(3:11-3:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/mega_parens_pat.md b/src/snapshots/old_syntax/mega_parens_pat.md new file mode 100644 index 0000000000..4242e16621 --- /dev/null +++ b/src/snapshots/old_syntax/mega_parens_pat.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=mega_parens_pat +type=expr +~~~ +# SOURCE +~~~roc +1((0# +)f)((0# +)f):f +e +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_apply_close_round` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**mega_parens_pat.md:1:1:1:3:** +```roc +1((0# +``` +^^ + + +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),Newline(1:6-1:6), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),CloseRound(2:3-2:4),NoSpaceOpenRound(2:4-2:5),NoSpaceOpenRound(2:5-2:6),Int(2:6-2:7),Newline(2:8-2:8), +CloseRound(3:1-3:2),LowerIdent(3:2-3:3),CloseRound(3:3-3:4),OpColon(3:4-3:5),LowerIdent(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-2.4 (reason "expected_expr_apply_close_round")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/middle_when_branch_comment_after_parens.md b/src/snapshots/old_syntax/middle_when_branch_comment_after_parens.md new file mode 100644 index 0000000000..e27a10740a --- /dev/null +++ b/src/snapshots/old_syntax/middle_when_branch_comment_after_parens.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=middle_when_branch_comment_after_parens +type=expr +~~~ +# SOURCE +~~~roc +when n is +O->(s +)# +O->t +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +UpperIdent(2:1-2:2),OpArrow(2:2-2:4),NoSpaceOpenRound(2:4-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +CloseRound(3:1-3:2),Newline(3:3-3:3), +UpperIdent(4:1-4:2),OpArrow(4:2-4:4),LowerIdent(4:4-4:5),EndOfFile(4:5-4:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/min_parens_number.md b/src/snapshots/old_syntax/min_parens_number.md new file mode 100644 index 0000000000..c29dd75374 --- /dev/null +++ b/src/snapshots/old_syntax/min_parens_number.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=min_parens_number +type=expr +~~~ +# SOURCE +~~~roc +-(8) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**min_parens_number.md:1:1:1:3:** +```roc +-(8) +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),CloseRound(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/minus_minus_block_string.md b/src/snapshots/old_syntax/minus_minus_block_string.md new file mode 100644 index 0000000000..9e8eb7fd26 --- /dev/null +++ b/src/snapshots/old_syntax/minus_minus_block_string.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=minus_minus_block_string +type=expr +~~~ +# SOURCE +~~~roc +--"""""" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **--** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**minus_minus_block_string.md:1:1:1:3:** +```roc +--"""""" +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),OpBinaryMinus(1:2-1:3),MultilineStringStart(1:3-1:6),StringPart(1:6-1:6),MultilineStringEnd(1:6-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/minus_minus_six.md b/src/snapshots/old_syntax/minus_minus_six.md new file mode 100644 index 0000000000..49803b053c --- /dev/null +++ b/src/snapshots/old_syntax/minus_minus_six.md @@ -0,0 +1,56 @@ +# META +~~~ini +description=minus_minus_six +type=expr +~~~ +# SOURCE +~~~roc +(-(-6)) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**minus_minus_six.md:1:2:1:4:** +```roc +(-(-6)) +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**minus_minus_six.md:1:6:1:8:** +```roc +(-(-6)) +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpBinaryMinus(1:2-1:3),NoSpaceOpenRound(1:3-1:4),OpBinaryMinus(1:4-1:5),Int(1:5-1:6),CloseRound(1:6-1:7),CloseRound(1:7-1:8),EndOfFile(1:8-1:8), +~~~ +# PARSE +~~~clojure +(e-malformed @1.6-1.8 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/minus_newline_minus.md b/src/snapshots/old_syntax/minus_newline_minus.md new file mode 100644 index 0000000000..a9fd1fa8ca --- /dev/null +++ b/src/snapshots/old_syntax/minus_newline_minus.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=minus_newline_minus +type=expr +~~~ +# SOURCE +~~~roc +s- + -{} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**minus_newline_minus.md:2:2:2:4:** +```roc + -{} +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),Newline(1:1-1:1), +OpUnaryMinus(2:2-2:3),OpenCurly(2:3-2:4),CloseCurly(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "s")) + (e-malformed @2.2-2.4 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +s - + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/minus_newline_minus_minus.md b/src/snapshots/old_syntax/minus_newline_minus_minus.md new file mode 100644 index 0000000000..fa6e1a2e7e --- /dev/null +++ b/src/snapshots/old_syntax/minus_newline_minus_minus.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=minus_newline_minus_minus +type=expr +~~~ +# SOURCE +~~~roc +p- + -t-1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-t** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**minus_newline_minus_minus.md:2:2:2:4:** +```roc + -t-1 +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),Newline(1:1-1:1), +OpUnaryMinus(2:2-2:3),LowerIdent(2:3-2:4),OpBinaryMinus(2:4-2:5),Int(2:5-2:6),EndOfFile(2:6-2:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "p")) + (e-malformed @2.2-2.4 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +p - + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/minus_not_h.md b/src/snapshots/old_syntax/minus_not_h.md new file mode 100644 index 0000000000..a5a3c63f5d --- /dev/null +++ b/src/snapshots/old_syntax/minus_not_h.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=minus_not_h +type=expr +~~~ +# SOURCE +~~~roc +-!h +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-!** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**minus_not_h.md:1:1:1:3:** +```roc +-!h +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),OpBang(1:2-1:3),LowerIdent(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/minus_twelve_minus_five.md b/src/snapshots/old_syntax/minus_twelve_minus_five.md new file mode 100644 index 0000000000..465820783a --- /dev/null +++ b/src/snapshots/old_syntax/minus_twelve_minus_five.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=minus_twelve_minus_five +type=expr +~~~ +# SOURCE +~~~roc +-12-5 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:4),OpBinaryMinus(1:4-1:5),Int(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.6 (op "-") + (e-int @1.1-1.4 (raw "-12")) + (e-int @1.5-1.6 (raw "5"))) +~~~ +# FORMATTED +~~~roc +-12 - 5 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.6 (op "sub") (id 75) + (e-int @1.1-1.4 (value "-12")) + (e-int @1.5-1.6 (value "5"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/mixed_docs.md b/src/snapshots/old_syntax/mixed_docs.md new file mode 100644 index 0000000000..006c4688c7 --- /dev/null +++ b/src/snapshots/old_syntax/mixed_docs.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=mixed_docs +type=expr +~~~ +# SOURCE +~~~roc +### not docs! +## docs, but with a problem +## (namely that this is a mix of docs and regular comments) +# not docs +x = 5 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **## not docs! +## docs, but with a problem** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**mixed_docs.md:1:2:2:28:** +```roc +### not docs! +## docs, but with a problem +``` + + +# TOKENS +~~~zig +Newline(1:2-1:14), +Newline(2:2-2:28), +Newline(3:2-3:60), +Newline(4:2-4:11), +LowerIdent(5:1-5:2),OpAssign(5:3-5:4),Int(5:5-5:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(7:1-7:3),EndOfFile(7:3-7:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.28 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/module_dot_tuple.md b/src/snapshots/old_syntax/module_dot_tuple.md new file mode 100644 index 0000000000..eceb82027b --- /dev/null +++ b/src/snapshots/old_syntax/module_dot_tuple.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=module_dot_tuple malformed +type=expr +~~~ +# SOURCE +~~~roc +I.5 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expr_no_space_dot_int` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**module_dot_tuple.md:1:2:1:4:** +```roc +I.5 +``` + ^^ + + +# TOKENS +~~~zig +UpperIdent(1:1-1:2),NoSpaceDotInt(1:2-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-1.4 (reason "expr_no_space_dot_int")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/mul_comment_neg.md b/src/snapshots/old_syntax/mul_comment_neg.md new file mode 100644 index 0000000000..67dfa713dd --- /dev/null +++ b/src/snapshots/old_syntax/mul_comment_neg.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=mul_comment_neg +type=expr +~~~ +# SOURCE +~~~roc +n*f +# +-f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `n` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpStar(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:1-1:1), +Newline(2:2-2:2), +OpUnaryMinus(3:1-3:2),LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-3.2 (op "*") + (e-ident @1.1-1.2 (qaul "") (raw "n")) + (e-ident @1.3-1.4 (qaul "") (raw "f"))) +~~~ +# FORMATTED +~~~roc +n * f +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-3.2 (op "mul") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/multi_char_string.md b/src/snapshots/old_syntax/multi_char_string.md new file mode 100644 index 0000000000..75b7f3957a --- /dev/null +++ b/src/snapshots/old_syntax/multi_char_string.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=multi_char_string +type=expr +~~~ +# SOURCE +~~~roc +"foo" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:5),StringEnd(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.6 + (e-string-part @1.2-1.5 (raw "foo"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.6 (id 74) + (e-literal @1.2-1.5 (string "foo"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/multi_no_end.md b/src/snapshots/old_syntax/multi_no_end.md new file mode 100644 index 0000000000..ac87f52caf --- /dev/null +++ b/src/snapshots/old_syntax/multi_no_end.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=multi_no_end fail +type=expr +~~~ +# SOURCE +~~~roc +"""there is no end +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""there is no end** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multi_no_end.md:1:1:1:19:** +```roc +"""there is no end +``` +^^^^^^^^^^^^^^^^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:19),EndOfFile(1:19-1:19), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.19 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/multilin_str_body.md b/src/snapshots/old_syntax/multilin_str_body.md new file mode 100644 index 0000000000..190c85c86f --- /dev/null +++ b/src/snapshots/old_syntax/multilin_str_body.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=multilin_str_body +type=expr +~~~ +# SOURCE +~~~roc +a=""""f""" +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),MultilineStringStart(1:3-1:6),StringPart(1:6-1:8),MultilineStringEnd(1:8-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_apply_equals_multiline_apply.md b/src/snapshots/old_syntax/multiline_apply_equals_multiline_apply.md new file mode 100644 index 0000000000..1d111b7d97 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_apply_equals_multiline_apply.md @@ -0,0 +1,55 @@ +# META +~~~ini +description=multiline_apply_equals_multiline_apply +type=expr +~~~ +# SOURCE +~~~roc + +MT + q +=g + q +dbgT +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** +MT** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_apply_equals_multiline_apply.md:1:1:2:3:** +```roc + +MT +``` + + +# TOKENS +~~~zig +Newline(1:1-1:1), +UpperIdent(2:1-2:3),Newline(1:1-1:1), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +OpAssign(4:1-4:2),LowerIdent(4:2-4:3),Newline(1:1-1:1), +LowerIdent(5:2-5:3),Newline(1:1-1:1), +LowerIdent(6:1-6:5),EndOfFile(6:5-6:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-2.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/multiline_binop_when_with_comments.md b/src/snapshots/old_syntax/multiline_binop_when_with_comments.md new file mode 100644 index 0000000000..717389fe33 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_binop_when_with_comments.md @@ -0,0 +1,82 @@ +# META +~~~ini +description=multiline_binop_when_with_comments +type=expr +~~~ +# SOURCE +~~~roc +when + x + + 1 # comment 1 + > 0 # comment 2 +is + y -> + 3 + * 2 # comment 3 + < 1 # comment 4 + + z -> + 4 + / 5 # comment 5 + < 1 # comment 6 + + 46 # first pattern comment + | 95 # alternative comment 1 + | 126 # alternative comment 2 + | 150 -> # This comment came after the -> + # This comment is for the expr + foo bar + |> Result.withDefault "" # one last comment + + _ -> + 42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Newline(1:1-1:1), +LowerIdent(2:5-2:6),Newline(1:1-1:1), +OpPlus(3:5-3:6),Int(3:7-3:8),Newline(3:10-3:20), +OpGreaterThan(4:5-4:6),Int(4:7-4:8),Newline(4:10-4:20), +LowerIdent(5:1-5:3),Newline(1:1-1:1), +LowerIdent(6:5-6:6),OpArrow(6:7-6:9),Newline(1:1-1:1), +Int(7:9-7:10),Newline(1:1-1:1), +OpStar(8:9-8:10),Int(8:11-8:12),Newline(8:14-8:24), +OpLessThan(9:9-9:10),Int(9:11-9:12),Newline(9:14-9:24), +Newline(1:1-1:1), +LowerIdent(11:5-11:6),OpArrow(11:7-11:9),Newline(1:1-1:1), +Int(12:9-12:10),Newline(1:1-1:1), +OpSlash(13:13-13:14),Int(13:15-13:16),Newline(13:19-13:29), +OpLessThan(14:17-14:18),Int(14:19-14:20),Newline(14:25-14:35), +Newline(1:1-1:1), +Int(16:5-16:7),Newline(16:9-16:31), +OpBar(17:5-17:6),Int(17:7-17:9),Newline(17:11-17:33), +OpBar(18:5-18:6),Int(18:7-18:10),Newline(18:12-18:34), +OpBar(19:5-19:6),Int(19:7-19:10),OpArrow(19:11-19:13),Newline(19:15-19:46), +Newline(20:10-20:39), +LowerIdent(21:13-21:16),LowerIdent(21:17-21:20),Newline(1:1-1:1), +OpPizza(22:17-22:19),UpperIdent(22:20-22:26),NoSpaceDotLowerIdent(22:26-22:38),StringStart(22:39-22:40),StringPart(22:40-22:40),StringEnd(22:40-22:41),Newline(22:43-22:60), +Newline(1:1-1:1), +Underscore(24:5-24:6),OpArrow(24:7-24:9),Newline(1:1-1:1), +Int(25:9-25:11),EndOfFile(25:11-25:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_after_newlines_in_pat.md b/src/snapshots/old_syntax/multiline_str_after_newlines_in_pat.md new file mode 100644 index 0000000000..b272e20e84 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_after_newlines_in_pat.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=multiline_str_after_newlines_in_pat +type=expr +~~~ +# SOURCE +~~~roc +(4 + +)"""""":C +U +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Int(1:2-1:3),Newline(1:1-1:1), +Newline(1:1-1:1), +CloseRound(3:1-3:2),MultilineStringStart(3:2-3:5),StringPart(3:5-3:5),MultilineStringEnd(3:5-3:8),OpColon(3:8-3:9),UpperIdent(3:9-3:10),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-3.2 + (e-int @1.2-1.3 (raw "4"))) +~~~ +# FORMATTED +~~~roc +( + 4, + +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-3.2 (id 74) + (elems + (e-int @1.2-1.3 (value "4")))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "(Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_and_str_in_alias.md b/src/snapshots/old_syntax/multiline_str_and_str_in_alias.md new file mode 100644 index 0000000000..5f8542e5e6 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_and_str_in_alias.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=multiline_str_and_str_in_alias +type=expr +~~~ +# SOURCE +~~~roc +8 +("""""""")f:C +U +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpenRound(2:1-2:2),MultilineStringStart(2:2-2:5),StringPart(2:5-2:5),MultilineStringEnd(2:5-2:8),StringStart(2:8-2:9),StringPart(2:9-2:9),StringEnd(2:9-2:10),CloseRound(2:10-2:11),LowerIdent(2:11-2:12),OpColon(2:12-2:13),UpperIdent(2:13-2:14),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "8")) +~~~ +# FORMATTED +~~~roc +8 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "8") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_apply_in_parens_pat.md b/src/snapshots/old_syntax/multiline_str_apply_in_parens_pat.md new file mode 100644 index 0000000000..b87ee73d28 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_apply_in_parens_pat.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=multiline_str_apply_in_parens_pat +type=expr +~~~ +# SOURCE +~~~roc +u ("""""" (0)):f +s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `u` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpenRound(1:3-1:4),MultilineStringStart(1:4-1:7),StringPart(1:7-1:7),MultilineStringEnd(1:7-1:10),OpenRound(1:11-1:12),Int(1:12-1:13),CloseRound(1:13-1:14),CloseRound(1:14-1:15),OpColon(1:15-1:16),LowerIdent(1:16-1:17),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "u")) +~~~ +# FORMATTED +~~~roc +u +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_crazyness.md b/src/snapshots/old_syntax/multiline_str_crazyness.md new file mode 100644 index 0000000000..65e566c470 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_crazyness.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=multiline_str_crazyness +type=expr +~~~ +# SOURCE +~~~roc +"""""""${i""""""}" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_str_crazyness.md:1:1:1:4:** +```roc +"""""""${i""""""}" +``` +^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:4),MultilineStringEnd(1:4-1:7),StringStart(1:7-1:8),StringPart(1:8-1:8),OpenStringInterpolation(1:8-1:10),LowerIdent(1:10-1:11),MultilineStringStart(1:11-1:14),StringPart(1:14-1:14),MultilineStringEnd(1:14-1:17),CloseStringInterpolation(1:17-1:18),StringPart(1:18-1:18),StringEnd(1:18-1:19),EndOfFile(1:19-1:19), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_in_closure_in_when_guard_wtf.md b/src/snapshots/old_syntax/multiline_str_in_closure_in_when_guard_wtf.md new file mode 100644 index 0000000000..436f7eadee --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_in_closure_in_when_guard_wtf.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=multiline_str_in_closure_in_when_guard_wtf +type=expr +~~~ +# SOURCE +~~~roc +when f +is +s if\t->""""""->e +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),KwIf(3:3-3:5),OpBackslash(3:5-3:6),LowerIdent(3:6-3:7),OpArrow(3:7-3:9),MultilineStringStart(3:9-3:12),StringPart(3:12-3:12),MultilineStringEnd(3:12-3:15),OpArrow(3:15-3:17),LowerIdent(3:17-3:18),EndOfFile(3:18-3:18), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_in_pat.md b/src/snapshots/old_syntax/multiline_str_in_pat.md new file mode 100644 index 0000000000..09bf3208c6 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_in_pat.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=multiline_str_in_pat +type=expr +~~~ +# SOURCE +~~~roc +1"""""""^"2:A +"" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:5),MultilineStringEnd(1:5-1:8),StringStart(1:8-1:9),StringPart(1:9-1:10),StringEnd(1:10-1:11),Int(1:11-1:12),OpColon(1:12-1:13),UpperIdent(1:13-1:14),Newline(1:1-1:1), +StringStart(2:1-2:2),StringPart(2:2-2:2),StringEnd(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_interpolation_records.md b/src/snapshots/old_syntax/multiline_str_interpolation_records.md new file mode 100644 index 0000000000..e4d6545505 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_interpolation_records.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=multiline_str_interpolation_records +type=expr +~~~ +# SOURCE +~~~roc +"""${{ +}i} +${{ +}i}""" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_str_interpolation_records.md:1:1:1:4:** +```roc +"""${{ +``` +^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:4),OpenStringInterpolation(1:4-1:6),OpenCurly(1:6-1:7),Newline(1:1-1:1), +CloseCurly(2:1-2:2),LowerIdent(2:2-2:3),CloseStringInterpolation(2:3-2:4),StringPart(2:4-2:4),Newline(1:1-1:1), +MalformedUnknownToken(3:1-3:2),OpenCurly(3:2-3:3),OpenCurly(3:3-3:4),Newline(1:1-1:1), +CloseCurly(4:1-4:2),LowerIdent(4:2-4:3),CloseCurly(4:3-4:4),MultilineStringStart(4:4-4:7),StringPart(4:7-4:7),EndOfFile(4:7-4:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_opt_field.md b/src/snapshots/old_syntax/multiline_str_opt_field.md new file mode 100644 index 0000000000..eecb90e3b5 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_opt_field.md @@ -0,0 +1,83 @@ +# META +~~~ini +description=multiline_str_opt_field +type=expr +~~~ +# SOURCE +~~~roc +{l?""""""}"" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_str_opt_field.md:1:4:1:7:** +```roc +{l?""""""}"" +``` + ^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_str_opt_field.md:1:7:1:10:** +```roc +{l?""""""}"" +``` + ^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**multiline_str_opt_field.md:1:7:1:11:** +```roc +{l?""""""}"" +``` + ^^^^ + + +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize suffix_single_question expression + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),NoSpaceOpQuestion(1:3-1:4),MultilineStringStart(1:4-1:7),StringPart(1:7-1:7),MultilineStringEnd(1:7-1:10),CloseCurly(1:10-1:11),StringStart(1:11-1:12),StringPart(1:12-1:12),StringEnd(1:12-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-block @1.1-1.11 + (statements + (e-question-suffix @1.2-1.4 + (e-ident @1.2-1.3 (qaul "") (raw "l"))) + (e-malformed @1.4-1.7 (reason "expr_unexpected_token")) + (e-malformed @1.7-1.10 (reason "expr_unexpected_token")) + (e-malformed @1.7-1.11 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +{ + l? + + + +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-1.11 (id 77) + (s-expr @1.2-1.7 + (e-runtime-error (tag "not_implemented"))) + (e-empty_record @1.1-1.11)) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_newline.md b/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_newline.md new file mode 100644 index 0000000000..96d3c9ae5c --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_newline.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=multiline_str_pnc_apply_in_assignment_newline +type=expr +~~~ +# SOURCE +~~~roc +(e=""""""().d +e)m +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**multiline_str_pnc_apply_in_assignment_newline.md:1:11:1:14:** +```roc +(e=""""""().d +``` + ^^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),OpAssign(1:3-1:4),MultilineStringStart(1:4-1:7),StringPart(1:7-1:7),MultilineStringEnd(1:7-1:10),NoSpaceOpenRound(1:10-1:11),CloseRound(1:11-1:12),NoSpaceDotLowerIdent(1:12-1:14),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),LowerIdent(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.11-1.14 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_record_access_newline.md b/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_record_access_newline.md new file mode 100644 index 0000000000..1ac7d17822 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_str_pnc_apply_in_assignment_record_access_newline.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=multiline_str_pnc_apply_in_assignment_record_access_newline +type=expr +~~~ +# SOURCE +~~~roc +i=""""""().1 +p +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),MultilineStringStart(1:3-1:6),StringPart(1:6-1:6),MultilineStringEnd(1:6-1:9),NoSpaceOpenRound(1:9-1:10),CloseRound(1:10-1:11),NoSpaceDotInt(1:11-1:13),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "i")) +~~~ +# FORMATTED +~~~roc +i +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_string.md b/src/snapshots/old_syntax/multiline_string.md new file mode 100644 index 0000000000..2cb36dbe38 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_string.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=multiline_string +type=expr +~~~ +# SOURCE +~~~roc +a = "Hello,\n\nWorld!" +b = """Hello,\n\nWorld!""" +c = + """ + Hello, + + World! + """ +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),StringStart(1:5-1:6),StringPart(1:6-1:22),StringEnd(1:22-1:23),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),MultilineStringStart(2:5-2:8),StringPart(2:8-2:24),MultilineStringEnd(2:24-2:27),Newline(1:1-1:1), +LowerIdent(3:1-3:2),OpAssign(3:3-3:4),Newline(1:1-1:1), +MultilineStringStart(4:5-4:8),StringPart(4:8-4:8),Newline(1:1-1:1), +UpperIdent(5:5-5:10),Comma(5:10-5:11),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(7:5-7:11),Newline(1:1-1:1), +MultilineStringStart(8:5-8:8),StringPart(8:8-8:8),Newline(1:1-1:1), +Int(9:1-9:3),EndOfFile(9:3-9:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_string_in_apply.md b/src/snapshots/old_syntax/multiline_string_in_apply.md new file mode 100644 index 0000000000..cb752bcf76 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_string_in_apply.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=multiline_string_in_apply +type=expr +~~~ +# SOURCE +~~~roc +e""""\"""" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:8),MultilineStringEnd(1:8-1:11),EndOfFile(1:11-1:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "e")) +~~~ +# FORMATTED +~~~roc +e +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_tuple_with_comments.md b/src/snapshots/old_syntax/multiline_tuple_with_comments.md new file mode 100644 index 0000000000..db21ce9cd1 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_tuple_with_comments.md @@ -0,0 +1,70 @@ +# META +~~~ini +description=multiline_tuple_with_comments +type=expr +~~~ +# SOURCE +~~~roc +( + #before 1 + 1 + #after 1 + , + #before 2 + 2 + #after 2 + , + #before 3 + 3 + # after 3 +) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +Newline(2:6-2:14), +Int(3:5-3:6),Newline(1:1-1:1), +Newline(4:6-4:13), +Comma(5:5-5:6),Newline(1:1-1:1), +Newline(6:6-6:14), +Int(7:5-7:6),Newline(1:1-1:1), +Newline(8:6-8:13), +Comma(9:5-9:6),Newline(1:1-1:1), +Newline(10:6-10:14), +Int(11:5-11:6),Newline(1:1-1:1), +Newline(12:6-12:14), +CloseRound(13:1-13:2),EndOfFile(13:2-13:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-13.2 + (e-int @3.5-3.6 (raw "1")) + (e-int @7.5-7.6 (raw "2")) + (e-int @11.5-11.6 (raw "3"))) +~~~ +# FORMATTED +~~~roc +( + # before 1 + 1, + # before 2 + 2, + # before 3 + 3, + # after 3 +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-13.2 (id 76) + (elems + (e-int @3.5-3.6 (value "1")) + (e-int @7.5-7.6 (value "2")) + (e-int @11.5-11.6 (value "3")))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "(Num(*), Num(*), Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_type_signature.md b/src/snapshots/old_syntax/multiline_type_signature.md new file mode 100644 index 0000000000..a6d61a67e3 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_type_signature.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=multiline_type_signature +type=expr +~~~ +# SOURCE +~~~roc +f : + {} + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),Newline(1:1-1:1), +OpenCurly(2:5-2:6),CloseCurly(2:6-2:7),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiline_type_signature_with_comment.md b/src/snapshots/old_syntax/multiline_type_signature_with_comment.md new file mode 100644 index 0000000000..82e0fd7812 --- /dev/null +++ b/src/snapshots/old_syntax/multiline_type_signature_with_comment.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=multiline_type_signature_with_comment +type=expr +~~~ +# SOURCE +~~~roc +f :# comment + {} + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),Newline(1:5-1:13), +OpenCurly(2:5-2:6),CloseCurly(2:6-2:7),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/multiple_fields.md b/src/snapshots/old_syntax/multiple_fields.md new file mode 100644 index 0000000000..67597bbfb0 --- /dev/null +++ b/src/snapshots/old_syntax/multiple_fields.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=multiple_fields +type=expr +~~~ +# SOURCE +~~~roc +rec.abc.def.ghi +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `rec` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),NoSpaceDotLowerIdent(1:4-1:8),NoSpaceDotLowerIdent(1:8-1:12),NoSpaceDotLowerIdent(1:12-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-field-access @1.1-1.16 + (e-field-access @1.1-1.16 + (e-field-access @1.1-1.12 + (e-ident @1.1-1.4 (qaul "") (raw "rec")) + (e-ident @1.4-1.8 (qaul "") (raw ".abc"))) + (e-ident @1.8-1.12 (qaul "") (raw ".def"))) + (e-ident @1.12-1.16 (qaul "") (raw ".ghi"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dot-access @1.1-1.16 (field "ghi") (id 77) + (receiver + (e-dot-access @1.1-1.16 (field "def") + (receiver + (e-dot-access @1.1-1.12 (field "abc") + (receiver + (e-runtime-error (tag "ident_not_in_scope")))))))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/multiple_operators.md b/src/snapshots/old_syntax/multiple_operators.md new file mode 100644 index 0000000000..d9508e0dac --- /dev/null +++ b/src/snapshots/old_syntax/multiple_operators.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=multiple_operators +type=expr +~~~ +# SOURCE +~~~roc +31*42+534 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:3),OpStar(1:3-1:4),Int(1:4-1:6),OpPlus(1:6-1:7),Int(1:7-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.10 (op "+") + (e-binop @1.1-1.7 (op "*") + (e-int @1.1-1.3 (raw "31")) + (e-int @1.4-1.6 (raw "42"))) + (e-int @1.7-1.10 (raw "534"))) +~~~ +# FORMATTED +~~~roc +31 * 42 + 534 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.10 (op "add") (id 77) + (e-binop @1.1-1.7 (op "mul") + (e-int @1.1-1.3 (value "31")) + (e-int @1.4-1.6 (value "42"))) + (e-int @1.7-1.10 (value "534"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/neg_float_literal_pnc_apply_pat.md b/src/snapshots/old_syntax/neg_float_literal_pnc_apply_pat.md new file mode 100644 index 0000000000..b5523140b4 --- /dev/null +++ b/src/snapshots/old_syntax/neg_float_literal_pnc_apply_pat.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=neg_float_literal_pnc_apply_pat +type=expr +~~~ +# SOURCE +~~~roc +(-8.)():C +p +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-8** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**neg_float_literal_pnc_apply_pat.md:1:2:1:4:** +```roc +(-8.)():C +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**neg_float_literal_pnc_apply_pat.md:1:5:1:7:** +```roc +(-8.)():C +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpBinaryMinus(1:2-1:3),Int(1:3-1:4),Dot(1:4-1:5),CloseRound(1:5-1:6),NoSpaceOpenRound(1:6-1:7),CloseRound(1:7-1:8),OpColon(1:8-1:9),UpperIdent(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.5-1.7 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/neg_inf_float.md b/src/snapshots/old_syntax/neg_inf_float.md new file mode 100644 index 0000000000..274584e459 --- /dev/null +++ b/src/snapshots/old_syntax/neg_inf_float.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=neg_inf_float +type=expr +~~~ +# SOURCE +~~~roc +-inf +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-inf** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**neg_inf_float.md:1:1:1:5:** +```roc +-inf +``` +^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),LowerIdent(1:2-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/neg_nested_parens.md b/src/snapshots/old_syntax/neg_nested_parens.md new file mode 100644 index 0000000000..fb4b732451 --- /dev/null +++ b/src/snapshots/old_syntax/neg_nested_parens.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=neg_nested_parens +type=expr +~~~ +# SOURCE +~~~roc +-(0(1 +d)) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**neg_nested_parens.md:1:1:1:3:** +```roc +-(0(1 +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),NoSpaceOpenRound(1:4-1:5),Int(1:5-1:6),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),CloseRound(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/neg_newline_four.md b/src/snapshots/old_syntax/neg_newline_four.md new file mode 100644 index 0000000000..c77cc224fe --- /dev/null +++ b/src/snapshots/old_syntax/neg_newline_four.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=neg_newline_four +type=expr +~~~ +# SOURCE +~~~roc +-( +4) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**neg_newline_four.md:1:1:1:3:** +```roc +-( +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Newline(1:1-1:1), +Int(2:1-2:2),CloseRound(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/negate_apply_parens_comment.md b/src/snapshots/old_syntax/negate_apply_parens_comment.md new file mode 100644 index 0000000000..b78ef2c9ad --- /dev/null +++ b/src/snapshots/old_syntax/negate_apply_parens_comment.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=negate_apply_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +-((4 +4)4) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**negate_apply_parens_comment.md:1:1:1:3:** +```roc +-((4 +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),Newline(1:1-1:1), +Int(2:1-2:2),CloseRound(2:2-2:3),Int(2:3-2:4),CloseRound(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/negate_multiline_string.md b/src/snapshots/old_syntax/negate_multiline_string.md new file mode 100644 index 0000000000..435c1a7e06 --- /dev/null +++ b/src/snapshots/old_syntax/negate_multiline_string.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=negate_multiline_string +type=expr +~~~ +# SOURCE +~~~roc +-"""""" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**negate_multiline_string.md:1:1:1:5:** +```roc +-"""""" +``` +^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:5),MultilineStringEnd(1:5-1:8),EndOfFile(1:8-1:8), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/negate_multiline_string_with_quote.md b/src/snapshots/old_syntax/negate_multiline_string_with_quote.md new file mode 100644 index 0000000000..826d29a567 --- /dev/null +++ b/src/snapshots/old_syntax/negate_multiline_string_with_quote.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=negate_multiline_string_with_quote +type=expr +~~~ +# SOURCE +~~~roc +-""""<""" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**negate_multiline_string_with_quote.md:1:1:1:5:** +```roc +-""""<""" +``` +^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:7),MultilineStringEnd(1:7-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/negative_float.md b/src/snapshots/old_syntax/negative_float.md new file mode 100644 index 0000000000..bede03b639 --- /dev/null +++ b/src/snapshots/old_syntax/negative_float.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=negative_float +type=expr +~~~ +# SOURCE +~~~roc +-42.9 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.6 (raw "-42.9")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dec-small @1.1-1.6 (numerator "-429") (denominator-power-of-ten "1") (value "-42.9") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/negative_in_apply_def.md b/src/snapshots/old_syntax/negative_in_apply_def.md new file mode 100644 index 0000000000..6215331b64 --- /dev/null +++ b/src/snapshots/old_syntax/negative_in_apply_def.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=negative_in_apply_def +type=expr +~~~ +# SOURCE +~~~roc +a=A + -g a +a +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +OpUnaryMinus(2:2-2:3),LowerIdent(2:3-2:4),LowerIdent(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/negative_int.md b/src/snapshots/old_syntax/negative_int.md new file mode 100644 index 0000000000..3ae66fa227 --- /dev/null +++ b/src/snapshots/old_syntax/negative_int.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=negative_int +type=expr +~~~ +# SOURCE +~~~roc +-42 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.4 (raw "-42")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.4 (value "-42") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/negative_number_in_pattern.md b/src/snapshots/old_syntax/negative_number_in_pattern.md new file mode 100644 index 0000000000..c0cd61c63a --- /dev/null +++ b/src/snapshots/old_syntax/negative_number_in_pattern.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=negative_number_in_pattern malformed +type=expr +~~~ +# SOURCE +~~~roc +N -0 T:A +zT +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Int(1:3-1:5),UpperIdent(1:6-1:7),OpColon(1:7-1:8),UpperIdent(1:8-1:9),Newline(1:1-1:1), +LowerIdent(2:1-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "N")) +~~~ +# FORMATTED +~~~roc +N +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "N") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[N]*")) +~~~ diff --git a/src/snapshots/old_syntax/negative_single_quote.md b/src/snapshots/old_syntax/negative_single_quote.md new file mode 100644 index 0000000000..70f37e3b86 --- /dev/null +++ b/src/snapshots/old_syntax/negative_single_quote.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=negative_single_quote +type=expr +~~~ +# SOURCE +~~~roc +-'i' +~~~ +# PROBLEMS +**UNCLOSED SINGLE QUOTE** +This character literal is missing a closing single quote. + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-'i'** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**negative_single_quote.md:1:1:1:5:** +```roc +-'i' +``` +^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),SingleQuote(1:2-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/nested_if.md b/src/snapshots/old_syntax/nested_if.md new file mode 100644 index 0000000000..c7cd60d2ed --- /dev/null +++ b/src/snapshots/old_syntax/nested_if.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=nested_if +type=expr +~~~ +# SOURCE +~~~roc +if t1 then + 1 +else if t2 then + 2 +else + 3 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**nested_if.md:2:3:2:3:** +```roc + 1 +``` + + + +# TOKENS +~~~zig +KwIf(1:1-1:3),LowerIdent(1:4-1:6),LowerIdent(1:7-1:11),Newline(1:1-1:1), +Int(2:3-2:4),Newline(1:1-1:1), +KwElse(3:1-3:5),KwIf(3:6-3:8),LowerIdent(3:9-3:11),LowerIdent(3:12-3:16),Newline(1:1-1:1), +Int(4:3-4:4),Newline(1:1-1:1), +KwElse(5:1-5:5),Newline(1:1-1:1), +Int(6:3-6:4),EndOfFile(6:4-6:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "no_else")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/nested_if_unindented.md b/src/snapshots/old_syntax/nested_if_unindented.md new file mode 100644 index 0000000000..916a112881 --- /dev/null +++ b/src/snapshots/old_syntax/nested_if_unindented.md @@ -0,0 +1,110 @@ +# META +~~~ini +description=nested_if_unindented +type=expr +~~~ +# SOURCE +~~~roc +if""then-p else +if""then-p else.e +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.e** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**nested_if_unindented.md:2:16:2:18:** +```roc +if""then-p else.e +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `then` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `then` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +**INVALID IF BRANCH** +The `else` branch of this `if` expression could not be processed. + +The `else` branch must contain a valid expression. Check for syntax errors or missing values. + +Note: Every `if` expression in Roc must have an `else` branch, and both branches must have the same type. + +**TYPE MISMATCH** +This expression is used in an unexpected way: +**nested_if_unindented.md:1:3:1:5:** +```roc +if""then-p else +``` + ^^ + +It is of type: + _Str_ + +But you are trying to use it as: + _[True, False]_ + +# TOKENS +~~~zig +KwIf(1:1-1:3),StringStart(1:3-1:4),StringPart(1:4-1:4),StringEnd(1:4-1:5),LowerIdent(1:5-1:9),OpBinaryMinus(1:9-1:10),LowerIdent(1:10-1:11),KwElse(1:12-1:16),Newline(1:1-1:1), +KwIf(2:1-2:3),StringStart(2:3-2:4),StringPart(2:4-2:4),StringEnd(2:4-2:5),LowerIdent(2:5-2:9),OpBinaryMinus(2:9-2:10),LowerIdent(2:10-2:11),KwElse(2:12-2:16),NoSpaceDotLowerIdent(2:16-2:18),EndOfFile(2:18-2:18), +~~~ +# PARSE +~~~clojure +(e-if-then-else @1.1-2.18 + (e-string @1.3-1.5 + (e-string-part @1.4-1.4 (raw ""))) + (e-binop @1.5-1.16 (op "-") + (e-ident @1.5-1.9 (qaul "") (raw "then")) + (e-ident @1.10-1.11 (qaul "") (raw "p"))) + (e-if-then-else @2.1-2.18 + (e-string @2.3-2.5 + (e-string-part @2.4-2.4 (raw ""))) + (e-binop @2.5-2.16 (op "-") + (e-ident @2.5-2.9 (qaul "") (raw "then")) + (e-ident @2.10-2.11 (qaul "") (raw "p"))) + (e-malformed @2.16-2.18 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +if "" then - p + else + if "" then - p else +~~~ +# CANONICALIZE +~~~clojure +(e-if @1.1-2.18 (id 91) + (if-branches + (if-branch + (e-string @1.3-1.5 + (e-literal @1.4-1.4 (string ""))) + (e-binop @1.5-1.16 (op "sub") + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")))) + (if-branch + (e-string @2.3-2.5 + (e-literal @2.4-2.4 (string ""))) + (e-binop @2.5-2.16 (op "sub") + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))))) + (if-else + (e-runtime-error (tag "if_else_not_canonicalized")))) +~~~ +# TYPES +~~~clojure +(expr (id 91) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/nested_list_comment_in_closure_arg.md b/src/snapshots/old_syntax/nested_list_comment_in_closure_arg.md new file mode 100644 index 0000000000..a4a3760a49 --- /dev/null +++ b/src/snapshots/old_syntax/nested_list_comment_in_closure_arg.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=nested_list_comment_in_closure_arg +type=expr +~~~ +# SOURCE +~~~roc +\I[[ +O# +,i]]->i +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\I** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**nested_list_comment_in_closure_arg.md:1:1:1:3:** +```roc +\I[[ +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpenSquare(1:3-1:4),OpenSquare(1:4-1:5),Newline(1:1-1:1), +UpperIdent(2:1-2:2),Newline(2:3-2:3), +Comma(3:1-3:2),LowerIdent(3:2-3:3),CloseSquare(3:3-3:4),CloseSquare(3:4-3:5),OpArrow(3:5-3:7),LowerIdent(3:7-3:8),EndOfFile(3:8-3:8), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/nested_parens_in_pattern.md b/src/snapshots/old_syntax/nested_parens_in_pattern.md new file mode 100644 index 0000000000..1237652832 --- /dev/null +++ b/src/snapshots/old_syntax/nested_parens_in_pattern.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=nested_parens_in_pattern +type=expr +~~~ +# SOURCE +~~~roc +((J)x):i +i +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**nested_parens_in_pattern.md:1:6:1:8:** +```roc +((J)x):i +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),UpperIdent(1:3-1:4),CloseRound(1:4-1:5),LowerIdent(1:5-1:6),CloseRound(1:6-1:7),OpColon(1:7-1:8),LowerIdent(1:8-1:9),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.6-1.8 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/nested_tuples_annotation_terrible_perf.md b/src/snapshots/old_syntax/nested_tuples_annotation_terrible_perf.md new file mode 100644 index 0000000000..2c12e45818 --- /dev/null +++ b/src/snapshots/old_syntax/nested_tuples_annotation_terrible_perf.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=nested_tuples_annotation_terrible_perf fail +type=expr +~~~ +# SOURCE +~~~roc +.:(i,i,(i,(i,ii,(i,(i,(i,i,(i,(i,i,(i,(J(i,(i,(i,(i,(i,i,(i,(i,i,(i,(i,(i,(J[] +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.:** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**nested_tuples_annotation_terrible_perf.md:1:1:1:3:** +```roc +.:(i,i,(i,(i,ii,(i,(i,(i,i,(i,(i,i,(i,(J(i,(i,(i,(i,(i,i,(i,(i,i,(i,(i,(i,(J[] +``` +^^ + + +# TOKENS +~~~zig +Dot(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),Comma(1:5-1:6),LowerIdent(1:6-1:7),Comma(1:7-1:8),NoSpaceOpenRound(1:8-1:9),LowerIdent(1:9-1:10),Comma(1:10-1:11),NoSpaceOpenRound(1:11-1:12),LowerIdent(1:12-1:13),Comma(1:13-1:14),LowerIdent(1:14-1:16),Comma(1:16-1:17),NoSpaceOpenRound(1:17-1:18),LowerIdent(1:18-1:19),Comma(1:19-1:20),NoSpaceOpenRound(1:20-1:21),LowerIdent(1:21-1:22),Comma(1:22-1:23),NoSpaceOpenRound(1:23-1:24),LowerIdent(1:24-1:25),Comma(1:25-1:26),LowerIdent(1:26-1:27),Comma(1:27-1:28),NoSpaceOpenRound(1:28-1:29),LowerIdent(1:29-1:30),Comma(1:30-1:31),NoSpaceOpenRound(1:31-1:32),LowerIdent(1:32-1:33),Comma(1:33-1:34),LowerIdent(1:34-1:35),Comma(1:35-1:36),NoSpaceOpenRound(1:36-1:37),LowerIdent(1:37-1:38),Comma(1:38-1:39),NoSpaceOpenRound(1:39-1:40),UpperIdent(1:40-1:41),NoSpaceOpenRound(1:41-1:42),LowerIdent(1:42-1:43),Comma(1:43-1:44),NoSpaceOpenRound(1:44-1:45),LowerIdent(1:45-1:46),Comma(1:46-1:47),NoSpaceOpenRound(1:47-1:48),LowerIdent(1:48-1:49),Comma(1:49-1:50),NoSpaceOpenRound(1:50-1:51),LowerIdent(1:51-1:52),Comma(1:52-1:53),NoSpaceOpenRound(1:53-1:54),LowerIdent(1:54-1:55),Comma(1:55-1:56),LowerIdent(1:56-1:57),Comma(1:57-1:58),NoSpaceOpenRound(1:58-1:59),LowerIdent(1:59-1:60),Comma(1:60-1:61),NoSpaceOpenRound(1:61-1:62),LowerIdent(1:62-1:63),Comma(1:63-1:64),LowerIdent(1:64-1:65),Comma(1:65-1:66),NoSpaceOpenRound(1:66-1:67),LowerIdent(1:67-1:68),Comma(1:68-1:69),NoSpaceOpenRound(1:69-1:70),LowerIdent(1:70-1:71),Comma(1:71-1:72),NoSpaceOpenRound(1:72-1:73),LowerIdent(1:73-1:74),Comma(1:74-1:75),NoSpaceOpenRound(1:75-1:76),UpperIdent(1:76-1:77),OpenSquare(1:77-1:78),CloseSquare(1:78-1:79),EndOfFile(1:79-1:79), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/nested_when_comment_in_pat.md b/src/snapshots/old_syntax/nested_when_comment_in_pat.md new file mode 100644 index 0000000000..3a652f2a65 --- /dev/null +++ b/src/snapshots/old_syntax/nested_when_comment_in_pat.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=nested_when_comment_in_pat +type=expr +~~~ +# SOURCE +~~~roc +when 6 is +O# + B->when 6 is +1->O +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +UpperIdent(2:1-2:2),Newline(2:3-2:3), +UpperIdent(3:2-3:3),OpArrow(3:3-3:5),LowerIdent(3:5-3:9),Int(3:10-3:11),LowerIdent(3:12-3:14),Newline(1:1-1:1), +Int(4:1-4:2),OpArrow(4:2-4:4),UpperIdent(4:4-4:5),EndOfFile(4:5-4:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/nested_when_expect_binop_when.md b/src/snapshots/old_syntax/nested_when_expect_binop_when.md new file mode 100644 index 0000000000..7fd45ac0cb --- /dev/null +++ b/src/snapshots/old_syntax/nested_when_expect_binop_when.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=nested_when_expect_binop_when fail +type=expr +~~~ +# SOURCE +~~~roc +when s +is +z->expect!%when s +is z->q +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),OpArrow(3:2-3:4),LowerIdent(3:4-3:11),OpPercent(3:11-3:12),LowerIdent(3:12-3:16),LowerIdent(3:17-3:18),Newline(1:1-1:1), +LowerIdent(4:1-4:3),LowerIdent(4:4-4:5),OpArrow(4:5-4:7),LowerIdent(4:7-4:8),EndOfFile(4:8-4:8), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_equals.md b/src/snapshots/old_syntax/newline_after_equals.md new file mode 100644 index 0000000000..96dec153c6 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_equals.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=newline_after_equals +type=expr +~~~ +# SOURCE +~~~roc +x = + 5 + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),Newline(1:1-1:1), +Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_import_str_as.md b/src/snapshots/old_syntax/newline_after_import_str_as.md new file mode 100644 index 0000000000..47b1ab1979 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_import_str_as.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=newline_after_import_str_as +type=expr +~~~ +# SOURCE +~~~roc +import""as + das +A +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import"** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**newline_after_import_str_as.md:1:1:1:8:** +```roc +import""as +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),StringStart(1:7-1:8),StringPart(1:8-1:8),StringEnd(1:8-1:9),KwAs(1:9-1:11),Newline(1:1-1:1), +LowerIdent(2:2-2:5),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_mul.md b/src/snapshots/old_syntax/newline_after_mul.md new file mode 100644 index 0000000000..2dc1009f81 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_mul.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=newline_after_mul +type=expr +~~~ +# SOURCE +~~~roc +3 * + 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpStar(1:4-1:5),Newline(1:1-1:1), +Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "*") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 * + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "mul") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_opt_field.md b/src/snapshots/old_syntax/newline_after_opt_field.md new file mode 100644 index 0000000000..3e4eb17668 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_opt_field.md @@ -0,0 +1,49 @@ +# META +~~~ini +description=newline_after_opt_field +type=expr +~~~ +# SOURCE +~~~roc +{i? +p} +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize suffix_single_question expression + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),NoSpaceOpQuestion(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseCurly(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.3 + (statements + (e-question-suffix @1.2-1.4 + (e-ident @1.2-1.3 (qaul "") (raw "i"))) + (e-ident @2.1-2.2 (qaul "") (raw "p")))) +~~~ +# FORMATTED +~~~roc +{ + i? + p +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.3 (id 78) + (s-expr @1.2-2.2 + (e-runtime-error (tag "not_implemented"))) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_paren.md b/src/snapshots/old_syntax/newline_after_paren.md new file mode 100644 index 0000000000..36baac3980 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_paren.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=newline_after_paren +type=expr +~~~ +# SOURCE +~~~roc +( +A) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +UpperIdent(2:1-2:2),CloseRound(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.3 + (e-tag @2.1-2.2 (raw "A"))) +~~~ +# FORMATTED +~~~roc +( + A, +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.3 (id 75) + (elems + (e-tag @2.1-2.2 (ext-var 73) (name "A") (args "TODO")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "([A]*)")) +~~~ diff --git a/src/snapshots/old_syntax/newline_after_sub.md b/src/snapshots/old_syntax/newline_after_sub.md new file mode 100644 index 0000000000..9ba9db3956 --- /dev/null +++ b/src/snapshots/old_syntax/newline_after_sub.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=newline_after_sub +type=expr +~~~ +# SOURCE +~~~roc +3 - + 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpBinaryMinus(1:4-1:5),Newline(1:1-1:1), +Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "-") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 - + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "sub") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_and_spaces_before_less_than.md b/src/snapshots/old_syntax/newline_and_spaces_before_less_than.md new file mode 100644 index 0000000000..d22a2f5fac --- /dev/null +++ b/src/snapshots/old_syntax/newline_and_spaces_before_less_than.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=newline_and_spaces_before_less_than +type=expr +~~~ +# SOURCE +~~~roc +x = 1 + < 2 + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),Int(1:5-1:6),Newline(1:1-1:1), +OpLessThan(2:5-2:6),Int(2:7-2:8),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/newline_before_add.md b/src/snapshots/old_syntax/newline_before_add.md new file mode 100644 index 0000000000..d311799594 --- /dev/null +++ b/src/snapshots/old_syntax/newline_before_add.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=newline_before_add +type=expr +~~~ +# SOURCE +~~~roc +3 ++ 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpPlus(2:1-2:2),Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "+") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 + + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "add") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_before_and_after_implements_opaque.md b/src/snapshots/old_syntax/newline_before_and_after_implements_opaque.md new file mode 100644 index 0000000000..edb4c3b964 --- /dev/null +++ b/src/snapshots/old_syntax/newline_before_and_after_implements_opaque.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=newline_before_and_after_implements_opaque +type=expr +~~~ +# SOURCE +~~~roc +P:=W + implements + [] +t +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColonEqual(1:2-1:4),UpperIdent(1:4-1:5),Newline(1:1-1:1), +KwImplements(2:3-2:13),Newline(1:1-1:1), +OpenSquare(3:4-3:5),CloseSquare(3:5-3:6),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "P")) +~~~ +# FORMATTED +~~~roc +P +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "P") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[P]*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_before_import_curlies.md b/src/snapshots/old_syntax/newline_before_import_curlies.md new file mode 100644 index 0000000000..c946b9c66d --- /dev/null +++ b/src/snapshots/old_syntax/newline_before_import_curlies.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=newline_before_import_curlies +type=expr +~~~ +# SOURCE +~~~roc +import P + {} +y +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **import P** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**newline_before_import_curlies.md:1:1:1:9:** +```roc +import P +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwImport(1:1-1:7),UpperIdent(1:8-1:9),Newline(1:1-1:1), +OpenCurly(2:2-2:3),CloseCurly(2:3-2:4),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/newline_before_operator_with_defs.md b/src/snapshots/old_syntax/newline_before_operator_with_defs.md new file mode 100644 index 0000000000..a34dab02f9 --- /dev/null +++ b/src/snapshots/old_syntax/newline_before_operator_with_defs.md @@ -0,0 +1,53 @@ +# META +~~~ini +description=newline_before_operator_with_defs fail +type=expr +~~~ +# SOURCE +~~~roc +7 +==(Q:c 42) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**newline_before_operator_with_defs.md:2:10:2:11:** +```roc +==(Q:c 42) +``` + ^ + + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpEquals(2:1-2:3),NoSpaceOpenRound(2:3-2:4),UpperIdent(2:4-2:5),OpColon(2:5-2:6),LowerIdent(2:6-2:7),Int(2:8-2:10),CloseRound(2:10-2:11),EndOfFile(2:11-2:11), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.11 (op "==") + (e-int @1.1-1.2 (raw "7")) + (e-malformed @2.10-2.11 (reason "expected_expr_close_round_or_comma"))) +~~~ +# FORMATTED +~~~roc +7 + == +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.11 (op "eq") (id 76) + (e-int @1.1-1.2 (value "7")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_before_sub.md b/src/snapshots/old_syntax/newline_before_sub.md new file mode 100644 index 0000000000..bc34ef23b1 --- /dev/null +++ b/src/snapshots/old_syntax/newline_before_sub.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=newline_before_sub +type=expr +~~~ +# SOURCE +~~~roc +3 +- 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpBinaryMinus(2:1-2:2),Int(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.4 (op "-") + (e-int @1.1-1.2 (raw "3")) + (e-int @2.3-2.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 + - 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.4 (op "sub") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @2.3-2.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_in_type_alias_application.md b/src/snapshots/old_syntax/newline_in_type_alias_application.md new file mode 100644 index 0000000000..dee58a4898 --- /dev/null +++ b/src/snapshots/old_syntax/newline_in_type_alias_application.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=newline_in_type_alias_application +type=expr +~~~ +# SOURCE +~~~roc +A:A + A +p +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +UpperIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_in_type_def.md b/src/snapshots/old_syntax/newline_in_type_def.md new file mode 100644 index 0000000000..8d5585fa2e --- /dev/null +++ b/src/snapshots/old_syntax/newline_in_type_def.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=newline_in_type_def +type=expr +~~~ +# SOURCE +~~~roc +R +:D +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +OpColon(2:1-2:2),UpperIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "R")) +~~~ +# FORMATTED +~~~roc +R +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "R") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[R]*")) +~~~ diff --git a/src/snapshots/old_syntax/newline_inside_empty_list.md b/src/snapshots/old_syntax/newline_inside_empty_list.md new file mode 100644 index 0000000000..fe5d3f41c3 --- /dev/null +++ b/src/snapshots/old_syntax/newline_inside_empty_list.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=newline_inside_empty_list +type=expr +~~~ +# SOURCE +~~~roc +[ +] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Newline(1:1-1:1), +CloseSquare(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-list @1.1-2.2) +~~~ +# FORMATTED +~~~roc +[] +~~~ +# CANONICALIZE +~~~clojure +(e-empty_list @1.1-2.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "List(*)")) +~~~ diff --git a/src/snapshots/old_syntax/newline_singleton_list.md b/src/snapshots/old_syntax/newline_singleton_list.md new file mode 100644 index 0000000000..87087d2735 --- /dev/null +++ b/src/snapshots/old_syntax/newline_singleton_list.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=newline_singleton_list +type=expr +~~~ +# SOURCE +~~~roc +[ +1 +] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Newline(1:1-1:1), +Int(2:1-2:2),Newline(1:1-1:1), +CloseSquare(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-list @1.1-3.2 + (e-int @2.1-2.2 (raw "1"))) +~~~ +# FORMATTED +~~~roc +[ + 1, +] +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-3.2 (elem-var 73) (id 74) + (elems + (e-int @2.1-2.2 (value "1")))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "List(Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/no_newline_after_implements.md b/src/snapshots/old_syntax/no_newline_after_implements.md new file mode 100644 index 0000000000..c2934dcdf4 --- /dev/null +++ b/src/snapshots/old_syntax/no_newline_after_implements.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=no_newline_after_implements +type=expr +~~~ +# SOURCE +~~~roc +S implements d:J + m# +D +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),KwImplements(1:3-1:13),LowerIdent(1:14-1:15),OpColon(1:15-1:16),UpperIdent(1:16-1:17),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(2:4-2:4), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "S")) +~~~ +# FORMATTED +~~~roc +S +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "S") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[S]*")) +~~~ diff --git a/src/snapshots/old_syntax/not_double_parens.md b/src/snapshots/old_syntax/not_double_parens.md new file mode 100644 index 0000000000..0cd042de1e --- /dev/null +++ b/src/snapshots/old_syntax/not_double_parens.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=not_double_parens +type=expr +~~~ +# SOURCE +~~~roc +! +(( +E) +) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**not_double_parens.md:1:1:1:1:** +```roc +! +``` + + + +# TOKENS +~~~zig +OpBang(1:1-1:2),Newline(1:1-1:1), +OpenRound(2:1-2:2),NoSpaceOpenRound(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),CloseRound(3:2-3:3),Newline(1:1-1:1), +CloseRound(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/not_multiline_string.md b/src/snapshots/old_syntax/not_multiline_string.md new file mode 100644 index 0000000000..847138af28 --- /dev/null +++ b/src/snapshots/old_syntax/not_multiline_string.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=not_multiline_string +type=expr +~~~ +# SOURCE +~~~roc +!"""""" +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**not_multiline_string.md:1:1:1:5:** +```roc +!"""""" +``` +^^^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:5),MultilineStringEnd(1:5-1:8),EndOfFile(1:8-1:8), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/not_record_updater.md b/src/snapshots/old_syntax/not_record_updater.md new file mode 100644 index 0000000000..fb22c726b4 --- /dev/null +++ b/src/snapshots/old_syntax/not_record_updater.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=not_record_updater +type=expr +~~~ +# SOURCE +~~~roc +e +! +&s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `e` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +OpAmpersand(3:1-3:2),LowerIdent(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "e")) +~~~ +# FORMATTED +~~~roc +e +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/not_tag.md b/src/snapshots/old_syntax/not_tag.md new file mode 100644 index 0000000000..aff6bc0462 --- /dev/null +++ b/src/snapshots/old_syntax/not_tag.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=not_tag +type=expr +~~~ +# SOURCE +~~~roc +!(C +2) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**not_tag.md:1:1:1:3:** +```roc +!(C +``` +^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),NoSpaceOpenRound(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +Int(2:1-2:2),CloseRound(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/num_bang_amp_z_dot_t.md b/src/snapshots/old_syntax/num_bang_amp_z_dot_t.md new file mode 100644 index 0000000000..e98fe2aa6e --- /dev/null +++ b/src/snapshots/old_syntax/num_bang_amp_z_dot_t.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=num_bang_amp_z_dot_t +type=expr +~~~ +# SOURCE +~~~roc +4 +! +&z.t +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpBang(2:1-2:2),Newline(1:1-1:1), +OpAmpersand(3:1-3:2),LowerIdent(3:2-3:3),NoSpaceDotLowerIdent(3:3-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "4")) +~~~ +# FORMATTED +~~~roc +4 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "4") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/number_literal_suffixes.md b/src/snapshots/old_syntax/number_literal_suffixes.md new file mode 100644 index 0000000000..15836fd1cd --- /dev/null +++ b/src/snapshots/old_syntax/number_literal_suffixes.md @@ -0,0 +1,354 @@ +# META +~~~ini +description=number_literal_suffixes +type=expr +~~~ +# SOURCE +~~~roc +{ + u8: 123u8, + u16: 123u16, + u32: 123u32, + u64: 123u64, + u128: 123u128, + i8: 123i8, + i16: 123i16, + i32: 123i32, + i64: 123i64, + i128: 123i128, + dec: 123dec, + u8Neg: -123u8, + u16Neg: -123u16, + u32Neg: -123u32, + u64Neg: -123u64, + u128Neg: -123u128, + i8Neg: -123i8, + i16Neg: -123i16, + i32Neg: -123i32, + i64Neg: -123i64, + i128Neg: -123i128, + decNeg: -123dec, + u8Bin: 0b101u8, + u16Bin: 0b101u16, + u32Bin: 0b101u32, + u64Bin: 0b101u64, + u128Bin: 0b101u128, + i8Bin: 0b101i8, + i16Bin: 0b101i16, + i32Bin: 0b101i32, + i64Bin: 0b101i64, + i128Bin: 0b101i128, +} +~~~ +# PROBLEMS +**INVALID NUMBER** +This number literal is not valid: 123u8 + +**INVALID NUMBER** +This number literal is not valid: 123u16 + +**INVALID NUMBER** +This number literal is not valid: 123u32 + +**INVALID NUMBER** +This number literal is not valid: 123u64 + +**INVALID NUMBER** +This number literal is not valid: 123u128 + +**INVALID NUMBER** +This number literal is not valid: 123i8 + +**INVALID NUMBER** +This number literal is not valid: 123i16 + +**INVALID NUMBER** +This number literal is not valid: 123i32 + +**INVALID NUMBER** +This number literal is not valid: 123i64 + +**INVALID NUMBER** +This number literal is not valid: 123i128 + +**INVALID NUMBER** +This number literal is not valid: 123dec + +**INVALID NUMBER** +This number literal is not valid: -123u8 + +**INVALID NUMBER** +This number literal is not valid: -123u16 + +**INVALID NUMBER** +This number literal is not valid: -123u32 + +**INVALID NUMBER** +This number literal is not valid: -123u64 + +**INVALID NUMBER** +This number literal is not valid: -123u128 + +**INVALID NUMBER** +This number literal is not valid: -123i8 + +**INVALID NUMBER** +This number literal is not valid: -123i16 + +**INVALID NUMBER** +This number literal is not valid: -123i32 + +**INVALID NUMBER** +This number literal is not valid: -123i64 + +**INVALID NUMBER** +This number literal is not valid: -123i128 + +**INVALID NUMBER** +This number literal is not valid: -123dec + +**INVALID NUMBER** +This number literal is not valid: 0b101u8 + +**INVALID NUMBER** +This number literal is not valid: 0b101u16 + +**INVALID NUMBER** +This number literal is not valid: 0b101u32 + +**INVALID NUMBER** +This number literal is not valid: 0b101u64 + +**INVALID NUMBER** +This number literal is not valid: 0b101u128 + +**INVALID NUMBER** +This number literal is not valid: 0b101i8 + +**INVALID NUMBER** +This number literal is not valid: 0b101i16 + +**INVALID NUMBER** +This number literal is not valid: 0b101i32 + +**INVALID NUMBER** +This number literal is not valid: 0b101i64 + +**INVALID NUMBER** +This number literal is not valid: 0b101i128 + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:3-2:5),OpColon(2:5-2:6),Int(2:9-2:14),Comma(2:14-2:15),Newline(1:1-1:1), +LowerIdent(3:3-3:6),OpColon(3:6-3:7),Int(3:9-3:15),Comma(3:15-3:16),Newline(1:1-1:1), +LowerIdent(4:3-4:6),OpColon(4:6-4:7),Int(4:9-4:15),Comma(4:15-4:16),Newline(1:1-1:1), +LowerIdent(5:3-5:6),OpColon(5:6-5:7),Int(5:9-5:15),Comma(5:15-5:16),Newline(1:1-1:1), +LowerIdent(6:3-6:7),OpColon(6:7-6:8),Int(6:9-6:16),Comma(6:16-6:17),Newline(1:1-1:1), +LowerIdent(7:3-7:5),OpColon(7:5-7:6),Int(7:9-7:14),Comma(7:14-7:15),Newline(1:1-1:1), +LowerIdent(8:3-8:6),OpColon(8:6-8:7),Int(8:9-8:15),Comma(8:15-8:16),Newline(1:1-1:1), +LowerIdent(9:3-9:6),OpColon(9:6-9:7),Int(9:9-9:15),Comma(9:15-9:16),Newline(1:1-1:1), +LowerIdent(10:3-10:6),OpColon(10:6-10:7),Int(10:9-10:15),Comma(10:15-10:16),Newline(1:1-1:1), +LowerIdent(11:3-11:7),OpColon(11:7-11:8),Int(11:9-11:16),Comma(11:16-11:17),Newline(1:1-1:1), +LowerIdent(12:3-12:6),OpColon(12:6-12:7),Int(12:9-12:15),Comma(12:15-12:16),Newline(1:1-1:1), +LowerIdent(13:3-13:8),OpColon(13:8-13:9),Int(13:12-13:18),Comma(13:18-13:19),Newline(1:1-1:1), +LowerIdent(14:3-14:9),OpColon(14:9-14:10),Int(14:12-14:19),Comma(14:19-14:20),Newline(1:1-1:1), +LowerIdent(15:3-15:9),OpColon(15:9-15:10),Int(15:12-15:19),Comma(15:19-15:20),Newline(1:1-1:1), +LowerIdent(16:3-16:9),OpColon(16:9-16:10),Int(16:12-16:19),Comma(16:19-16:20),Newline(1:1-1:1), +LowerIdent(17:3-17:10),OpColon(17:10-17:11),Int(17:12-17:20),Comma(17:20-17:21),Newline(1:1-1:1), +LowerIdent(18:3-18:8),OpColon(18:8-18:9),Int(18:12-18:18),Comma(18:18-18:19),Newline(1:1-1:1), +LowerIdent(19:3-19:9),OpColon(19:9-19:10),Int(19:12-19:19),Comma(19:19-19:20),Newline(1:1-1:1), +LowerIdent(20:3-20:9),OpColon(20:9-20:10),Int(20:12-20:19),Comma(20:19-20:20),Newline(1:1-1:1), +LowerIdent(21:3-21:9),OpColon(21:9-21:10),Int(21:12-21:19),Comma(21:19-21:20),Newline(1:1-1:1), +LowerIdent(22:3-22:10),OpColon(22:10-22:11),Int(22:12-22:20),Comma(22:20-22:21),Newline(1:1-1:1), +LowerIdent(23:3-23:9),OpColon(23:9-23:10),Int(23:12-23:19),Comma(23:19-23:20),Newline(1:1-1:1), +LowerIdent(24:3-24:8),OpColon(24:8-24:9),Int(24:12-24:19),Comma(24:19-24:20),Newline(1:1-1:1), +LowerIdent(25:3-25:9),OpColon(25:9-25:10),Int(25:12-25:20),Comma(25:20-25:21),Newline(1:1-1:1), +LowerIdent(26:3-26:9),OpColon(26:9-26:10),Int(26:12-26:20),Comma(26:20-26:21),Newline(1:1-1:1), +LowerIdent(27:3-27:9),OpColon(27:9-27:10),Int(27:12-27:20),Comma(27:20-27:21),Newline(1:1-1:1), +LowerIdent(28:3-28:10),OpColon(28:10-28:11),Int(28:12-28:21),Comma(28:21-28:22),Newline(1:1-1:1), +LowerIdent(29:3-29:8),OpColon(29:8-29:9),Int(29:12-29:19),Comma(29:19-29:20),Newline(1:1-1:1), +LowerIdent(30:3-30:9),OpColon(30:9-30:10),Int(30:12-30:20),Comma(30:20-30:21),Newline(1:1-1:1), +LowerIdent(31:3-31:9),OpColon(31:9-31:10),Int(31:12-31:20),Comma(31:20-31:21),Newline(1:1-1:1), +LowerIdent(32:3-32:9),OpColon(32:9-32:10),Int(32:12-32:20),Comma(32:20-32:21),Newline(1:1-1:1), +LowerIdent(33:3-33:10),OpColon(33:10-33:11),Int(33:12-33:21),Comma(33:21-33:22),Newline(1:1-1:1), +CloseCurly(34:1-34:2),EndOfFile(34:2-34:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-34.2 + (field (field "u8") (optional false) + (e-int @2.9-2.14 (raw "123u8"))) + (field (field "u16") (optional false) + (e-int @3.9-3.15 (raw "123u16"))) + (field (field "u32") (optional false) + (e-int @4.9-4.15 (raw "123u32"))) + (field (field "u64") (optional false) + (e-int @5.9-5.15 (raw "123u64"))) + (field (field "u128") (optional false) + (e-int @6.9-6.16 (raw "123u128"))) + (field (field "i8") (optional false) + (e-int @7.9-7.14 (raw "123i8"))) + (field (field "i16") (optional false) + (e-int @8.9-8.15 (raw "123i16"))) + (field (field "i32") (optional false) + (e-int @9.9-9.15 (raw "123i32"))) + (field (field "i64") (optional false) + (e-int @10.9-10.15 (raw "123i64"))) + (field (field "i128") (optional false) + (e-int @11.9-11.16 (raw "123i128"))) + (field (field "dec") (optional false) + (e-int @12.9-12.15 (raw "123dec"))) + (field (field "u8Neg") (optional false) + (e-int @13.12-13.18 (raw "-123u8"))) + (field (field "u16Neg") (optional false) + (e-int @14.12-14.19 (raw "-123u16"))) + (field (field "u32Neg") (optional false) + (e-int @15.12-15.19 (raw "-123u32"))) + (field (field "u64Neg") (optional false) + (e-int @16.12-16.19 (raw "-123u64"))) + (field (field "u128Neg") (optional false) + (e-int @17.12-17.20 (raw "-123u128"))) + (field (field "i8Neg") (optional false) + (e-int @18.12-18.18 (raw "-123i8"))) + (field (field "i16Neg") (optional false) + (e-int @19.12-19.19 (raw "-123i16"))) + (field (field "i32Neg") (optional false) + (e-int @20.12-20.19 (raw "-123i32"))) + (field (field "i64Neg") (optional false) + (e-int @21.12-21.19 (raw "-123i64"))) + (field (field "i128Neg") (optional false) + (e-int @22.12-22.20 (raw "-123i128"))) + (field (field "decNeg") (optional false) + (e-int @23.12-23.19 (raw "-123dec"))) + (field (field "u8Bin") (optional false) + (e-int @24.12-24.19 (raw "0b101u8"))) + (field (field "u16Bin") (optional false) + (e-int @25.12-25.20 (raw "0b101u16"))) + (field (field "u32Bin") (optional false) + (e-int @26.12-26.20 (raw "0b101u32"))) + (field (field "u64Bin") (optional false) + (e-int @27.12-27.20 (raw "0b101u64"))) + (field (field "u128Bin") (optional false) + (e-int @28.12-28.21 (raw "0b101u128"))) + (field (field "i8Bin") (optional false) + (e-int @29.12-29.19 (raw "0b101i8"))) + (field (field "i16Bin") (optional false) + (e-int @30.12-30.20 (raw "0b101i16"))) + (field (field "i32Bin") (optional false) + (e-int @31.12-31.20 (raw "0b101i32"))) + (field (field "i64Bin") (optional false) + (e-int @32.12-32.20 (raw "0b101i64"))) + (field (field "i128Bin") (optional false) + (e-int @33.12-33.21 (raw "0b101i128")))) +~~~ +# FORMATTED +~~~roc +{ + u8: 123u8, + u16: 123u16, + u32: 123u32, + u64: 123u64, + u128: 123u128, + i8: 123i8, + i16: 123i16, + i32: 123i32, + i64: 123i64, + i128: 123i128, + dec: 123dec, + u8Neg: -123u8, + u16Neg: -123u16, + u32Neg: -123u32, + u64Neg: -123u64, + u128Neg: -123u128, + i8Neg: -123i8, + i16Neg: -123i16, + i32Neg: -123i32, + i64Neg: -123i64, + i128Neg: -123i128, + decNeg: -123dec, + u8Bin: 0b101u8, + u16Bin: 0b101u16, + u32Bin: 0b101u32, + u64Bin: 0b101u64, + u128Bin: 0b101u128, + i8Bin: 0b101i8, + i16Bin: 0b101i16, + i32Bin: 0b101i32, + i64Bin: 0b101i64, + i128Bin: 0b101i128, +} +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-34.2 (ext-var 169) (id 170) + (fields + (field (name "u8") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u16") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u32") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u64") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u128") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i8") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i16") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i32") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i64") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i128") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "dec") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u8Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u16Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u32Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u64Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u128Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i8Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i16Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i32Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i64Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i128Neg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "decNeg") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u8Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u16Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u32Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u64Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "u128Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i8Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i16Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i32Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i64Bin") + (e-runtime-error (tag "invalid_num_literal"))) + (field (name "i128Bin") + (e-runtime-error (tag "invalid_num_literal"))))) +~~~ +# TYPES +~~~clojure +(expr (id 170) (type "{ u8: Error, u16: Error, u32: Error, u64: Error, u128: Error, i8: Error, i16: Error, i32: Error, i64: Error, i128: Error, dec: Error, u8Neg: Error, u16Neg: Error, u32Neg: Error, u64Neg: Error, u128Neg: Error, i8Neg: Error, i16Neg: Error, i32Neg: Error, i64Neg: Error, i128Neg: Error, decNeg: Error, u8Bin: Error, u16Bin: Error, u32Bin: Error, u64Bin: Error, u128Bin: Error, i8Bin: Error, i16Bin: Error, i32Bin: Error, i64Bin: Error, i128Bin: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/one_char_string.md b/src/snapshots/old_syntax/one_char_string.md new file mode 100644 index 0000000000..2f89bccd13 --- /dev/null +++ b/src/snapshots/old_syntax/one_char_string.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=one_char_string +type=expr +~~~ +# SOURCE +~~~roc +"x" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:3),StringEnd(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.4 + (e-string-part @1.2-1.3 (raw "x"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.4 (id 74) + (e-literal @1.2-1.3 (string "x"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/one_def.md b/src/snapshots/old_syntax/one_def.md new file mode 100644 index 0000000000..8c63f79b4c --- /dev/null +++ b/src/snapshots/old_syntax/one_def.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=one_def +type=expr +~~~ +# SOURCE +~~~roc +# leading comment +x=5 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** leading comment +x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**one_def.md:1:2:2:2:** +```roc +# leading comment +x=5 +``` + + +# TOKENS +~~~zig +Newline(1:2-1:18), +LowerIdent(2:1-2:2),OpAssign(2:2-2:3),Int(2:3-2:4),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/one_minus_two.md b/src/snapshots/old_syntax/one_minus_two.md new file mode 100644 index 0000000000..0d3ac08a92 --- /dev/null +++ b/src/snapshots/old_syntax/one_minus_two.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=one_minus_two +type=expr +~~~ +# SOURCE +~~~roc +1-2 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpBinaryMinus(1:2-1:3),Int(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.4 (op "-") + (e-int @1.1-1.2 (raw "1")) + (e-int @1.3-1.4 (raw "2"))) +~~~ +# FORMATTED +~~~roc +1 - 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.4 (op "sub") (id 75) + (e-int @1.1-1.2 (value "1")) + (e-int @1.3-1.4 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/one_plus_two.md b/src/snapshots/old_syntax/one_plus_two.md new file mode 100644 index 0000000000..bc615638e7 --- /dev/null +++ b/src/snapshots/old_syntax/one_plus_two.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=one_plus_two +type=expr +~~~ +# SOURCE +~~~roc +1+2 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpPlus(1:2-1:3),Int(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.4 (op "+") + (e-int @1.1-1.2 (raw "1")) + (e-int @1.3-1.4 (raw "2"))) +~~~ +# FORMATTED +~~~roc +1 + 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.4 (op "add") (id 75) + (e-int @1.1-1.2 (value "1")) + (e-int @1.3-1.4 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/one_spaced_def.md b/src/snapshots/old_syntax/one_spaced_def.md new file mode 100644 index 0000000000..475e1694a9 --- /dev/null +++ b/src/snapshots/old_syntax/one_spaced_def.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=one_spaced_def +type=expr +~~~ +# SOURCE +~~~roc +# leading comment +x = 5 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** leading comment +x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**one_spaced_def.md:1:2:2:2:** +```roc +# leading comment +x = 5 +``` + + +# TOKENS +~~~zig +Newline(1:2-1:18), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/oom_repro.md b/src/snapshots/old_syntax/oom_repro.md new file mode 100644 index 0000000000..16d5f6fa2a --- /dev/null +++ b/src/snapshots/old_syntax/oom_repro.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=oom_repro fail +type=expr +~~~ +# SOURCE +~~~roc +K:bMM,( +A0,AectAfects,( +A0,AenAA1M,( +A0,Ae,( +A0bMprovi0,A=>A1,MA,M,e,M,A ,A ,s,( +AbMM,(A0 +,Ae,( +A0bMprovi0,A=>A1,MA,M,e,M,e8,ActAfects,( +A0,AenAA1M,( +A0,Ae,( +A0bMprovi0,A=>A1,MA,M,e,M,A ,A ,s,( +AbMM,(A0 +,Ae,( +A0bMprovi0,A=>A1,MA,M,e,M,e8,A)WM,ulsee,M,e8,A)db1,MA,M,e,M,e8,A)WM,ulsee,M,e8,A)dbgMA,MO,e,M,e4,A)WA)WenA1)WM,ulsee,M,e8,A)db1,MA,M,e,M,e8,A)WM,ulsee,M,e8,A)dbgMA,MO,e,M,e4,A)WA)WenA1,A)W +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:6),Comma(1:6-1:7),NoSpaceOpenRound(1:7-1:8),Newline(1:1-1:1), +UpperIdent(2:1-2:3),Comma(2:3-2:4),UpperIdent(2:4-2:14),Comma(2:14-2:15),NoSpaceOpenRound(2:15-2:16),Newline(1:1-1:1), +UpperIdent(3:1-3:3),Comma(3:3-3:4),UpperIdent(3:4-3:11),Comma(3:11-3:12),NoSpaceOpenRound(3:12-3:13),Newline(1:1-1:1), +UpperIdent(4:1-4:3),Comma(4:3-4:4),UpperIdent(4:4-4:6),Comma(4:6-4:7),NoSpaceOpenRound(4:7-4:8),Newline(1:1-1:1), +UpperIdent(5:1-5:11),Comma(5:11-5:12),UpperIdent(5:12-5:13),OpFatArrow(5:13-5:15),UpperIdent(5:15-5:17),Comma(5:17-5:18),UpperIdent(5:18-5:20),Comma(5:20-5:21),UpperIdent(5:21-5:22),Comma(5:22-5:23),LowerIdent(5:23-5:24),Comma(5:24-5:25),UpperIdent(5:25-5:26),Comma(5:26-5:27),UpperIdent(5:27-5:28),Comma(5:29-5:30),UpperIdent(5:30-5:31),Comma(5:32-5:33),LowerIdent(5:33-5:34),Comma(5:34-5:35),NoSpaceOpenRound(5:35-5:36),Newline(1:1-1:1), +UpperIdent(6:1-6:5),Comma(6:5-6:6),NoSpaceOpenRound(6:6-6:7),UpperIdent(6:7-6:9),Newline(1:1-1:1), +Comma(7:1-7:2),UpperIdent(7:2-7:4),Comma(7:4-7:5),NoSpaceOpenRound(7:5-7:6),Newline(1:1-1:1), +UpperIdent(8:1-8:11),Comma(8:11-8:12),UpperIdent(8:12-8:13),OpFatArrow(8:13-8:15),UpperIdent(8:15-8:17),Comma(8:17-8:18),UpperIdent(8:18-8:20),Comma(8:20-8:21),UpperIdent(8:21-8:22),Comma(8:22-8:23),LowerIdent(8:23-8:24),Comma(8:24-8:25),UpperIdent(8:25-8:26),Comma(8:26-8:27),LowerIdent(8:27-8:29),Comma(8:29-8:30),UpperIdent(8:30-8:39),Comma(8:39-8:40),NoSpaceOpenRound(8:40-8:41),Newline(1:1-1:1), +UpperIdent(9:1-9:3),Comma(9:3-9:4),UpperIdent(9:4-9:11),Comma(9:11-9:12),NoSpaceOpenRound(9:12-9:13),Newline(1:1-1:1), +UpperIdent(10:1-10:3),Comma(10:3-10:4),UpperIdent(10:4-10:6),Comma(10:6-10:7),NoSpaceOpenRound(10:7-10:8),Newline(1:1-1:1), +UpperIdent(11:1-11:11),Comma(11:11-11:12),UpperIdent(11:12-11:13),OpFatArrow(11:13-11:15),UpperIdent(11:15-11:17),Comma(11:17-11:18),UpperIdent(11:18-11:20),Comma(11:20-11:21),UpperIdent(11:21-11:22),Comma(11:22-11:23),LowerIdent(11:23-11:24),Comma(11:24-11:25),UpperIdent(11:25-11:26),Comma(11:26-11:27),UpperIdent(11:27-11:28),Comma(11:29-11:30),UpperIdent(11:30-11:31),Comma(11:32-11:33),LowerIdent(11:33-11:34),Comma(11:34-11:35),NoSpaceOpenRound(11:35-11:36),Newline(1:1-1:1), +UpperIdent(12:1-12:5),Comma(12:5-12:6),NoSpaceOpenRound(12:6-12:7),UpperIdent(12:7-12:9),Newline(1:1-1:1), +Comma(13:1-13:2),UpperIdent(13:2-13:4),Comma(13:4-13:5),NoSpaceOpenRound(13:5-13:6),Newline(1:1-1:1), +UpperIdent(14:1-14:11),Comma(14:11-14:12),UpperIdent(14:12-14:13),OpFatArrow(14:13-14:15),UpperIdent(14:15-14:17),Comma(14:17-14:18),UpperIdent(14:18-14:20),Comma(14:20-14:21),UpperIdent(14:21-14:22),Comma(14:22-14:23),LowerIdent(14:23-14:24),Comma(14:24-14:25),UpperIdent(14:25-14:26),Comma(14:26-14:27),LowerIdent(14:27-14:29),Comma(14:29-14:30),UpperIdent(14:30-14:31),CloseRound(14:31-14:32),UpperIdent(14:32-14:34),Comma(14:34-14:35),LowerIdent(14:35-14:40),Comma(14:40-14:41),UpperIdent(14:41-14:42),Comma(14:42-14:43),LowerIdent(14:43-14:45),Comma(14:45-14:46),UpperIdent(14:46-14:47),CloseRound(14:47-14:48),LowerIdent(14:48-14:51),Comma(14:51-14:52),UpperIdent(14:52-14:54),Comma(14:54-14:55),UpperIdent(14:55-14:56),Comma(14:56-14:57),LowerIdent(14:57-14:58),Comma(14:58-14:59),UpperIdent(14:59-14:60),Comma(14:60-14:61),LowerIdent(14:61-14:63),Comma(14:63-14:64),UpperIdent(14:64-14:65),CloseRound(14:65-14:66),UpperIdent(14:66-14:68),Comma(14:68-14:69),LowerIdent(14:69-14:74),Comma(14:74-14:75),UpperIdent(14:75-14:76),Comma(14:76-14:77),LowerIdent(14:77-14:79),Comma(14:79-14:80),UpperIdent(14:80-14:81),CloseRound(14:81-14:82),LowerIdent(14:82-14:87),Comma(14:87-14:88),UpperIdent(14:88-14:90),Comma(14:90-14:91),LowerIdent(14:91-14:92),Comma(14:92-14:93),UpperIdent(14:93-14:94),Comma(14:94-14:95),LowerIdent(14:95-14:97),Comma(14:97-14:98),UpperIdent(14:98-14:99),CloseRound(14:99-14:100),UpperIdent(14:100-14:102),CloseRound(14:102-14:103),UpperIdent(14:103-14:108),CloseRound(14:108-14:109),UpperIdent(14:109-14:111),Comma(14:111-14:112),LowerIdent(14:112-14:117),Comma(14:117-14:118),UpperIdent(14:118-14:119),Comma(14:119-14:120),LowerIdent(14:120-14:122),Comma(14:122-14:123),UpperIdent(14:123-14:124),CloseRound(14:124-14:125),LowerIdent(14:125-14:128),Comma(14:128-14:129),UpperIdent(14:129-14:131),Comma(14:131-14:132),UpperIdent(14:132-14:133),Comma(14:133-14:134),LowerIdent(14:134-14:135),Comma(14:135-14:136),UpperIdent(14:136-14:137),Comma(14:137-14:138),LowerIdent(14:138-14:140),Comma(14:140-14:141),UpperIdent(14:141-14:142),CloseRound(14:142-14:143),UpperIdent(14:143-14:145),Comma(14:145-14:146),LowerIdent(14:146-14:151),Comma(14:151-14:152),UpperIdent(14:152-14:153),Comma(14:153-14:154),LowerIdent(14:154-14:156),Comma(14:156-14:157),UpperIdent(14:157-14:158),CloseRound(14:158-14:159),LowerIdent(14:159-14:164),Comma(14:164-14:165),UpperIdent(14:165-14:167),Comma(14:167-14:168),LowerIdent(14:168-14:169),Comma(14:169-14:170),UpperIdent(14:170-14:171),Comma(14:171-14:172),LowerIdent(14:172-14:174),Comma(14:174-14:175),UpperIdent(14:175-14:176),CloseRound(14:176-14:177),UpperIdent(14:177-14:179),CloseRound(14:179-14:180),UpperIdent(14:180-14:185),Comma(14:185-14:186),UpperIdent(14:186-14:187),CloseRound(14:187-14:188),UpperIdent(14:188-14:189),EndOfFile(14:189-14:189), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "K")) +~~~ +# FORMATTED +~~~roc +K +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "K") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[K]*")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_comment_after_head.md b/src/snapshots/old_syntax/opaque_comment_after_head.md new file mode 100644 index 0000000000..62c6175fd4 --- /dev/null +++ b/src/snapshots/old_syntax/opaque_comment_after_head.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=opaque_comment_after_head +type=expr +~~~ +# SOURCE +~~~roc +A# + p:=a +A +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:3-1:3), +LowerIdent(2:2-2:3),OpColonEqual(2:3-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_destructure_first_item_in_body.md b/src/snapshots/old_syntax/opaque_destructure_first_item_in_body.md new file mode 100644 index 0000000000..e370641ad3 --- /dev/null +++ b/src/snapshots/old_syntax/opaque_destructure_first_item_in_body.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=opaque_destructure_first_item_in_body +type=expr +~~~ +# SOURCE +~~~roc +@Thunk it = id (@A {}) +it {} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **@Thunk it** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**opaque_destructure_first_item_in_body.md:1:1:1:10:** +```roc +@Thunk it = id (@A {}) +``` +^^^^^^^^^ + + +# TOKENS +~~~zig +OpaqueName(1:1-1:7),LowerIdent(1:8-1:10),OpAssign(1:11-1:12),LowerIdent(1:13-1:15),OpenRound(1:16-1:17),OpaqueName(1:17-1:19),OpenCurly(1:20-1:21),CloseCurly(1:21-1:22),CloseRound(1:22-1:23),Newline(1:1-1:1), +LowerIdent(2:1-2:3),OpenCurly(2:4-2:5),CloseCurly(2:5-2:6),EndOfFile(2:6-2:6), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.10 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/opaque_has_abilities.md b/src/snapshots/old_syntax/opaque_has_abilities.md new file mode 100644 index 0000000000..c47bca5a8e --- /dev/null +++ b/src/snapshots/old_syntax/opaque_has_abilities.md @@ -0,0 +1,75 @@ +# META +~~~ini +description=opaque_has_abilities +type=expr +~~~ +# SOURCE +~~~roc +A := U8 implements [Eq, Hash] + +A := a where a implements Other implements [Eq, Hash] + +A := a where a implements Other + implements [Eq, Hash] + +A := U8 implements [Eq {eq}, Hash {hash}] + +A := U8 implements [Eq {eq, eq1}] + +A := U8 implements [Eq {eq, eq1}, Hash] + +A := U8 implements [Hash, Eq {eq, eq1}] + +A := U8 implements [] + +A := a where a implements Other + implements [Eq {eq}, Hash {hash}] + +A := U8 implements [Eq {}] + +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColonEqual(1:3-1:5),UpperIdent(1:6-1:8),KwImplements(1:9-1:19),OpenSquare(1:20-1:21),UpperIdent(1:21-1:23),Comma(1:23-1:24),UpperIdent(1:25-1:29),CloseSquare(1:29-1:30),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(3:1-3:2),OpColonEqual(3:3-3:5),LowerIdent(3:6-3:7),KwWhere(3:8-3:13),LowerIdent(3:14-3:15),KwImplements(3:16-3:26),UpperIdent(3:27-3:32),KwImplements(3:33-3:43),OpenSquare(3:44-3:45),UpperIdent(3:45-3:47),Comma(3:47-3:48),UpperIdent(3:49-3:53),CloseSquare(3:53-3:54),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(5:1-5:2),OpColonEqual(5:3-5:5),LowerIdent(5:6-5:7),KwWhere(5:8-5:13),LowerIdent(5:14-5:15),KwImplements(5:16-5:26),UpperIdent(5:27-5:32),Newline(1:1-1:1), +KwImplements(6:6-6:16),OpenSquare(6:17-6:18),UpperIdent(6:18-6:20),Comma(6:20-6:21),UpperIdent(6:22-6:26),CloseSquare(6:26-6:27),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(8:1-8:2),OpColonEqual(8:3-8:5),UpperIdent(8:6-8:8),KwImplements(8:9-8:19),OpenSquare(8:20-8:21),UpperIdent(8:21-8:23),OpenCurly(8:24-8:25),LowerIdent(8:25-8:27),CloseCurly(8:27-8:28),Comma(8:28-8:29),UpperIdent(8:30-8:34),OpenCurly(8:35-8:36),LowerIdent(8:36-8:40),CloseCurly(8:40-8:41),CloseSquare(8:41-8:42),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(10:1-10:2),OpColonEqual(10:3-10:5),UpperIdent(10:6-10:8),KwImplements(10:9-10:19),OpenSquare(10:20-10:21),UpperIdent(10:21-10:23),OpenCurly(10:24-10:25),LowerIdent(10:25-10:27),Comma(10:27-10:28),LowerIdent(10:29-10:32),CloseCurly(10:32-10:33),CloseSquare(10:33-10:34),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(12:1-12:2),OpColonEqual(12:3-12:5),UpperIdent(12:6-12:8),KwImplements(12:9-12:19),OpenSquare(12:20-12:21),UpperIdent(12:21-12:23),OpenCurly(12:24-12:25),LowerIdent(12:25-12:27),Comma(12:27-12:28),LowerIdent(12:29-12:32),CloseCurly(12:32-12:33),Comma(12:33-12:34),UpperIdent(12:35-12:39),CloseSquare(12:39-12:40),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(14:1-14:2),OpColonEqual(14:3-14:5),UpperIdent(14:6-14:8),KwImplements(14:9-14:19),OpenSquare(14:20-14:21),UpperIdent(14:21-14:25),Comma(14:25-14:26),UpperIdent(14:27-14:29),OpenCurly(14:30-14:31),LowerIdent(14:31-14:33),Comma(14:33-14:34),LowerIdent(14:35-14:38),CloseCurly(14:38-14:39),CloseSquare(14:39-14:40),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(16:1-16:2),OpColonEqual(16:3-16:5),UpperIdent(16:6-16:8),KwImplements(16:9-16:19),OpenSquare(16:20-16:21),CloseSquare(16:21-16:22),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(18:1-18:2),OpColonEqual(18:3-18:5),LowerIdent(18:6-18:7),KwWhere(18:8-18:13),LowerIdent(18:14-18:15),KwImplements(18:16-18:26),UpperIdent(18:27-18:32),Newline(1:1-1:1), +KwImplements(19:6-19:16),OpenSquare(19:17-19:18),UpperIdent(19:18-19:20),OpenCurly(19:21-19:22),LowerIdent(19:22-19:24),CloseCurly(19:24-19:25),Comma(19:25-19:26),UpperIdent(19:27-19:31),OpenCurly(19:32-19:33),LowerIdent(19:33-19:37),CloseCurly(19:37-19:38),CloseSquare(19:38-19:39),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(21:1-21:2),OpColonEqual(21:3-21:5),UpperIdent(21:6-21:8),KwImplements(21:9-21:19),OpenSquare(21:20-21:21),UpperIdent(21:21-21:23),OpenCurly(21:24-21:25),CloseCurly(21:25-21:26),CloseSquare(21:26-21:27),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(23:1-23:2),EndOfFile(23:2-23:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_in_ann_apply_arg.md b/src/snapshots/old_syntax/opaque_in_ann_apply_arg.md new file mode 100644 index 0000000000..d71fc74e0d --- /dev/null +++ b/src/snapshots/old_syntax/opaque_in_ann_apply_arg.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=opaque_in_ann_apply_arg malformed +type=expr +~~~ +# SOURCE +~~~roc +B@A:w +# +@A=e +i +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpaqueName(1:2-1:4),OpColon(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:1-1:1), +Newline(2:2-2:2), +OpaqueName(3:1-3:3),OpAssign(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "B")) +~~~ +# FORMATTED +~~~roc +B +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "B") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[B]*")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_reference_expr.md b/src/snapshots/old_syntax/opaque_reference_expr.md new file mode 100644 index 0000000000..74cb0bc449 --- /dev/null +++ b/src/snapshots/old_syntax/opaque_reference_expr.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=opaque_reference_expr +type=expr +~~~ +# SOURCE +~~~roc +@Age +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **@Age** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**opaque_reference_expr.md:1:1:1:5:** +```roc +@Age +``` +^^^^ + + +# TOKENS +~~~zig +OpaqueName(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/opaque_reference_expr_with_arguments.md b/src/snapshots/old_syntax/opaque_reference_expr_with_arguments.md new file mode 100644 index 0000000000..97f0a63137 --- /dev/null +++ b/src/snapshots/old_syntax/opaque_reference_expr_with_arguments.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=opaque_reference_expr_with_arguments +type=expr +~~~ +# SOURCE +~~~roc +@Age m n +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **@Age m** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**opaque_reference_expr_with_arguments.md:1:1:1:7:** +```roc +@Age m n +``` +^^^^^^ + + +# TOKENS +~~~zig +OpaqueName(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.7 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/opaque_reference_pattern.md b/src/snapshots/old_syntax/opaque_reference_pattern.md new file mode 100644 index 0000000000..f4bd7831a1 --- /dev/null +++ b/src/snapshots/old_syntax/opaque_reference_pattern.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=opaque_reference_pattern +type=expr +~~~ +# SOURCE +~~~roc +when n is + @Age -> 1 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +OpaqueName(2:3-2:7),OpArrow(2:8-2:10),Int(2:11-2:12),EndOfFile(2:12-2:12), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_reference_pattern_with_arguments.md b/src/snapshots/old_syntax/opaque_reference_pattern_with_arguments.md new file mode 100644 index 0000000000..ef5ea8bd2b --- /dev/null +++ b/src/snapshots/old_syntax/opaque_reference_pattern_with_arguments.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=opaque_reference_pattern_with_arguments +type=expr +~~~ +# SOURCE +~~~roc +when n is + @Add n m -> n + m +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +OpaqueName(2:3-2:7),LowerIdent(2:8-2:9),LowerIdent(2:10-2:11),OpArrow(2:12-2:14),LowerIdent(2:15-2:16),OpPlus(2:17-2:18),LowerIdent(2:19-2:20),EndOfFile(2:20-2:20), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/opaque_type_def_with_newline.md b/src/snapshots/old_syntax/opaque_type_def_with_newline.md new file mode 100644 index 0000000000..baf29f4dab --- /dev/null +++ b/src/snapshots/old_syntax/opaque_type_def_with_newline.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=opaque_type_def_with_newline fail +type=expr +~~~ +# SOURCE +~~~roc +a:e +Na:= + e e0 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:1-1:1), +UpperIdent(2:1-2:3),OpColonEqual(2:3-2:5),Newline(1:1-1:1), +LowerIdent(3:2-3:3),LowerIdent(3:4-3:6),EndOfFile(3:6-3:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ops_with_newlines.md b/src/snapshots/old_syntax/ops_with_newlines.md new file mode 100644 index 0000000000..f98afbb7bd --- /dev/null +++ b/src/snapshots/old_syntax/ops_with_newlines.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=ops_with_newlines +type=expr +~~~ +# SOURCE +~~~roc +3 ++ + + 4 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),Newline(1:1-1:1), +OpPlus(2:1-2:2),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:3-4:4),EndOfFile(4:4-4:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-4.4 (op "+") + (e-int @1.1-1.2 (raw "3")) + (e-int @4.3-4.4 (raw "4"))) +~~~ +# FORMATTED +~~~roc +3 + + + + 4 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-4.4 (op "add") (id 75) + (e-int @1.1-1.2 (value "3")) + (e-int @4.3-4.4 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/opt_field_newline_in_pat.md b/src/snapshots/old_syntax/opt_field_newline_in_pat.md new file mode 100644 index 0000000000..6ac71524b4 --- /dev/null +++ b/src/snapshots/old_syntax/opt_field_newline_in_pat.md @@ -0,0 +1,52 @@ +# META +~~~ini +description=opt_field_newline_in_pat +type=expr +~~~ +# SOURCE +~~~roc +{i +? +Y}=p +Q +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**NOT IMPLEMENTED** +This feature is not yet implemented: binop + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:1-1:1), +OpQuestion(2:1-2:2),Newline(1:1-1:1), +UpperIdent(3:1-3:2),CloseCurly(3:2-3:3),OpAssign(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-3.3 + (statements + (e-binop @1.2-3.3 (op "?") + (e-ident @1.2-1.3 (qaul "") (raw "i")) + (e-tag @3.1-3.2 (raw "Y"))))) +~~~ +# FORMATTED +~~~roc +{ + i + ? + Y +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-3.3 (id 79) + (e-runtime-error (tag "not_implemented"))) +~~~ +# TYPES +~~~clojure +(expr (id 79) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/opt_field_newline_in_ty.md b/src/snapshots/old_syntax/opt_field_newline_in_ty.md new file mode 100644 index 0000000000..546e71cbe4 --- /dev/null +++ b/src/snapshots/old_syntax/opt_field_newline_in_ty.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=opt_field_newline_in_ty +type=expr +~~~ +# SOURCE +~~~roc +0:{i +?d} +O +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),OpenCurly(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:1-1:1), +OpQuestion(2:1-2:2),LowerIdent(2:2-2:3),CloseCurly(2:3-2:4),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "0")) +~~~ +# FORMATTED +~~~roc +0 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "0") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/opt_record_field_pat_assign.md b/src/snapshots/old_syntax/opt_record_field_pat_assign.md new file mode 100644 index 0000000000..f4392a2cf7 --- /dev/null +++ b/src/snapshots/old_syntax/opt_record_field_pat_assign.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=opt_record_field_pat_assign +type=expr +~~~ +# SOURCE +~~~roc +{e?f +4}=f + e +r +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize suffix_single_question expression + +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),NoSpaceOpQuestion(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:1-1:1), +Int(2:1-2:2),CloseCurly(2:2-2:3),OpAssign(2:3-2:4),LowerIdent(2:4-2:5),Newline(1:1-1:1), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.3 + (statements + (e-question-suffix @1.2-1.4 + (e-ident @1.2-1.3 (qaul "") (raw "e"))) + (e-ident @1.4-1.5 (qaul "") (raw "f")) + (e-int @2.1-2.2 (raw "4")))) +~~~ +# FORMATTED +~~~roc +{ + e? + f + 4 +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.3 (id 80) + (s-expr @1.2-1.5 + (e-runtime-error (tag "not_implemented"))) + (s-expr @1.4-2.2 + (e-runtime-error (tag "ident_not_in_scope"))) + (e-int @2.1-2.2 (value "4"))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/outdented_app_with_record.md b/src/snapshots/old_syntax/outdented_app_with_record.md new file mode 100644 index 0000000000..8a45946b37 --- /dev/null +++ b/src/snapshots/old_syntax/outdented_app_with_record.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=outdented_app_with_record +type=expr +~~~ +# SOURCE +~~~roc +x = foo (baz { + bar: blah +}) +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),LowerIdent(1:5-1:8),OpenRound(1:9-1:10),LowerIdent(1:10-1:13),OpenCurly(1:14-1:15),Newline(1:1-1:1), +LowerIdent(2:3-2:6),OpColon(2:6-2:7),LowerIdent(2:8-2:12),Newline(1:1-1:1), +CloseCurly(3:1-3:2),CloseRound(3:2-3:3),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/outdented_colon_in_record.md b/src/snapshots/old_syntax/outdented_colon_in_record.md new file mode 100644 index 0000000000..feca439ffb --- /dev/null +++ b/src/snapshots/old_syntax/outdented_colon_in_record.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=outdented_colon_in_record +type=expr +~~~ +# SOURCE +~~~roc +x = foo { +bar +: +blah +} +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),LowerIdent(1:5-1:8),OpenCurly(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:4),Newline(1:1-1:1), +OpColon(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:5),Newline(1:1-1:1), +CloseCurly(5:1-5:2),Newline(1:1-1:1), +LowerIdent(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/outdented_list.md b/src/snapshots/old_syntax/outdented_list.md new file mode 100644 index 0000000000..d8372429fc --- /dev/null +++ b/src/snapshots/old_syntax/outdented_list.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=outdented_list +type=expr +~~~ +# SOURCE +~~~roc +a = [ + 1, 2, 3 +] +a +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),OpenSquare(1:5-1:6),Newline(1:1-1:1), +Int(2:3-2:4),Comma(2:4-2:5),Int(2:6-2:7),Comma(2:7-2:8),Int(2:9-2:10),Newline(1:1-1:1), +CloseSquare(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/outdented_record.md b/src/snapshots/old_syntax/outdented_record.md new file mode 100644 index 0000000000..4407b950b1 --- /dev/null +++ b/src/snapshots/old_syntax/outdented_record.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=outdented_record +type=expr +~~~ +# SOURCE +~~~roc +x = foo { + bar: blah +} +x +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),LowerIdent(1:5-1:8),OpenCurly(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:3-2:6),OpColon(2:6-2:7),LowerIdent(2:8-2:12),Newline(1:1-1:1), +CloseCurly(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/p_return_f_minus_f.md b/src/snapshots/old_syntax/p_return_f_minus_f.md new file mode 100644 index 0000000000..27abac7857 --- /dev/null +++ b/src/snapshots/old_syntax/p_return_f_minus_f.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=p_return_f_minus_f +type=expr +~~~ +# SOURCE +~~~roc +p +return# + f + -f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +KwReturn(2:1-2:7),Newline(2:8-2:8), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +OpUnaryMinus(4:2-4:3),LowerIdent(4:3-4:4),EndOfFile(4:4-4:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "p")) +~~~ +# FORMATTED +~~~roc +p +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/packed_singleton_list.md b/src/snapshots/old_syntax/packed_singleton_list.md new file mode 100644 index 0000000000..cd4f500d2b --- /dev/null +++ b/src/snapshots/old_syntax/packed_singleton_list.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=packed_singleton_list +type=expr +~~~ +# SOURCE +~~~roc +[1] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Int(1:2-1:3),CloseSquare(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-list @1.1-1.4 + (e-int @1.2-1.3 (raw "1"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-1.4 (elem-var 73) (id 74) + (elems + (e-int @1.2-1.3 (value "1")))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "List(Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/paren_newline_before_return.md b/src/snapshots/old_syntax/paren_newline_before_return.md new file mode 100644 index 0000000000..1d10d67f3a --- /dev/null +++ b/src/snapshots/old_syntax/paren_newline_before_return.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=paren_newline_before_return +type=expr +~~~ +# SOURCE +~~~roc +(i + +) +return u +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:1-1:1), +Newline(1:1-1:1), +CloseRound(3:1-3:2),Newline(1:1-1:1), +KwReturn(4:1-4:7),LowerIdent(4:8-4:9),EndOfFile(4:9-4:9), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-3.2 + (e-ident @1.2-1.3 (qaul "") (raw "i"))) +~~~ +# FORMATTED +~~~roc +( + i, + +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-3.2 (id 75) + (elems + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/parens_apply_newline.md b/src/snapshots/old_syntax/parens_apply_newline.md new file mode 100644 index 0000000000..38f5ac7b10 --- /dev/null +++ b/src/snapshots/old_syntax/parens_apply_newline.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=parens_apply_newline +type=expr +~~~ +# SOURCE +~~~roc +(f +N) +N# +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**parens_apply_newline.md:2:2:2:2:** +```roc +N) +``` + + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:1-1:1), +UpperIdent(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/parens_apply_not_parens.md b/src/snapshots/old_syntax/parens_apply_not_parens.md new file mode 100644 index 0000000000..7ee22a01a9 --- /dev/null +++ b/src/snapshots/old_syntax/parens_apply_not_parens.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=parens_apply_not_parens +type=expr +~~~ +# SOURCE +~~~roc +(!(4 +)4) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**parens_apply_not_parens.md:1:2:1:4:** +```roc +(!(4 +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**parens_apply_not_parens.md:2:1:2:3:** +```roc +)4) +``` +^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpBang(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),Newline(1:1-1:1), +CloseRound(2:1-2:2),Int(2:2-2:3),CloseRound(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-malformed @2.1-2.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/parens_comment_in_str_interpolation.md b/src/snapshots/old_syntax/parens_comment_in_str_interpolation.md new file mode 100644 index 0000000000..ec9203f012 --- /dev/null +++ b/src/snapshots/old_syntax/parens_comment_in_str_interpolation.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=parens_comment_in_str_interpolation +type=expr +~~~ +# SOURCE +~~~roc +"${(S# +)}" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:2),OpenStringInterpolation(1:2-1:4),NoSpaceOpenRound(1:4-1:5),UpperIdent(1:5-1:6),Newline(1:7-1:7), +CloseRound(2:1-2:2),CloseStringInterpolation(2:2-2:3),StringPart(2:3-2:3),StringEnd(2:3-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-string @1.1-2.4 + (e-string-part @1.2-1.2 (raw "")) + (e-tuple @1.4-2.2 + (e-tag @1.5-1.6 (raw "S"))) + (e-string-part @2.3-2.3 (raw ""))) +~~~ +# FORMATTED +~~~roc +"${ + ( + S, + ) +}" +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-2.4 (id 78) + (e-literal @1.2-1.2 (string "")) + (e-tuple @1.4-2.2 + (elems + (e-tag @1.5-1.6 (ext-var 74) (name "S") (args "TODO")))) + (e-literal @2.3-2.3 (string ""))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/parens_comment_in_ty_annotation.md b/src/snapshots/old_syntax/parens_comment_in_ty_annotation.md new file mode 100644 index 0000000000..8ecf8980a4 --- /dev/null +++ b/src/snapshots/old_syntax/parens_comment_in_ty_annotation.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=parens_comment_in_ty_annotation malformed +type=expr +~~~ +# SOURCE +~~~roc +Zx (e# +)f:i +s +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:3),OpenRound(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:7-1:7), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),OpColon(2:3-2:4),LowerIdent(2:4-2:5),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.3 (raw "Zx")) +~~~ +# FORMATTED +~~~roc +Zx +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.3 (ext-var 73) (name "Zx") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Zx]*")) +~~~ diff --git a/src/snapshots/old_syntax/parens_comment_tuple.md b/src/snapshots/old_syntax/parens_comment_tuple.md new file mode 100644 index 0000000000..81dff82ffe --- /dev/null +++ b/src/snapshots/old_syntax/parens_comment_tuple.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=parens_comment_tuple +type=expr +~~~ +# SOURCE +~~~roc +((0# +),L) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),Newline(1:5-1:5), +CloseRound(2:1-2:2),Comma(2:2-2:3),UpperIdent(2:3-2:4),CloseRound(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.5 + (e-tuple @1.2-2.2 + (e-int @1.3-1.4 (raw "0"))) + (e-tag @2.3-2.4 (raw "L"))) +~~~ +# FORMATTED +~~~roc +( + ( + 0, + ), + L, +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.5 (id 77) + (elems + (e-tuple @1.2-2.2 + (elems + (e-int @1.3-1.4 (value "0")))) + (e-tag @2.3-2.4 (ext-var 75) (name "L") (args "TODO")))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "(Num(*), (Num(*)), [L]*)")) +~~~ diff --git a/src/snapshots/old_syntax/parens_empty_record_apply.md b/src/snapshots/old_syntax/parens_empty_record_apply.md new file mode 100644 index 0000000000..f9759e825c --- /dev/null +++ b/src/snapshots/old_syntax/parens_empty_record_apply.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=parens_empty_record_apply +type=expr +~~~ +# SOURCE +~~~roc +({ +}){ +} +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpenCurly(1:2-1:3),Newline(1:1-1:1), +CloseCurly(2:1-2:2),CloseRound(2:2-2:3),OpenCurly(2:3-2:4),Newline(1:1-1:1), +CloseCurly(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.3 + (e-record @1.2-2.2)) +~~~ +# FORMATTED +~~~roc +( + {}, +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.3 (id 74) + (elems + (e-empty_record @1.2-2.2))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "({})")) +~~~ diff --git a/src/snapshots/old_syntax/parens_func_apply_type.md b/src/snapshots/old_syntax/parens_func_apply_type.md new file mode 100644 index 0000000000..923b74c027 --- /dev/null +++ b/src/snapshots/old_syntax/parens_func_apply_type.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=parens_func_apply_type +type=expr +~~~ +# SOURCE +~~~roc +si:(e)(e->A) +A +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `si` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:3),OpColon(1:3-1:4),NoSpaceOpenRound(1:4-1:5),LowerIdent(1:5-1:6),CloseRound(1:6-1:7),NoSpaceOpenRound(1:7-1:8),LowerIdent(1:8-1:9),OpArrow(1:9-1:11),UpperIdent(1:11-1:12),CloseRound(1:12-1:13),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.3 (qaul "") (raw "si")) +~~~ +# FORMATTED +~~~roc +si +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/parens_in_type_def_apply.md b/src/snapshots/old_syntax/parens_in_type_def_apply.md new file mode 100644 index 0000000000..8ed18e003d --- /dev/null +++ b/src/snapshots/old_syntax/parens_in_type_def_apply.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=parens_in_type_def_apply malformed +type=expr +~~~ +# SOURCE +~~~roc +U (b a):b +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenRound(1:3-1:4),LowerIdent(1:4-1:5),LowerIdent(1:6-1:7),CloseRound(1:7-1:8),OpColon(1:8-1:9),LowerIdent(1:9-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "U")) +~~~ +# FORMATTED +~~~roc +U +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "U") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[U]*")) +~~~ diff --git a/src/snapshots/old_syntax/parens_newline_in_func_type.md b/src/snapshots/old_syntax/parens_newline_in_func_type.md new file mode 100644 index 0000000000..aa98f4c078 --- /dev/null +++ b/src/snapshots/old_syntax/parens_newline_in_func_type.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=parens_newline_in_func_type +type=expr +~~~ +# SOURCE +~~~roc +C:( +h)->a +C +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseRound(2:2-2:3),OpArrow(2:3-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "C")) +~~~ +# FORMATTED +~~~roc +C +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "C") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[C]*")) +~~~ diff --git a/src/snapshots/old_syntax/parens_newlines_before_as.md b/src/snapshots/old_syntax/parens_newlines_before_as.md new file mode 100644 index 0000000000..c4b2d99363 --- /dev/null +++ b/src/snapshots/old_syntax/parens_newlines_before_as.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=parens_newlines_before_as +type=expr +~~~ +# SOURCE +~~~roc +1:(*# +)as J +l +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),OpStar(1:4-1:5),Newline(1:6-1:6), +CloseRound(2:1-2:2),KwAs(2:2-2:4),UpperIdent(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/parens_record_updater.md b/src/snapshots/old_syntax/parens_record_updater.md new file mode 100644 index 0000000000..c3acfe99b0 --- /dev/null +++ b/src/snapshots/old_syntax/parens_record_updater.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=parens_record_updater +type=expr +~~~ +# SOURCE +~~~roc +T +&n +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +OpAmpersand(2:1-2:2),LowerIdent(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "T")) +~~~ +# FORMATTED +~~~roc +T +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "T") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[T]*")) +~~~ diff --git a/src/snapshots/old_syntax/parenthesized_type_def.md b/src/snapshots/old_syntax/parenthesized_type_def.md new file mode 100644 index 0000000000..9f3a3f8046 --- /dev/null +++ b/src/snapshots/old_syntax/parenthesized_type_def.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=parenthesized_type_def +type=expr +~~~ +# SOURCE +~~~roc +(D):b +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),UpperIdent(1:2-1:3),CloseRound(1:3-1:4),OpColon(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.4 + (e-tag @1.2-1.3 (raw "D"))) +~~~ +# FORMATTED +~~~roc +(D) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.4 (id 75) + (elems + (e-tag @1.2-1.3 (ext-var 73) (name "D") (args "TODO")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "([D]*)")) +~~~ diff --git a/src/snapshots/old_syntax/parenthesized_type_def_space_before.md b/src/snapshots/old_syntax/parenthesized_type_def_space_before.md new file mode 100644 index 0000000000..43aa79f006 --- /dev/null +++ b/src/snapshots/old_syntax/parenthesized_type_def_space_before.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=parenthesized_type_def_space_before +type=expr +~~~ +# SOURCE +~~~roc +( +A):b +a +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +UpperIdent(2:1-2:2),CloseRound(2:2-2:3),OpColon(2:3-2:4),LowerIdent(2:4-2:5),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.3 + (e-tag @2.1-2.2 (raw "A"))) +~~~ +# FORMATTED +~~~roc +( + A, +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.3 (id 75) + (elems + (e-tag @2.1-2.2 (ext-var 73) (name "A") (args "TODO")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "([A]*)")) +~~~ diff --git a/src/snapshots/old_syntax/parenthetical_apply.md b/src/snapshots/old_syntax/parenthetical_apply.md new file mode 100644 index 0000000000..b725edd5ae --- /dev/null +++ b/src/snapshots/old_syntax/parenthetical_apply.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=parenthetical_apply +type=expr +~~~ +# SOURCE +~~~roc +(whee) 1 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:6),CloseRound(1:6-1:7),Int(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.7 + (e-ident @1.2-1.6 (qaul "") (raw "whee"))) +~~~ +# FORMATTED +~~~roc +(whee) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.7 (id 75) + (elems + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/parenthetical_basic_field.md b/src/snapshots/old_syntax/parenthetical_basic_field.md new file mode 100644 index 0000000000..8b660fcfee --- /dev/null +++ b/src/snapshots/old_syntax/parenthetical_basic_field.md @@ -0,0 +1,41 @@ +# META +~~~ini +description=parenthetical_basic_field +type=expr +~~~ +# SOURCE +~~~roc +(rec).field +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `rec` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:5),CloseRound(1:5-1:6),NoSpaceDotLowerIdent(1:6-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-field-access @1.1-1.12 + (e-tuple @1.1-1.6 + (e-ident @1.2-1.5 (qaul "") (raw "rec"))) + (e-ident @1.6-1.12 (qaul "") (raw ".field"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dot-access @1.1-1.12 (field "field") (id 76) + (receiver + (e-tuple @1.1-1.6 + (elems + (e-runtime-error (tag "ident_not_in_scope")))))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/parenthetical_field_qualified_var.md b/src/snapshots/old_syntax/parenthetical_field_qualified_var.md new file mode 100644 index 0000000000..418c0bb8da --- /dev/null +++ b/src/snapshots/old_syntax/parenthetical_field_qualified_var.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=parenthetical_field_qualified_var +type=expr +~~~ +# SOURCE +~~~roc +(One.Two.rec).field +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**parenthetical_field_qualified_var.md:1:13:1:20:** +```roc +(One.Two.rec).field +``` + ^^^^^^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),UpperIdent(1:2-1:5),NoSpaceDotUpperIdent(1:5-1:9),NoSpaceDotLowerIdent(1:9-1:13),CloseRound(1:13-1:14),NoSpaceDotLowerIdent(1:14-1:20),EndOfFile(1:20-1:20), +~~~ +# PARSE +~~~clojure +(e-malformed @1.13-1.20 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/parenthetical_var.md b/src/snapshots/old_syntax/parenthetical_var.md new file mode 100644 index 0000000000..e4e0bbe2dc --- /dev/null +++ b/src/snapshots/old_syntax/parenthetical_var.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=parenthetical_var +type=expr +~~~ +# SOURCE +~~~roc +(whee) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:6),CloseRound(1:6-1:7),EndOfFile(1:7-1:7), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.7 + (e-ident @1.2-1.6 (qaul "") (raw "whee"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.7 (id 75) + (elems + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/parse_alias.md b/src/snapshots/old_syntax/parse_alias.md new file mode 100644 index 0000000000..08e774831b --- /dev/null +++ b/src/snapshots/old_syntax/parse_alias.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=parse_alias +type=expr +~~~ +# SOURCE +~~~roc +Blah a b : Foo.Bar.Baz x y + +42 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:9),OpColon(1:10-1:11),UpperIdent(1:12-1:15),NoSpaceDotUpperIdent(1:15-1:19),NoSpaceDotUpperIdent(1:19-1:23),LowerIdent(1:24-1:25),LowerIdent(1:26-1:27),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.5 (raw "Blah")) +~~~ +# FORMATTED +~~~roc +Blah +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.5 (ext-var 73) (name "Blah") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Blah]*")) +~~~ diff --git a/src/snapshots/old_syntax/parse_as_ann.md b/src/snapshots/old_syntax/parse_as_ann.md new file mode 100644 index 0000000000..381e864928 --- /dev/null +++ b/src/snapshots/old_syntax/parse_as_ann.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=parse_as_ann +type=expr +~~~ +# SOURCE +~~~roc +foo : Foo.Bar.Baz x y as Blah a b + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `foo` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpColon(1:5-1:6),UpperIdent(1:7-1:10),NoSpaceDotUpperIdent(1:10-1:14),NoSpaceDotUpperIdent(1:14-1:18),LowerIdent(1:19-1:20),LowerIdent(1:21-1:22),KwAs(1:23-1:25),UpperIdent(1:26-1:30),LowerIdent(1:31-1:32),LowerIdent(1:33-1:34),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "foo")) +~~~ +# FORMATTED +~~~roc +foo +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pat_parens_newline_before_pipe_when.md b/src/snapshots/old_syntax/pat_parens_newline_before_pipe_when.md new file mode 100644 index 0000000000..5caa1779d4 --- /dev/null +++ b/src/snapshots/old_syntax/pat_parens_newline_before_pipe_when.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=pat_parens_newline_before_pipe_when +type=expr +~~~ +# SOURCE +~~~roc +when 0 +is S# + (H +)|B->e +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),UpperIdent(2:4-2:5),Newline(2:6-2:6), +OpenRound(3:2-3:3),UpperIdent(3:3-3:4),Newline(1:1-1:1), +CloseRound(4:1-4:2),OpBar(4:2-4:3),UpperIdent(4:3-4:4),OpArrow(4:4-4:6),LowerIdent(4:6-4:7),EndOfFile(4:7-4:7), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pat_space_after_comma.md b/src/snapshots/old_syntax/pat_space_after_comma.md new file mode 100644 index 0000000000..17ab56e321 --- /dev/null +++ b/src/snapshots/old_syntax/pat_space_after_comma.md @@ -0,0 +1,52 @@ +# META +~~~ini +description=pat_space_after_comma +type=expr +~~~ +# SOURCE +~~~roc +{i +,p}=5 +Q +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:1-1:1), +Comma(2:1-2:2),LowerIdent(2:2-2:3),CloseCurly(2:3-2:4),OpAssign(2:4-2:5),Int(2:5-2:6),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-2.4 + (field (field "i") (optional false)) + (field (field "p") (optional false))) +~~~ +# FORMATTED +~~~roc +{ + i, + p, +} +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-2.4 (ext-var 79) (id 80) + (fields + (field (name "i") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "p") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "{ i: Error, p: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_as.md b/src/snapshots/old_syntax/pattern_as.md new file mode 100644 index 0000000000..bc7cb98e61 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_as.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=pattern_as +type=expr +~~~ +# SOURCE +~~~roc +when 0 is + _ as n -> n +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Underscore(2:5-2:6),KwAs(2:7-2:9),LowerIdent(2:10-2:11),OpArrow(2:12-2:14),LowerIdent(2:15-2:16),EndOfFile(2:16-2:16), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_as_list_rest.md b/src/snapshots/old_syntax/pattern_as_list_rest.md new file mode 100644 index 0000000000..7c4cc8206f --- /dev/null +++ b/src/snapshots/old_syntax/pattern_as_list_rest.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=pattern_as_list_rest +type=expr +~~~ +# SOURCE +~~~roc +when myList is + [first, .. as rest] -> 0 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:12),LowerIdent(1:13-1:15),Newline(1:1-1:1), +OpenSquare(2:5-2:6),LowerIdent(2:6-2:11),Comma(2:11-2:12),DoubleDot(2:13-2:15),KwAs(2:16-2:18),LowerIdent(2:19-2:23),CloseSquare(2:23-2:24),OpArrow(2:25-2:27),Int(2:28-2:29),EndOfFile(2:29-2:29), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_as_spaces.md b/src/snapshots/old_syntax/pattern_as_spaces.md new file mode 100644 index 0000000000..11654983c3 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_as_spaces.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=pattern_as_spaces +type=expr +~~~ +# SOURCE +~~~roc +when 0 is + 0 # foobar + as # barfoo + n -> {} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),Newline(2:8-2:15), +KwAs(3:9-3:11),Newline(3:13-3:20), +LowerIdent(4:9-4:10),OpArrow(4:11-4:13),OpenCurly(4:14-4:15),CloseCurly(4:15-4:16),EndOfFile(4:16-4:16), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_binds_keyword.md b/src/snapshots/old_syntax/pattern_binds_keyword.md new file mode 100644 index 0000000000..f7c9080e1f --- /dev/null +++ b/src/snapshots/old_syntax/pattern_binds_keyword.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=pattern_binds_keyword fail +type=expr +~~~ +# SOURCE +~~~roc +when Just 4 is + Just when -> + 4 + + _ -> + 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),UpperIdent(1:6-1:10),Int(1:11-1:12),LowerIdent(1:13-1:15),Newline(1:1-1:1), +UpperIdent(2:5-2:9),LowerIdent(2:10-2:14),OpArrow(2:15-2:17),Newline(1:1-1:1), +Int(3:9-3:10),Newline(1:1-1:1), +Newline(1:1-1:1), +Underscore(5:5-5:6),OpArrow(5:7-5:9),Newline(1:1-1:1), +Int(6:9-6:10),EndOfFile(6:10-6:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_comma_newlines.md b/src/snapshots/old_syntax/pattern_comma_newlines.md new file mode 100644 index 0000000000..6a445661c8 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_comma_newlines.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=pattern_comma_newlines +type=expr +~~~ +# SOURCE +~~~roc +1(i,p# +):f +n +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `p` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:4),Comma(1:4-1:5),LowerIdent(1:5-1:6),Newline(1:7-1:7), +CloseRound(2:1-2:2),OpColon(2:2-2:3),LowerIdent(2:3-2:4),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-2.2 + (e-int @1.1-1.2 (raw "1")) + (e-ident @1.3-1.4 (qaul "") (raw "i")) + (e-ident @1.5-1.6 (qaul "") (raw "p"))) +~~~ +# FORMATTED +~~~roc +1( + i, + p, +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-2.2 (id 79) + (e-int @1.1-1.2 (value "1")) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 79) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_in_parens_end.md b/src/snapshots/old_syntax/pattern_in_parens_end.md new file mode 100644 index 0000000000..9ea9cdebdf --- /dev/null +++ b/src/snapshots/old_syntax/pattern_in_parens_end.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=pattern_in_parens_end fail +type=expr +~~~ +# SOURCE +~~~roc +\( a +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**pattern_in_parens_end.md:1:1:1:3:** +```roc +\( a +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/pattern_in_parens_end_comma.md b/src/snapshots/old_syntax/pattern_in_parens_end_comma.md new file mode 100644 index 0000000000..cbc65a6ea9 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_in_parens_end_comma.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=pattern_in_parens_end_comma fail +type=expr +~~~ +# SOURCE +~~~roc +\( a, +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**pattern_in_parens_end_comma.md:1:1:1:3:** +```roc +\( a, +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:4-1:5),Comma(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/pattern_in_parens_indent_open.md b/src/snapshots/old_syntax/pattern_in_parens_indent_open.md new file mode 100644 index 0000000000..af2f8cad9c --- /dev/null +++ b/src/snapshots/old_syntax/pattern_in_parens_indent_open.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=pattern_in_parens_indent_open fail +type=expr +~~~ +# SOURCE +~~~roc +\( +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**pattern_in_parens_indent_open.md:1:1:1:3:** +```roc +\( +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/pattern_in_parens_open.md b/src/snapshots/old_syntax/pattern_in_parens_open.md new file mode 100644 index 0000000000..044e532047 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_in_parens_open.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=pattern_in_parens_open fail +type=expr +~~~ +# SOURCE +~~~roc +\( a +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**pattern_in_parens_open.md:1:1:1:3:** +```roc +\( a +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/pattern_opt_field_bonanza.md b/src/snapshots/old_syntax/pattern_opt_field_bonanza.md new file mode 100644 index 0000000000..ed5ff016f0 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_opt_field_bonanza.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=pattern_opt_field_bonanza malformed +type=expr +~~~ +# SOURCE +~~~roc +M{s?s{J& +}}{s?s{J& +}}:p +y +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),NoSpaceOpQuestion(1:4-1:5),LowerIdent(1:5-1:6),OpenCurly(1:6-1:7),UpperIdent(1:7-1:8),OpAmpersand(1:8-1:9),Newline(1:1-1:1), +CloseCurly(2:1-2:2),CloseCurly(2:2-2:3),OpenCurly(2:3-2:4),LowerIdent(2:4-2:5),NoSpaceOpQuestion(2:5-2:6),LowerIdent(2:6-2:7),OpenCurly(2:7-2:8),UpperIdent(2:8-2:9),OpAmpersand(2:9-2:10),Newline(1:1-1:1), +CloseCurly(3:1-3:2),CloseCurly(3:2-3:3),OpColon(3:3-3:4),LowerIdent(3:4-3:5),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "M")) +~~~ +# FORMATTED +~~~roc +M +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "M") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[M]*")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_record_apply_comment.md b/src/snapshots/old_syntax/pattern_record_apply_comment.md new file mode 100644 index 0000000000..dd568947ed --- /dev/null +++ b/src/snapshots/old_syntax/pattern_record_apply_comment.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=pattern_record_apply_comment +type=expr +~~~ +# SOURCE +~~~roc +s{t# +}:s +p# +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:5-1:5), +CloseCurly(2:1-2:2),OpColon(2:2-2:3),LowerIdent(2:3-2:4),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "s")) +~~~ +# FORMATTED +~~~roc +s +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_with_as_parens.md b/src/snapshots/old_syntax/pattern_with_as_parens.md new file mode 100644 index 0000000000..9c68e00ea7 --- /dev/null +++ b/src/snapshots/old_syntax/pattern_with_as_parens.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=pattern_with_as_parens +type=expr +~~~ +# SOURCE +~~~roc +when t is + Ok ({} as d)->S +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +UpperIdent(2:5-2:7),OpenRound(2:8-2:9),OpenCurly(2:9-2:10),CloseCurly(2:10-2:11),KwAs(2:12-2:14),LowerIdent(2:15-2:16),CloseRound(2:16-2:17),OpArrow(2:17-2:19),UpperIdent(2:19-2:20),EndOfFile(2:20-2:20), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pattern_with_space_in_parens.md b/src/snapshots/old_syntax/pattern_with_space_in_parens.md new file mode 100644 index 0000000000..c0ccef8f3a --- /dev/null +++ b/src/snapshots/old_syntax/pattern_with_space_in_parens.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=pattern_with_space_in_parens +type=expr +~~~ +# SOURCE +~~~roc +when Delmin (Del rx) 0 is + Delmin (Del ry ) _ -> Node Black 0 Bool.false ry +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),UpperIdent(1:6-1:12),OpenRound(1:13-1:14),UpperIdent(1:14-1:17),LowerIdent(1:18-1:20),CloseRound(1:20-1:21),Int(1:22-1:23),LowerIdent(1:24-1:26),Newline(1:1-1:1), +UpperIdent(2:5-2:11),OpenRound(2:12-2:13),UpperIdent(2:13-2:16),LowerIdent(2:17-2:19),CloseRound(2:20-2:21),Underscore(2:22-2:23),OpArrow(2:24-2:26),UpperIdent(2:27-2:31),UpperIdent(2:32-2:37),Int(2:38-2:39),UpperIdent(2:40-2:44),NoSpaceDotLowerIdent(2:44-2:50),LowerIdent(2:51-2:53),EndOfFile(2:53-2:53), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/pizza_dbg.md b/src/snapshots/old_syntax/pizza_dbg.md new file mode 100644 index 0000000000..04774e71eb --- /dev/null +++ b/src/snapshots/old_syntax/pizza_dbg.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=pizza_dbg +type=expr +~~~ +# SOURCE +~~~roc +1 |> dbg +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpPizza(1:3-1:5),KwDbg(1:6-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/plus_if.md b/src/snapshots/old_syntax/plus_if.md new file mode 100644 index 0000000000..0adfbb1d89 --- /dev/null +++ b/src/snapshots/old_syntax/plus_if.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=plus_if +type=expr +~~~ +# SOURCE +~~~roc +1 * if Bool.true then 1 else 1 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**plus_if.md:1:23:1:29:** +```roc +1 * if Bool.true then 1 else 1 +``` + ^^^^^^ + + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +Int(1:1-1:2),OpStar(1:3-1:4),KwIf(1:5-1:7),UpperIdent(1:8-1:12),NoSpaceDotLowerIdent(1:12-1:17),LowerIdent(1:18-1:22),Int(1:23-1:24),KwElse(1:25-1:29),Int(1:30-1:31),EndOfFile(1:31-1:31), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.29 (op "*") + (e-int @1.1-1.2 (raw "1")) + (e-malformed @1.23-1.29 (reason "no_else"))) +~~~ +# FORMATTED +~~~roc +1 * +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.29 (op "mul") (id 76) + (e-int @1.1-1.2 (value "1")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/plus_when.md b/src/snapshots/old_syntax/plus_when.md new file mode 100644 index 0000000000..5fac1d85ed --- /dev/null +++ b/src/snapshots/old_syntax/plus_when.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=plus_when +type=expr +~~~ +# SOURCE +~~~roc +1 + + when Foo is + Foo -> 2 + Bar -> 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +Int(1:1-1:2),OpPlus(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:5-2:9),UpperIdent(2:10-2:13),LowerIdent(2:14-2:16),Newline(1:1-1:1), +UpperIdent(3:9-3:12),OpArrow(3:13-3:15),Int(3:16-3:17),Newline(1:1-1:1), +UpperIdent(4:9-4:12),OpArrow(4:13-4:15),Int(4:16-4:17),EndOfFile(4:17-4:17), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.13 (op "+") + (e-int @1.1-1.2 (raw "1")) + (e-ident @2.5-2.9 (qaul "") (raw "when"))) +~~~ +# FORMATTED +~~~roc +1 + + when +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.13 (op "add") (id 76) + (e-int @1.1-1.2 (value "1")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/pnc_apply_comment_after_newline.md b/src/snapshots/old_syntax/pnc_apply_comment_after_newline.md new file mode 100644 index 0000000000..effcf4894b --- /dev/null +++ b/src/snapshots/old_syntax/pnc_apply_comment_after_newline.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=pnc_apply_comment_after_newline +type=expr +~~~ +# SOURCE +~~~roc +i(i, +)t +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:4),Comma(1:4-1:5),Newline(1:1-1:1), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-2.2 + (e-ident @1.1-1.2 (qaul "") (raw "i")) + (e-ident @1.3-1.4 (qaul "") (raw "i"))) +~~~ +# FORMATTED +~~~roc +i( + i, +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-2.2 (id 78) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/pnc_apply_neg_pattern.md b/src/snapshots/old_syntax/pnc_apply_neg_pattern.md new file mode 100644 index 0000000000..0e426161c6 --- /dev/null +++ b/src/snapshots/old_syntax/pnc_apply_neg_pattern.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=pnc_apply_neg_pattern +type=expr +~~~ +# SOURCE +~~~roc +(-8)():C +8 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-8** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**pnc_apply_neg_pattern.md:1:2:1:4:** +```roc +(-8)():C +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**pnc_apply_neg_pattern.md:1:4:1:6:** +```roc +(-8)():C +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpBinaryMinus(1:2-1:3),Int(1:3-1:4),CloseRound(1:4-1:5),NoSpaceOpenRound(1:5-1:6),CloseRound(1:6-1:7),OpColon(1:7-1:8),UpperIdent(1:8-1:9),Newline(1:1-1:1), +Int(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.4-1.6 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/pnc_dbg_parens_comment.md b/src/snapshots/old_syntax/pnc_dbg_parens_comment.md new file mode 100644 index 0000000000..e8b971d55b --- /dev/null +++ b/src/snapshots/old_syntax/pnc_dbg_parens_comment.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=pnc_dbg_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +(dbg(5# +)) +e +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize dbg expression + +# TOKENS +~~~zig +OpenRound(1:1-1:2),KwDbg(1:2-1:5),NoSpaceOpenRound(1:5-1:6),Int(1:6-1:7),Newline(1:8-1:8), +CloseRound(2:1-2:2),CloseRound(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-2.3 + (e-dbg + (e-tuple @1.5-2.2 + (e-int @1.6-1.7 (raw "5"))))) +~~~ +# FORMATTED +~~~roc +( + dbg ( + 5, + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-2.3 (id 75) + (elems + (e-runtime-error (tag "not_implemented")))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "(Error)")) +~~~ diff --git a/src/snapshots/old_syntax/pnc_parens_apply_etc.md b/src/snapshots/old_syntax/pnc_parens_apply_etc.md new file mode 100644 index 0000000000..e15fefa15b --- /dev/null +++ b/src/snapshots/old_syntax/pnc_parens_apply_etc.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=pnc_parens_apply_etc +type=expr +~~~ +# SOURCE +~~~roc +( +3)():B +(z) +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +Int(2:1-2:2),CloseRound(2:2-2:3),NoSpaceOpenRound(2:3-2:4),CloseRound(2:4-2:5),OpColon(2:5-2:6),UpperIdent(2:6-2:7),Newline(1:1-1:1), +OpenRound(3:1-3:2),LowerIdent(3:2-3:3),CloseRound(3:3-3:4),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-2.5 + (e-tuple @1.1-2.3 + (e-int @2.1-2.2 (raw "3")))) +~~~ +# FORMATTED +~~~roc +( + 3, +)() +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-2.5 (id 76) + (e-tuple @1.1-2.3 + (elems + (e-int @2.1-2.2 (value "3"))))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/pos_inf_float.md b/src/snapshots/old_syntax/pos_inf_float.md new file mode 100644 index 0000000000..7723f7dd80 --- /dev/null +++ b/src/snapshots/old_syntax/pos_inf_float.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=pos_inf_float +type=expr +~~~ +# SOURCE +~~~roc +inf +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `inf` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "inf")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/positive_float.md b/src/snapshots/old_syntax/positive_float.md new file mode 100644 index 0000000000..c4e79e5ae9 --- /dev/null +++ b/src/snapshots/old_syntax/positive_float.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=positive_float +type=expr +~~~ +# SOURCE +~~~roc +42.9 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.5 (raw "42.9")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dec-small @1.1-1.5 (numerator "429") (denominator-power-of-ten "1") (value "42.9") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/positive_int.md b/src/snapshots/old_syntax/positive_int.md new file mode 100644 index 0000000000..a1ffc9cf7b --- /dev/null +++ b/src/snapshots/old_syntax/positive_int.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=positive_int +type=expr +~~~ +# SOURCE +~~~roc +42 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.3 (raw "42")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.3 (value "42") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/qualified_field.md b/src/snapshots/old_syntax/qualified_field.md new file mode 100644 index 0000000000..284aa197ba --- /dev/null +++ b/src/snapshots/old_syntax/qualified_field.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=qualified_field +type=expr +~~~ +# SOURCE +~~~roc +One.Two.rec.abc.def.ghi +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),NoSpaceDotUpperIdent(1:4-1:8),NoSpaceDotLowerIdent(1:8-1:12),NoSpaceDotLowerIdent(1:12-1:16),NoSpaceDotLowerIdent(1:16-1:20),NoSpaceDotLowerIdent(1:20-1:24),EndOfFile(1:24-1:24), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "One")) +~~~ +# FORMATTED +~~~roc +One +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "One") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[One]*")) +~~~ diff --git a/src/snapshots/old_syntax/qualified_tag.md b/src/snapshots/old_syntax/qualified_tag.md new file mode 100644 index 0000000000..29031f94a0 --- /dev/null +++ b/src/snapshots/old_syntax/qualified_tag.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=qualified_tag malformed +type=expr +~~~ +# SOURCE +~~~roc +One.Two.Whee +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),NoSpaceDotUpperIdent(1:4-1:8),NoSpaceDotUpperIdent(1:8-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "One")) +~~~ +# FORMATTED +~~~roc +One +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "One") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[One]*")) +~~~ diff --git a/src/snapshots/old_syntax/qualified_var.md b/src/snapshots/old_syntax/qualified_var.md new file mode 100644 index 0000000000..5d02b5742a --- /dev/null +++ b/src/snapshots/old_syntax/qualified_var.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=qualified_var +type=expr +~~~ +# SOURCE +~~~roc +One.Two.whee +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:4),NoSpaceDotUpperIdent(1:4-1:8),NoSpaceDotLowerIdent(1:8-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.4 (raw "One")) +~~~ +# FORMATTED +~~~roc +One +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.4 (ext-var 73) (name "One") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[One]*")) +~~~ diff --git a/src/snapshots/old_syntax/quotes_in_parens_in_pat.md b/src/snapshots/old_syntax/quotes_in_parens_in_pat.md new file mode 100644 index 0000000000..3965c1bef8 --- /dev/null +++ b/src/snapshots/old_syntax/quotes_in_parens_in_pat.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=quotes_in_parens_in_pat malformed +type=expr +~~~ +# SOURCE +~~~roc +Q (""""""""):a +q +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenRound(1:3-1:4),MultilineStringStart(1:4-1:7),StringPart(1:7-1:7),MultilineStringEnd(1:7-1:10),StringStart(1:10-1:11),StringPart(1:11-1:11),StringEnd(1:11-1:12),CloseRound(1:12-1:13),OpColon(1:13-1:14),LowerIdent(1:14-1:15),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "Q")) +~~~ +# FORMATTED +~~~roc +Q +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "Q") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Q]*")) +~~~ diff --git a/src/snapshots/old_syntax/record_access_after_tuple.md b/src/snapshots/old_syntax/record_access_after_tuple.md new file mode 100644 index 0000000000..f05cbf09c7 --- /dev/null +++ b/src/snapshots/old_syntax/record_access_after_tuple.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=record_access_after_tuple +type=expr +~~~ +# SOURCE +~~~roc +({a: 0}, {b: 1}).0.a +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expr_no_space_dot_int` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**record_access_after_tuple.md:1:17:1:21:** +```roc +({a: 0}, {b: 1}).0.a +``` + ^^^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),OpenCurly(1:2-1:3),LowerIdent(1:3-1:4),OpColon(1:4-1:5),Int(1:6-1:7),CloseCurly(1:7-1:8),Comma(1:8-1:9),OpenCurly(1:10-1:11),LowerIdent(1:11-1:12),OpColon(1:12-1:13),Int(1:14-1:15),CloseCurly(1:15-1:16),CloseRound(1:16-1:17),NoSpaceDotInt(1:17-1:19),NoSpaceDotLowerIdent(1:19-1:21),EndOfFile(1:21-1:21), +~~~ +# PARSE +~~~clojure +(e-malformed @1.17-1.21 (reason "expr_no_space_dot_int")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/record_builder.md b/src/snapshots/old_syntax/record_builder.md new file mode 100644 index 0000000000..53acd48c50 --- /dev/null +++ b/src/snapshots/old_syntax/record_builder.md @@ -0,0 +1,150 @@ +# META +~~~ini +description=record_builder +type=expr +~~~ +# SOURCE +~~~roc +{ Foo.Bar.baz <- x: 5, y: 0 +} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.Bar.baz** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder.md:1:6:1:14:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + ^^^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.baz <-** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder.md:1:10:1:17:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + ^^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **<- x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder.md:1:15:1:19:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + ^^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **5,** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_builder.md:1:21:1:23:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, y** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder.md:1:22:1:25:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + ^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_builder.md:1:27:1:27:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +``` + + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **{ Foo.Bar.baz <- x: 5, y: 0 +}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder.md:1:1:2:2:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0 +} +``` + + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),UpperIdent(1:3-1:6),NoSpaceDotUpperIdent(1:6-1:10),NoSpaceDotLowerIdent(1:10-1:14),OpBackArrow(1:15-1:17),LowerIdent(1:18-1:19),OpColon(1:19-1:20),Int(1:21-1:22),Comma(1:22-1:23),LowerIdent(1:24-1:25),OpColon(1:25-1:26),Int(1:27-1:28),Newline(1:1-1:1), +CloseCurly(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.2 + (statements + (e-tag @1.3-1.6 (raw "Foo")) + (e-malformed @1.6-1.14 (reason "expr_unexpected_token")) + (e-malformed @1.10-1.17 (reason "expr_unexpected_token")) + (e-malformed @1.15-1.19 (reason "expr_unexpected_token")) + (s-type-anno @1.18-1.23 (name "x") + (ty-malformed @1.21-1.23 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.22-1.25 (reason "expr_unexpected_token")) + (s-type-anno @1.1-1.1 (name "y") + (ty-malformed @1.1-1.1 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.1-2.2 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +{ + Foo + + + + x : + + y : + +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.2 (id 85) + (s-expr @1.3-1.10 + (e-tag @1.3-1.6 (ext-var 73) (name "Foo") (args "TODO"))) + (s-type-anno @1.18-1.23 (name "x") + (ty-malformed @1.21-1.23)) + (s-type-anno @1.1-1.1 (name "y") + (ty-malformed @1.1-1.1)) + (e-empty_record @1.1-2.2)) +~~~ +# TYPES +~~~clojure +(expr (id 85) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/record_builder_ignored_fields.md b/src/snapshots/old_syntax/record_builder_ignored_fields.md new file mode 100644 index 0000000000..2f8b8b54d9 --- /dev/null +++ b/src/snapshots/old_syntax/record_builder_ignored_fields.md @@ -0,0 +1,213 @@ +# META +~~~ini +description=record_builder_ignored_fields +type=expr +~~~ +# SOURCE +~~~roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.Bar.baz** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:6:1:14:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.baz <-** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:10:1:17:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **<- x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:15:1:19:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **5,** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:21:1:23:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, y** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:22:1:25:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **0,** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:27:1:29:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, _z** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:28:1:32:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **3,** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:34:1:36:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, _** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:35:1:38:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **_:** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:37:1:39:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **: 2** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_builder_ignored_fields.md:1:38:1:41:** +```roc +{ Foo.Bar.baz <- x: 5, y: 0, _z: 3, _: 2 +``` + ^^^ + + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),UpperIdent(1:3-1:6),NoSpaceDotUpperIdent(1:6-1:10),NoSpaceDotLowerIdent(1:10-1:14),OpBackArrow(1:15-1:17),LowerIdent(1:18-1:19),OpColon(1:19-1:20),Int(1:21-1:22),Comma(1:22-1:23),LowerIdent(1:24-1:25),OpColon(1:25-1:26),Int(1:27-1:28),Comma(1:28-1:29),NamedUnderscore(1:30-1:32),OpColon(1:32-1:33),Int(1:34-1:35),Comma(1:35-1:36),Underscore(1:37-1:38),OpColon(1:38-1:39),Int(1:40-1:41),Newline(1:1-1:1), +CloseCurly(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.2 + (statements + (e-tag @1.3-1.6 (raw "Foo")) + (e-malformed @1.6-1.14 (reason "expr_unexpected_token")) + (e-malformed @1.10-1.17 (reason "expr_unexpected_token")) + (e-malformed @1.15-1.19 (reason "expr_unexpected_token")) + (s-type-anno @1.18-1.23 (name "x") + (ty-malformed @1.21-1.23 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.22-1.25 (reason "expr_unexpected_token")) + (s-type-anno @1.24-1.29 (name "y") + (ty-malformed @1.27-1.29 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.28-1.32 (reason "expr_unexpected_token")) + (s-type-anno @1.30-1.36 (name "_z") + (ty-malformed @1.34-1.36 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.35-1.38 (reason "expr_unexpected_token")) + (e-malformed @1.37-1.39 (reason "expr_unexpected_token")) + (e-malformed @1.38-1.41 (reason "expr_unexpected_token")) + (e-int @1.40-1.41 (raw "2")))) +~~~ +# FORMATTED +~~~roc +{ + Foo + + + + x : + + y : + + _z : + + + + 2 +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.2 (id 89) + (s-expr @1.3-1.10 + (e-tag @1.3-1.6 (ext-var 73) (name "Foo") (args "TODO"))) + (s-type-anno @1.18-1.23 (name "x") + (ty-malformed @1.21-1.23)) + (s-type-anno @1.24-1.29 (name "y") + (ty-malformed @1.27-1.29)) + (s-type-anno @1.30-1.36 (name "_z") + (ty-malformed @1.34-1.36)) + (e-int @1.40-1.41 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 89) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/record_comment_newline_field.md b/src/snapshots/old_syntax/record_comment_newline_field.md new file mode 100644 index 0000000000..d0c33c24ca --- /dev/null +++ b/src/snapshots/old_syntax/record_comment_newline_field.md @@ -0,0 +1,41 @@ +# META +~~~ini +description=record_comment_newline_field +type=expr +~~~ +# SOURCE +~~~roc +{# +a} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:3-1:3), +LowerIdent(2:1-2:2),CloseCurly(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.3 + (statements + (e-ident @2.1-2.2 (qaul "") (raw "a")))) +~~~ +# FORMATTED +~~~roc +{ + a +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.3 (id 75) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_destructure_def.md b/src/snapshots/old_syntax/record_destructure_def.md new file mode 100644 index 0000000000..b4ec767249 --- /dev/null +++ b/src/snapshots/old_syntax/record_destructure_def.md @@ -0,0 +1,53 @@ +# META +~~~ini +description=record_destructure_def +type=expr +~~~ +# SOURCE +~~~roc +# leading comment +{ x, y } = 5 +y = 6 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** leading comment +{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_destructure_def.md:1:2:2:2:** +```roc +# leading comment +{ x, y } = 5 +``` + + +# TOKENS +~~~zig +Newline(1:2-1:18), +OpenCurly(2:1-2:2),LowerIdent(2:3-2:4),Comma(2:4-2:5),LowerIdent(2:6-2:7),CloseCurly(2:8-2:9),OpAssign(2:10-2:11),Int(2:12-2:13),Newline(1:1-1:1), +LowerIdent(3:1-3:2),OpAssign(3:3-3:4),Int(3:5-3:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(5:1-5:3),EndOfFile(5:3-5:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/record_destructure_field_bang.md b/src/snapshots/old_syntax/record_destructure_field_bang.md new file mode 100644 index 0000000000..ecd08de7db --- /dev/null +++ b/src/snapshots/old_syntax/record_destructure_field_bang.md @@ -0,0 +1,49 @@ +# META +~~~ini +description=record_destructure_field_bang +type=expr +~~~ +# SOURCE +~~~roc +{launchTheNukes!, code} = config + +launchTheNukes! code +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `launchTheNukes!` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `code` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:17),Comma(1:17-1:18),LowerIdent(1:19-1:23),CloseCurly(1:23-1:24),OpAssign(1:25-1:26),LowerIdent(1:27-1:33),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:16),LowerIdent(3:17-3:21),EndOfFile(3:21-3:21), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.24 + (field (field "launchTheNukes!") (optional false)) + (field (field "code") (optional false))) +~~~ +# FORMATTED +~~~roc +{ launchTheNukes!, code } +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-1.24 (ext-var 79) (id 80) + (fields + (field (name "launchTheNukes!") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "code") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "{ launchTheNukes!: Error, code: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/record_destructure_field_bang_no_space.md b/src/snapshots/old_syntax/record_destructure_field_bang_no_space.md new file mode 100644 index 0000000000..e03c8c847d --- /dev/null +++ b/src/snapshots/old_syntax/record_destructure_field_bang_no_space.md @@ -0,0 +1,49 @@ +# META +~~~ini +description=record_destructure_field_bang_no_space fail +type=expr +~~~ +# SOURCE +~~~roc +{launchTheNukes!wrong, code} = config + +launchTheNukes! code +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `launchTheNukes!wrong` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `code` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:22),Comma(1:22-1:23),LowerIdent(1:24-1:28),CloseCurly(1:28-1:29),OpAssign(1:30-1:31),LowerIdent(1:32-1:38),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:16),LowerIdent(3:17-3:21),EndOfFile(3:21-3:21), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.29 + (field (field "launchTheNukes!wrong") (optional false)) + (field (field "code") (optional false))) +~~~ +# FORMATTED +~~~roc +{ launchTheNukes!wrong, code } +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-1.29 (ext-var 79) (id 80) + (fields + (field (name "launchTheNukes!wrong") + (e-runtime-error (tag "ident_not_in_scope"))) + (field (name "code") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "{ launchTheNukes!wrong: Error, code: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/record_double_newline_comment_field.md b/src/snapshots/old_syntax/record_double_newline_comment_field.md new file mode 100644 index 0000000000..65beb44b81 --- /dev/null +++ b/src/snapshots/old_syntax/record_double_newline_comment_field.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=record_double_newline_comment_field +type=expr +~~~ +# SOURCE +~~~roc +{ + +# +} +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(3:2-3:2), +CloseCurly(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-4.2) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-4.2 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/record_func_type_decl.md b/src/snapshots/old_syntax/record_func_type_decl.md new file mode 100644 index 0000000000..1e07c64830 --- /dev/null +++ b/src/snapshots/old_syntax/record_func_type_decl.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=record_func_type_decl +type=expr +~~~ +# SOURCE +~~~roc +f : + { + getLine : Effect Str, + putLine : Str -> Effect Int, + text: Str, + value: Int * + } + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),Newline(1:1-1:1), +OpenCurly(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:9-3:16),OpColon(3:17-3:18),UpperIdent(3:19-3:25),UpperIdent(3:26-3:29),Comma(3:29-3:30),Newline(1:1-1:1), +LowerIdent(4:9-4:16),OpColon(4:17-4:18),UpperIdent(4:19-4:22),OpArrow(4:23-4:25),UpperIdent(4:26-4:32),UpperIdent(4:33-4:36),Comma(4:36-4:37),Newline(1:1-1:1), +LowerIdent(5:9-5:13),OpColon(5:13-5:14),UpperIdent(5:15-5:18),Comma(5:18-5:19),Newline(1:1-1:1), +LowerIdent(6:9-6:14),OpColon(6:14-6:15),UpperIdent(6:16-6:19),OpStar(6:20-6:21),Newline(1:1-1:1), +CloseCurly(7:5-7:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(9:1-9:3),EndOfFile(9:3-9:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_literal_field_bang.md b/src/snapshots/old_syntax/record_literal_field_bang.md new file mode 100644 index 0000000000..2ab194bc70 --- /dev/null +++ b/src/snapshots/old_syntax/record_literal_field_bang.md @@ -0,0 +1,62 @@ +# META +~~~ini +description=record_literal_field_bang +type=expr +~~~ +# SOURCE +~~~roc +{ + answer: 42, + launchTheNukes!: \{} -> boom +} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\{** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_literal_field_bang.md:3:22:3:24:** +```roc + launchTheNukes!: \{} -> boom +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_curly_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**record_literal_field_bang.md:3:23:3:25:** +```roc + launchTheNukes!: \{} -> boom +``` + ^^ + + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:1-1:1), +LowerIdent(2:5-2:11),OpColon(2:11-2:12),Int(2:13-2:15),Comma(2:15-2:16),Newline(1:1-1:1), +LowerIdent(3:5-3:20),OpColon(3:20-3:21),OpBackslash(3:22-3:23),OpenCurly(3:23-3:24),CloseCurly(3:24-3:25),OpArrow(3:26-3:28),LowerIdent(3:29-3:33),Newline(1:1-1:1), +CloseCurly(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @3.23-3.25 (reason "expected_expr_close_curly_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/record_type_end.md b/src/snapshots/old_syntax/record_type_end.md new file mode 100644 index 0000000000..55749e3b0d --- /dev/null +++ b/src/snapshots/old_syntax/record_type_end.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_type_end fail +type=expr +~~~ +# SOURCE +~~~roc +f : { a: Int, +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),LowerIdent(1:7-1:8),OpColon(1:8-1:9),UpperIdent(1:10-1:13),Comma(1:13-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_keyword_field_name.md b/src/snapshots/old_syntax/record_type_keyword_field_name.md new file mode 100644 index 0000000000..04192919e2 --- /dev/null +++ b/src/snapshots/old_syntax/record_type_keyword_field_name.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_type_keyword_field_name fail +type=expr +~~~ +# SOURCE +~~~roc +f : { if : I64 } +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),KwIf(1:7-1:9),OpColon(1:10-1:11),UpperIdent(1:12-1:15),CloseCurly(1:16-1:17),EndOfFile(1:17-1:17), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_missing_comma.md b/src/snapshots/old_syntax/record_type_missing_comma.md new file mode 100644 index 0000000000..6c0007b098 --- /dev/null +++ b/src/snapshots/old_syntax/record_type_missing_comma.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_type_missing_comma fail +type=expr +~~~ +# SOURCE +~~~roc +f : { foo bar } +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),LowerIdent(1:7-1:10),LowerIdent(1:12-1:15),CloseCurly(1:16-1:17),EndOfFile(1:17-1:17), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_open.md b/src/snapshots/old_syntax/record_type_open.md new file mode 100644 index 0000000000..052c2b9ab9 --- /dev/null +++ b/src/snapshots/old_syntax/record_type_open.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_type_open fail +type=expr +~~~ +# SOURCE +~~~roc +f : { +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_open_indent.md b/src/snapshots/old_syntax/record_type_open_indent.md new file mode 100644 index 0000000000..d2abb0282a --- /dev/null +++ b/src/snapshots/old_syntax/record_type_open_indent.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=record_type_open_indent fail +type=expr +~~~ +# SOURCE +~~~roc +f : { +foo : I64, +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),Newline(1:1-1:1), +LowerIdent(2:1-2:4),OpColon(2:5-2:6),UpperIdent(2:7-2:10),Comma(2:10-2:11),EndOfFile(2:11-2:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_tab.md b/src/snapshots/old_syntax/record_type_tab.md new file mode 100644 index 0000000000..e7c45cd005 --- /dev/null +++ b/src/snapshots/old_syntax/record_type_tab.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_type_tab fail +type=expr +~~~ +# SOURCE +~~~roc +f : { foo } +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),LowerIdent(1:7-1:10),CloseCurly(1:13-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_type_with_function.md b/src/snapshots/old_syntax/record_type_with_function.md new file mode 100644 index 0000000000..80e3d19d2a --- /dev/null +++ b/src/snapshots/old_syntax/record_type_with_function.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=record_type_with_function +type=expr +~~~ +# SOURCE +~~~roc +x : { init : {} -> Model, update : Model, Str -> Model, view : Model -> Str } + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenCurly(1:5-1:6),LowerIdent(1:7-1:11),OpColon(1:12-1:13),OpenCurly(1:14-1:15),CloseCurly(1:15-1:16),OpArrow(1:17-1:19),UpperIdent(1:20-1:25),Comma(1:25-1:26),LowerIdent(1:27-1:33),OpColon(1:34-1:35),UpperIdent(1:36-1:41),Comma(1:41-1:42),UpperIdent(1:43-1:46),OpArrow(1:47-1:49),UpperIdent(1:50-1:55),Comma(1:55-1:56),LowerIdent(1:57-1:61),OpColon(1:62-1:63),UpperIdent(1:64-1:69),OpArrow(1:70-1:72),UpperIdent(1:73-1:76),CloseCurly(1:77-1:78),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_update.md b/src/snapshots/old_syntax/record_update.md new file mode 100644 index 0000000000..318807bdf1 --- /dev/null +++ b/src/snapshots/old_syntax/record_update.md @@ -0,0 +1,134 @@ +# META +~~~ini +description=record_update +type=expr +~~~ +# SOURCE +~~~roc +{ Foo.Bar.baz & x: 5, y: 0 } +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.Bar.baz** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update.md:1:6:1:14:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.baz &** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update.md:1:10:1:16:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^^^^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **& x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update.md:1:15:1:18:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **5,** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_update.md:1:20:1:22:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^ + + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **, y** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update.md:1:21:1:24:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^^ + + +**UNEXPECTED TOKEN IN TYPE ANNOTATION** +The token **0 }** is not expected in a type annotation. +Type annotations should contain types like _Str_, _Num a_, or _List U64_. + +Here is the problematic code: +**record_update.md:1:26:1:29:** +```roc +{ Foo.Bar.baz & x: 5, y: 0 } +``` + ^^^ + + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +**MALFORMED TYPE** +This type annotation is malformed or contains invalid syntax. + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),UpperIdent(1:3-1:6),NoSpaceDotUpperIdent(1:6-1:10),NoSpaceDotLowerIdent(1:10-1:14),OpAmpersand(1:15-1:16),LowerIdent(1:17-1:18),OpColon(1:18-1:19),Int(1:20-1:21),Comma(1:21-1:22),LowerIdent(1:23-1:24),OpColon(1:24-1:25),Int(1:26-1:27),CloseCurly(1:28-1:29),EndOfFile(1:29-1:29), +~~~ +# PARSE +~~~clojure +(e-block @1.1-1.29 + (statements + (e-tag @1.3-1.6 (raw "Foo")) + (e-malformed @1.6-1.14 (reason "expr_unexpected_token")) + (e-malformed @1.10-1.16 (reason "expr_unexpected_token")) + (e-malformed @1.15-1.18 (reason "expr_unexpected_token")) + (s-type-anno @1.17-1.22 (name "x") + (ty-malformed @1.20-1.22 (tag "ty_anno_unexpected_token"))) + (e-malformed @1.21-1.24 (reason "expr_unexpected_token")) + (s-type-anno @1.23-1.29 (name "y") + (ty-malformed @1.26-1.29 (tag "ty_anno_unexpected_token"))))) +~~~ +# FORMATTED +~~~roc +{ + Foo + + + + x : + + y : +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-1.29 (id 84) + (s-expr @1.3-1.10 + (e-tag @1.3-1.6 (ext-var 73) (name "Foo") (args "TODO"))) + (s-type-anno @1.17-1.22 (name "x") + (ty-malformed @1.20-1.22)) + (s-type-anno @1.23-1.29 (name "y") + (ty-malformed @1.26-1.29)) + (e-tuple @1.23-1.29 + (elems))) +~~~ +# TYPES +~~~clojure +(expr (id 84) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/record_update_apply_closure_comments.md b/src/snapshots/old_syntax/record_update_apply_closure_comments.md new file mode 100644 index 0000000000..3c155b0291 --- /dev/null +++ b/src/snapshots/old_syntax/record_update_apply_closure_comments.md @@ -0,0 +1,59 @@ +# META +~~~ini +description=record_update_apply_closure_comments +type=expr +~~~ +# SOURCE +~~~roc +{# +h&}\# + i->0 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **&}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update_apply_closure_comments.md:2:2:2:4:** +```roc +h&}\# +``` + ^^ + + +**UNDEFINED VARIABLE** +Nothing is named `h` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),Newline(1:3-1:3), +LowerIdent(2:1-2:2),OpAmpersand(2:2-2:3),CloseCurly(2:3-2:4),OpBackslash(2:4-2:5),Newline(2:6-2:6), +LowerIdent(3:2-3:3),OpArrow(3:3-3:5),Int(3:5-3:6),EndOfFile(3:6-3:6), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.4 + (statements + (e-ident @2.1-2.2 (qaul "") (raw "h")) + (e-malformed @2.2-2.4 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +{ + h + +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.4 (id 77) + (s-expr @2.1-2.3 + (e-runtime-error (tag "ident_not_in_scope"))) + (e-empty_record @1.1-2.4)) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/record_update_comment_before_ampersand.md b/src/snapshots/old_syntax/record_update_comment_before_ampersand.md new file mode 100644 index 0000000000..a975e3ebe7 --- /dev/null +++ b/src/snapshots/old_syntax/record_update_comment_before_ampersand.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=record_update_comment_before_ampersand +type=expr +~~~ +# SOURCE +~~~roc +{i# +&} +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **&}** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_update_comment_before_ampersand.md:2:1:2:3:** +```roc +&} +``` +^^ + + +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:4-1:4), +OpAmpersand(2:1-2:2),CloseCurly(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.3 + (statements + (e-ident @1.2-1.3 (qaul "") (raw "i")) + (e-malformed @2.1-2.3 (reason "expr_unexpected_token")))) +~~~ +# FORMATTED +~~~roc +{ + i + +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.3 (id 77) + (s-expr @1.2-2.2 + (e-runtime-error (tag "ident_not_in_scope"))) + (e-empty_record @1.1-2.3)) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/record_updater_closure_weirdness.md b/src/snapshots/old_syntax/record_updater_closure_weirdness.md new file mode 100644 index 0000000000..b2258bcc64 --- /dev/null +++ b/src/snapshots/old_syntax/record_updater_closure_weirdness.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=record_updater_closure_weirdness +type=expr +~~~ +# SOURCE +~~~roc +&rm?\L2->t ++c +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **&rm** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**record_updater_closure_weirdness.md:1:1:1:4:** +```roc +&rm?\L2->t +``` +^^^ + + +# TOKENS +~~~zig +OpAmpersand(1:1-1:2),LowerIdent(1:2-1:4),NoSpaceOpQuestion(1:4-1:5),OpBackslash(1:5-1:6),UpperIdent(1:6-1:8),OpArrow(1:8-1:10),LowerIdent(1:10-1:11),Newline(1:1-1:1), +OpPlus(2:1-2:2),LowerIdent(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/record_updater_literal_apply.md b/src/snapshots/old_syntax/record_updater_literal_apply.md new file mode 100644 index 0000000000..8ddcbeca96 --- /dev/null +++ b/src/snapshots/old_syntax/record_updater_literal_apply.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=record_updater_literal_apply +type=expr +~~~ +# SOURCE +~~~roc +data = + { x: 5, y: 0 } + |> &y 3 + +data +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `data` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),Newline(1:1-1:1), +OpenCurly(2:5-2:6),LowerIdent(2:7-2:8),OpColon(2:8-2:9),Int(2:10-2:11),Comma(2:11-2:12),LowerIdent(2:13-2:14),OpColon(2:14-2:15),Int(2:16-2:17),CloseCurly(2:18-2:19),Newline(1:1-1:1), +OpPizza(3:9-3:11),OpAmpersand(3:12-3:13),LowerIdent(3:13-3:14),Int(3:16-3:17),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(5:1-5:5),EndOfFile(5:5-5:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "data")) +~~~ +# FORMATTED +~~~roc +data +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_updater_var_apply.md b/src/snapshots/old_syntax/record_updater_var_apply.md new file mode 100644 index 0000000000..1421a7a045 --- /dev/null +++ b/src/snapshots/old_syntax/record_updater_var_apply.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=record_updater_var_apply +type=expr +~~~ +# SOURCE +~~~roc +foo&bar 5 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `foo` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpAmpersand(1:4-1:5),LowerIdent(1:5-1:8),Int(1:10-1:11),EndOfFile(1:11-1:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "foo")) +~~~ +# FORMATTED +~~~roc +foo +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/record_with_if.md b/src/snapshots/old_syntax/record_with_if.md new file mode 100644 index 0000000000..0adb48313f --- /dev/null +++ b/src/snapshots/old_syntax/record_with_if.md @@ -0,0 +1,56 @@ +# META +~~~ini +description=record_with_if +type=expr +~~~ +# SOURCE +~~~roc +{x : if Bool.true then 1 else 2, y: 3 } +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `no_else` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**record_with_if.md:1:24:1:30:** +```roc +{x : if Bool.true then 1 else 2, y: 3 } +``` + ^^^^^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_curly_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**record_with_if.md:1:26:1:32:** +```roc +{x : if Bool.true then 1 else 2, y: 3 } +``` + ^^^^^^ + + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),OpColon(1:4-1:5),KwIf(1:6-1:8),UpperIdent(1:9-1:13),NoSpaceDotLowerIdent(1:13-1:18),LowerIdent(1:19-1:23),Int(1:24-1:25),KwElse(1:26-1:30),Int(1:31-1:32),Comma(1:32-1:33),LowerIdent(1:34-1:35),OpColon(1:35-1:36),Int(1:37-1:38),CloseCurly(1:39-1:40),EndOfFile(1:40-1:40), +~~~ +# PARSE +~~~clojure +(e-malformed @1.26-1.32 (reason "expected_expr_close_curly_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/record_with_lots_of_newlines.md b/src/snapshots/old_syntax/record_with_lots_of_newlines.md new file mode 100644 index 0000000000..47ef80be1e --- /dev/null +++ b/src/snapshots/old_syntax/record_with_lots_of_newlines.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=record_with_lots_of_newlines +type=expr +~~~ +# SOURCE +~~~roc +{t# +, + +} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `t` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),Newline(1:4-1:4), +Comma(2:1-2:2),Newline(1:1-1:1), +Newline(1:1-1:1), +CloseCurly(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-4.2 + (field (field "t") (optional false))) +~~~ +# FORMATTED +~~~roc +{ + t, + +} +~~~ +# CANONICALIZE +~~~clojure +(e-record @1.1-4.2 (ext-var 76) (id 77) + (fields + (field (name "t") + (e-runtime-error (tag "ident_not_in_scope"))))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "{ t: Error }")) +~~~ diff --git a/src/snapshots/old_syntax/repr_7342.md b/src/snapshots/old_syntax/repr_7342.md new file mode 100644 index 0000000000..5ef30cc729 --- /dev/null +++ b/src/snapshots/old_syntax/repr_7342.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=repr_7342 +type=expr +~~~ +# SOURCE +~~~roc +((1# +)Q a:t +n) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**repr_7342.md:3:2:3:3:** +```roc +n) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),Int(1:3-1:4),Newline(1:5-1:5), +CloseRound(2:1-2:2),UpperIdent(2:2-2:3),LowerIdent(2:4-2:5),OpColon(2:5-2:6),LowerIdent(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @3.2-3.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/repr_7346.md b/src/snapshots/old_syntax/repr_7346.md new file mode 100644 index 0000000000..94b2a0d033 --- /dev/null +++ b/src/snapshots/old_syntax/repr_7346.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=repr_7346 malformed +type=expr +~~~ +# SOURCE +~~~roc +il3\k->#w#z + CCC@C (#i +t!K):i + C +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `il3` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpBackslash(1:4-1:5),LowerIdent(1:5-1:6),OpArrow(1:6-1:8),Newline(1:9-1:12), +UpperIdent(2:2-2:5),OpaqueName(2:5-2:7),OpenRound(2:8-2:9),Newline(2:10-2:11), +LowerIdent(3:1-3:4),CloseRound(3:4-3:5),OpColon(3:5-3:6),LowerIdent(3:6-3:7),Newline(1:1-1:1), +UpperIdent(4:2-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "il3")) +~~~ +# FORMATTED +~~~roc +il3 +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_apply_newline.md b/src/snapshots/old_syntax/return_apply_newline.md new file mode 100644 index 0000000000..73a1d5b9f1 --- /dev/null +++ b/src/snapshots/old_syntax/return_apply_newline.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=return_apply_newline +type=expr +~~~ +# SOURCE +~~~roc +return + n + r# +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_apply_newline.md:1:1:1:1:** +```roc +return +``` + + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:2-3:3),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_as_single_line_expr.md b/src/snapshots/old_syntax/return_as_single_line_expr.md new file mode 100644 index 0000000000..cb46fa5da1 --- /dev/null +++ b/src/snapshots/old_syntax/return_as_single_line_expr.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=return_as_single_line_expr fail +type=expr +~~~ +# SOURCE +~~~roc +x = return 5 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),KwReturn(1:5-1:11),Int(1:12-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_empty_assign.md b/src/snapshots/old_syntax/return_empty_assign.md new file mode 100644 index 0000000000..fff4e5b16f --- /dev/null +++ b/src/snapshots/old_syntax/return_empty_assign.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=return_empty_assign +type=expr +~~~ +# SOURCE +~~~roc +return + {}=# + s + r +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_empty_assign.md:1:1:1:1:** +```roc +return +``` + + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),Newline(1:1-1:1), +OpenCurly(2:2-2:3),CloseCurly(2:3-2:4),OpAssign(2:4-2:5),Newline(2:6-2:6), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +LowerIdent(4:2-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_field_access_in_parens.md b/src/snapshots/old_syntax/return_field_access_in_parens.md new file mode 100644 index 0000000000..f9fd2adf4d --- /dev/null +++ b/src/snapshots/old_syntax/return_field_access_in_parens.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=return_field_access_in_parens +type=expr +~~~ +# SOURCE +~~~roc +(return.o) +ss +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return.o** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_field_access_in_parens.md:1:2:1:10:** +```roc +(return.o) +``` + ^^^^^^^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**return_field_access_in_parens.md:1:10:1:10:** +```roc +(return.o) +``` + + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),KwReturn(1:2-1:8),NoSpaceDotLowerIdent(1:8-1:10),CloseRound(1:10-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_in_apply_func.md b/src/snapshots/old_syntax/return_in_apply_func.md new file mode 100644 index 0000000000..e4d9136bb5 --- /dev/null +++ b/src/snapshots/old_syntax/return_in_apply_func.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=return_in_apply_func +type=expr +~~~ +# SOURCE +~~~roc +( +return-3e)g +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return-** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_in_apply_func.md:2:1:2:8:** +```roc +return-3e)g +``` +^^^^^^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**return_in_apply_func.md:2:10:2:12:** +```roc +return-3e)g +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +KwReturn(2:1-2:7),OpBinaryMinus(2:7-2:8),MalformedNumberNoExponentDigits(2:8-2:10),CloseRound(2:10-2:11),LowerIdent(2:11-2:12),EndOfFile(2:12-2:12), +~~~ +# PARSE +~~~clojure +(e-malformed @2.10-2.12 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_in_if.md b/src/snapshots/old_syntax/return_in_if.md new file mode 100644 index 0000000000..9b7e792214 --- /dev/null +++ b/src/snapshots/old_syntax/return_in_if.md @@ -0,0 +1,52 @@ +# META +~~~ini +description=return_in_if +type=expr +~~~ +# SOURCE +~~~roc +maybeEarlyReturn = \x -> + y = + if x > 5 then + return "abc" + else + x + 2 + + Num.to_str y + +maybeEarlyReturn 10 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `maybeEarlyReturn` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:17),OpAssign(1:18-1:19),OpBackslash(1:20-1:21),LowerIdent(1:21-1:22),OpArrow(1:23-1:25),Newline(1:1-1:1), +LowerIdent(2:5-2:6),OpAssign(2:7-2:8),Newline(1:1-1:1), +KwIf(3:9-3:11),LowerIdent(3:12-3:13),OpGreaterThan(3:14-3:15),Int(3:16-3:17),LowerIdent(3:18-3:22),Newline(1:1-1:1), +KwReturn(4:13-4:19),StringStart(4:20-4:21),StringPart(4:21-4:24),StringEnd(4:24-4:25),Newline(1:1-1:1), +KwElse(5:9-5:13),Newline(1:1-1:1), +LowerIdent(6:13-6:14),OpPlus(6:15-6:16),Int(6:17-6:18),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(8:5-8:8),NoSpaceDotLowerIdent(8:8-8:15),LowerIdent(8:16-8:17),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(10:1-10:17),Int(10:18-10:20),EndOfFile(10:20-10:20), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.17 (qaul "") (raw "maybeEarlyReturn")) +~~~ +# FORMATTED +~~~roc +maybeEarlyReturn +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_in_pat.md b/src/snapshots/old_syntax/return_in_pat.md new file mode 100644 index 0000000000..94bfc7f9f7 --- /dev/null +++ b/src/snapshots/old_syntax/return_in_pat.md @@ -0,0 +1,60 @@ +# META +~~~ini +description=return_in_pat fail +type=expr +~~~ +# SOURCE +~~~roc +( +return e +t)=t +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return e** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_in_pat.md:2:1:2:9:** +```roc +return e +``` +^^^^^^^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**return_in_pat.md:3:2:3:4:** +```roc +t)=t +``` + ^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),Newline(1:1-1:1), +KwReturn(2:1-2:7),LowerIdent(2:8-2:9),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),OpAssign(3:3-3:4),LowerIdent(3:4-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-malformed @3.2-3.4 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_in_static_def.md b/src/snapshots/old_syntax/return_in_static_def.md new file mode 100644 index 0000000000..fca68d5358 --- /dev/null +++ b/src/snapshots/old_syntax/return_in_static_def.md @@ -0,0 +1,56 @@ +# META +~~~ini +description=return_in_static_def +type=expr +~~~ +# SOURCE +~~~roc +staticValueDef = + someVal = + if 10 > 5 then + x = 5 + return x + else + 6 + + someVal + 2 + + +staticValueDef +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `staticValueDef` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:15),OpAssign(1:16-1:17),Newline(1:1-1:1), +LowerIdent(2:5-2:12),OpAssign(2:13-2:14),Newline(1:1-1:1), +KwIf(3:9-3:11),Int(3:12-3:14),OpGreaterThan(3:15-3:16),Int(3:17-3:18),LowerIdent(3:19-3:23),Newline(1:1-1:1), +LowerIdent(4:14-4:15),OpAssign(4:16-4:17),Int(4:18-4:19),Newline(1:1-1:1), +KwReturn(5:14-5:20),LowerIdent(5:24-5:25),Newline(1:1-1:1), +KwElse(6:9-6:13),Newline(1:1-1:1), +Int(7:14-7:15),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(9:5-9:12),OpPlus(9:13-9:14),Int(9:15-9:16),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(12:1-12:15),EndOfFile(12:15-12:15), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.15 (qaul "") (raw "staticValueDef")) +~~~ +# FORMATTED +~~~roc +staticValueDef +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_in_when.md b/src/snapshots/old_syntax/return_in_when.md new file mode 100644 index 0000000000..21b695190a --- /dev/null +++ b/src/snapshots/old_syntax/return_in_when.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=return_in_when +type=expr +~~~ +# SOURCE +~~~roc +maybeEarlyReturn = \x -> + y = + when x is + 5 -> + return + "abc" + + _ -> x + 2 + + + Num.to_str y + +maybeEarlyRetun 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `maybeEarlyReturn` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:17),OpAssign(1:18-1:19),OpBackslash(1:20-1:21),LowerIdent(1:21-1:22),OpArrow(1:23-1:25),Newline(1:1-1:1), +LowerIdent(2:5-2:6),OpAssign(2:7-2:8),Newline(1:1-1:1), +LowerIdent(3:5-3:9),LowerIdent(3:10-3:11),LowerIdent(3:12-3:14),Newline(1:1-1:1), +Int(4:9-4:10),OpArrow(4:11-4:13),Newline(1:1-1:1), +KwReturn(5:21-5:27),Newline(1:1-1:1), +StringStart(6:25-6:26),StringPart(6:26-6:29),StringEnd(6:29-6:30),Newline(1:1-1:1), +Newline(1:1-1:1), +Underscore(8:9-8:10),OpArrow(8:11-8:13),LowerIdent(8:14-8:15),OpPlus(8:16-8:17),Int(8:18-8:19),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(11:5-11:8),NoSpaceDotLowerIdent(11:8-11:15),LowerIdent(11:16-11:17),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(13:1-13:16),Int(13:17-13:18),EndOfFile(13:18-13:18), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.17 (qaul "") (raw "maybeEarlyReturn")) +~~~ +# FORMATTED +~~~roc +maybeEarlyReturn +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_minus_one.md b/src/snapshots/old_syntax/return_minus_one.md new file mode 100644 index 0000000000..45b341813a --- /dev/null +++ b/src/snapshots/old_syntax/return_minus_one.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=return_minus_one +type=expr +~~~ +# SOURCE +~~~roc +return-r +1 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return-** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_minus_one.md:1:1:1:8:** +```roc +return-r +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),OpBinaryMinus(1:7-1:8),LowerIdent(1:8-1:9),Newline(1:1-1:1), +Int(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_multiline.md b/src/snapshots/old_syntax/return_multiline.md new file mode 100644 index 0000000000..26c3f3b68a --- /dev/null +++ b/src/snapshots/old_syntax/return_multiline.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=return_multiline +type=expr +~~~ +# SOURCE +~~~roc +return + something + |> pipeToFunction + |> andAnother +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_multiline.md:1:1:1:1:** +```roc +return +``` + + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),Newline(1:1-1:1), +LowerIdent(2:9-2:18),Newline(1:1-1:1), +OpPizza(3:13-3:15),LowerIdent(3:16-3:30),Newline(1:1-1:1), +OpPizza(4:17-4:19),LowerIdent(4:20-4:30),EndOfFile(4:30-4:30), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_only_statement.md b/src/snapshots/old_syntax/return_only_statement.md new file mode 100644 index 0000000000..9afa49a879 --- /dev/null +++ b/src/snapshots/old_syntax/return_only_statement.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=return_only_statement +type=expr +~~~ +# SOURCE +~~~roc +identityFn = \x -> + return x + + +identityFn 45 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `identityFn` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:11),OpAssign(1:12-1:13),OpBackslash(1:14-1:15),LowerIdent(1:15-1:16),OpArrow(1:17-1:19),Newline(1:1-1:1), +KwReturn(2:3-2:9),LowerIdent(2:14-2:15),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(5:1-5:11),Int(5:12-5:14),EndOfFile(5:14-5:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.11 (qaul "") (raw "identityFn")) +~~~ +# FORMATTED +~~~roc +identityFn +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/return_parens_comments.md b/src/snapshots/old_syntax/return_parens_comments.md new file mode 100644 index 0000000000..6736a633bc --- /dev/null +++ b/src/snapshots/old_syntax/return_parens_comments.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=return_parens_comments +type=expr +~~~ +# SOURCE +~~~roc +return(3# +# +) +Z +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_parens_comments.md:1:1:1:8:** +```roc +return(3# +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),NoSpaceOpenRound(1:7-1:8),Int(1:8-1:9),Newline(1:10-1:10), +Newline(2:2-2:2), +CloseRound(3:1-3:2),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_record_update_comment_empty_fields.md b/src/snapshots/old_syntax/return_record_update_comment_empty_fields.md new file mode 100644 index 0000000000..cc908cd81e --- /dev/null +++ b/src/snapshots/old_syntax/return_record_update_comment_empty_fields.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=return_record_update_comment_empty_fields +type=expr +~~~ +# SOURCE +~~~roc +return + {# +g&}e +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_record_update_comment_empty_fields.md:1:1:1:1:** +```roc +return +``` + + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),Newline(1:1-1:1), +OpenCurly(2:2-2:3),Newline(2:4-2:4), +LowerIdent(3:1-3:2),OpAmpersand(3:2-3:3),CloseCurly(3:3-3:4),LowerIdent(3:4-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.1 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_then_nested_parens.md b/src/snapshots/old_syntax/return_then_nested_parens.md new file mode 100644 index 0000000000..0bf9d9b135 --- /dev/null +++ b/src/snapshots/old_syntax/return_then_nested_parens.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=return_then_nested_parens +type=expr +~~~ +# SOURCE +~~~roc +return n +((0 +)# +) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return n** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_then_nested_parens.md:1:1:1:9:** +```roc +return n +``` +^^^^^^^^ + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),LowerIdent(1:8-1:9),Newline(1:1-1:1), +OpenRound(2:1-2:2),NoSpaceOpenRound(2:2-2:3),Int(2:3-2:4),Newline(1:1-1:1), +CloseRound(3:1-3:2),Newline(3:3-3:3), +CloseRound(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.9 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/return_with_after.md b/src/snapshots/old_syntax/return_with_after.md new file mode 100644 index 0000000000..08bf6bbce8 --- /dev/null +++ b/src/snapshots/old_syntax/return_with_after.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=return_with_after +type=expr +~~~ +# SOURCE +~~~roc +return-1# +X +s +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **return-** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**return_with_after.md:1:1:1:8:** +```roc +return-1# +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwReturn(1:1-1:7),OpBinaryMinus(1:7-1:8),Int(1:8-1:9),Newline(1:10-1:10), +UpperIdent(2:1-2:2),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/sep_annotation.md b/src/snapshots/old_syntax/sep_annotation.md new file mode 100644 index 0000000000..eaaa61b40e --- /dev/null +++ b/src/snapshots/old_syntax/sep_annotation.md @@ -0,0 +1,39 @@ +# META +~~~ini +description=sep_annotation +type=expr +~~~ +# SOURCE +~~~roc +E:i + +E +=h +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),LowerIdent(1:3-1:4),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(3:1-3:2),Newline(1:1-1:1), +OpAssign(4:1-4:2),LowerIdent(4:2-4:3),Newline(1:1-1:1), +Int(5:1-5:2),EndOfFile(5:2-5:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "E")) +~~~ +# FORMATTED +~~~roc +E +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "E") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[E]*")) +~~~ diff --git a/src/snapshots/old_syntax/single_arg_closure.md b/src/snapshots/old_syntax/single_arg_closure.md new file mode 100644 index 0000000000..8495ff11a5 --- /dev/null +++ b/src/snapshots/old_syntax/single_arg_closure.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=single_arg_closure +type=expr +~~~ +# SOURCE +~~~roc +\a -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\a** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**single_arg_closure.md:1:1:1:3:** +```roc +\a -> 42 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),OpArrow(1:4-1:6),Int(1:7-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/single_arg_with_underscore_closure.md b/src/snapshots/old_syntax/single_arg_with_underscore_closure.md new file mode 100644 index 0000000000..2b82c4612f --- /dev/null +++ b/src/snapshots/old_syntax/single_arg_with_underscore_closure.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=single_arg_with_underscore_closure +type=expr +~~~ +# SOURCE +~~~roc +\the_answer -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\the_answer** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**single_arg_with_underscore_closure.md:1:1:1:12:** +```roc +\the_answer -> 42 +``` +^^^^^^^^^^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:12),OpArrow(1:13-1:15),Int(1:16-1:18),EndOfFile(1:18-1:18), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.12 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/single_no_end.md b/src/snapshots/old_syntax/single_no_end.md new file mode 100644 index 0000000000..16b6621f69 --- /dev/null +++ b/src/snapshots/old_syntax/single_no_end.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=single_no_end fail +type=expr +~~~ +# SOURCE +~~~roc +"there is no end +~~~ +# PROBLEMS +**UNCLOSED STRING** +This string is missing a closing quote. + +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:17),EndOfFile(1:17-1:17), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.17 + (e-string-part @1.2-1.17 (raw "there is no end"))) +~~~ +# FORMATTED +~~~roc +"there is no end" +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.17 (id 74) + (e-literal @1.2-1.17 (string "there is no end"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/single_question_binop_closure.md b/src/snapshots/old_syntax/single_question_binop_closure.md new file mode 100644 index 0000000000..80d28206f7 --- /dev/null +++ b/src/snapshots/old_syntax/single_question_binop_closure.md @@ -0,0 +1,53 @@ +# META +~~~ini +description=single_question_binop_closure +type=expr +~~~ +# SOURCE +~~~roc +fallible!(args) ? |my_err| + my_err * 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `fallible!` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `args` in this scope. +Is there an `import` or `exposing` missing up-top? + +**NOT IMPLEMENTED** +This feature is not yet implemented: binop + +# TOKENS +~~~zig +LowerIdent(1:1-1:10),NoSpaceOpenRound(1:10-1:11),LowerIdent(1:11-1:15),CloseRound(1:15-1:16),OpQuestion(1:19-1:20),OpBar(1:21-1:22),LowerIdent(1:22-1:28),OpBar(1:28-1:29),Newline(1:1-1:1), +LowerIdent(2:5-2:11),OpStar(2:12-2:13),Int(2:14-2:15),EndOfFile(2:15-2:15), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.15 (op "?") + (e-apply @1.1-1.16 + (e-ident @1.1-1.10 (qaul "") (raw "fallible!")) + (e-ident @1.11-1.15 (qaul "") (raw "args"))) + (e-lambda @1.21-2.15 + (args + (p-ident @1.22-1.28 (raw "my_err"))) + (e-binop @2.5-2.15 (op "*") + (e-ident @2.5-2.11 (qaul "") (raw "my_err")) + (e-int @2.14-2.15 (raw "2"))))) +~~~ +# FORMATTED +~~~roc +fallible!(args) ? |my_err| + my_err * 2 +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 86)) +~~~ +# TYPES +~~~clojure +(expr (id 86) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/single_question_binop_tag.md b/src/snapshots/old_syntax/single_question_binop_tag.md new file mode 100644 index 0000000000..671e00dcc5 --- /dev/null +++ b/src/snapshots/old_syntax/single_question_binop_tag.md @@ -0,0 +1,45 @@ +# META +~~~ini +description=single_question_binop_tag +type=expr +~~~ +# SOURCE +~~~roc +fallible!(args) ? WrapOverErr +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `fallible!` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `args` in this scope. +Is there an `import` or `exposing` missing up-top? + +**NOT IMPLEMENTED** +This feature is not yet implemented: binop + +# TOKENS +~~~zig +LowerIdent(1:1-1:10),NoSpaceOpenRound(1:10-1:11),LowerIdent(1:11-1:15),CloseRound(1:15-1:16),OpQuestion(1:19-1:20),UpperIdent(1:21-1:32),EndOfFile(1:32-1:32), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.32 (op "?") + (e-apply @1.1-1.16 + (e-ident @1.1-1.10 (qaul "") (raw "fallible!")) + (e-ident @1.11-1.15 (qaul "") (raw "args"))) + (e-tag @1.21-1.32 (raw "WrapOverErr"))) +~~~ +# FORMATTED +~~~roc +fallible!(args) ? WrapOverErr +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 82)) +~~~ +# TYPES +~~~clojure +(expr (id 82) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/single_underscore_closure.md b/src/snapshots/old_syntax/single_underscore_closure.md new file mode 100644 index 0000000000..56d9fc0409 --- /dev/null +++ b/src/snapshots/old_syntax/single_underscore_closure.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=single_underscore_closure +type=expr +~~~ +# SOURCE +~~~roc +\_ -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\_** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**single_underscore_closure.md:1:1:1:3:** +```roc +\_ -> 42 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),Underscore(1:2-1:3),OpArrow(1:4-1:6),Int(1:7-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/sneaky_and_expr.md b/src/snapshots/old_syntax/sneaky_and_expr.md new file mode 100644 index 0000000000..9bad1376e2 --- /dev/null +++ b/src/snapshots/old_syntax/sneaky_and_expr.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=sneaky_and_expr +type=expr +~~~ +# SOURCE +~~~roc +a +{}=ands +d +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpenCurly(2:1-2:2),CloseCurly(2:2-2:3),OpAssign(2:3-2:4),LowerIdent(2:4-2:8),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/sneaky_implements_in_opaque_fn_type.md b/src/snapshots/old_syntax/sneaky_implements_in_opaque_fn_type.md new file mode 100644 index 0000000000..8d7e06017d --- /dev/null +++ b/src/snapshots/old_syntax/sneaky_implements_in_opaque_fn_type.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=sneaky_implements_in_opaque_fn_type +type=expr +~~~ +# SOURCE +~~~roc +N:=e->(implements) +I +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColonEqual(1:2-1:4),LowerIdent(1:4-1:5),OpArrow(1:5-1:7),NoSpaceOpenRound(1:7-1:8),KwImplements(1:8-1:18),CloseRound(1:18-1:19),Newline(1:1-1:1), +UpperIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "N")) +~~~ +# FORMATTED +~~~roc +N +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "N") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[N]*")) +~~~ diff --git a/src/snapshots/old_syntax/space_after_opt_field_pat.md b/src/snapshots/old_syntax/space_after_opt_field_pat.md new file mode 100644 index 0000000000..92641f9c2d --- /dev/null +++ b/src/snapshots/old_syntax/space_after_opt_field_pat.md @@ -0,0 +1,51 @@ +# META +~~~ini +description=space_after_opt_field_pat +type=expr +~~~ +# SOURCE +~~~roc +{p? +m}:J +O +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize suffix_single_question expression + +**UNDEFINED VARIABLE** +Nothing is named `m` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:2-1:3),NoSpaceOpQuestion(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:2),CloseCurly(2:2-2:3),OpColon(2:3-2:4),UpperIdent(2:4-2:5),Newline(1:1-1:1), +UpperIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-block @1.1-2.3 + (statements + (e-question-suffix @1.2-1.4 + (e-ident @1.2-1.3 (qaul "") (raw "p"))) + (e-ident @2.1-2.2 (qaul "") (raw "m")))) +~~~ +# FORMATTED +~~~roc +{ + p? + m +} +~~~ +# CANONICALIZE +~~~clojure +(e-block @1.1-2.3 (id 78) + (s-expr @1.2-2.2 + (e-runtime-error (tag "not_implemented"))) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 78) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/space_before_parens_space_after.md b/src/snapshots/old_syntax/space_before_parens_space_after.md new file mode 100644 index 0000000000..c025a8da9c --- /dev/null +++ b/src/snapshots/old_syntax/space_before_parens_space_after.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=space_before_parens_space_after +type=expr +~~~ +# SOURCE +~~~roc +i +(4 +)#( +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpenRound(2:1-2:2),Int(2:2-2:3),Newline(1:1-1:1), +CloseRound(3:1-3:2),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "i")) +~~~ +# FORMATTED +~~~roc +i +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/space_only_after_minus.md b/src/snapshots/old_syntax/space_only_after_minus.md new file mode 100644 index 0000000000..33008142bd --- /dev/null +++ b/src/snapshots/old_syntax/space_only_after_minus.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=space_only_after_minus +type=expr +~~~ +# SOURCE +~~~roc +x- y +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `y` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),LowerIdent(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.5 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-ident @1.4-1.5 (qaul "") (raw "y"))) +~~~ +# FORMATTED +~~~roc +x - y +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.5 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/spaced_singleton_list.md b/src/snapshots/old_syntax/spaced_singleton_list.md new file mode 100644 index 0000000000..f4fd344b67 --- /dev/null +++ b/src/snapshots/old_syntax/spaced_singleton_list.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=spaced_singleton_list +type=expr +~~~ +# SOURCE +~~~roc +[ 1 ] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),Int(1:3-1:4),CloseSquare(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-list @1.1-1.6 + (e-int @1.3-1.4 (raw "1"))) +~~~ +# FORMATTED +~~~roc +[1] +~~~ +# CANONICALIZE +~~~clojure +(e-list @1.1-1.6 (elem-var 73) (id 74) + (elems + (e-int @1.3-1.4 (value "1")))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "List(Num(*))")) +~~~ diff --git a/src/snapshots/old_syntax/spaces_inside_empty_list.md b/src/snapshots/old_syntax/spaces_inside_empty_list.md new file mode 100644 index 0000000000..902facec0c --- /dev/null +++ b/src/snapshots/old_syntax/spaces_inside_empty_list.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=spaces_inside_empty_list +type=expr +~~~ +# SOURCE +~~~roc +[ ] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenSquare(1:1-1:2),CloseSquare(1:4-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-list @1.1-1.5) +~~~ +# FORMATTED +~~~roc +[] +~~~ +# CANONICALIZE +~~~clojure +(e-empty_list @1.1-1.5 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "List(*)")) +~~~ diff --git a/src/snapshots/old_syntax/stmt_parens_minus.md b/src/snapshots/old_syntax/stmt_parens_minus.md new file mode 100644 index 0000000000..1d7417c3bb --- /dev/null +++ b/src/snapshots/old_syntax/stmt_parens_minus.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=stmt_parens_minus +type=expr +~~~ +# SOURCE +~~~roc +i +(-2) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `i` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),Newline(1:1-1:1), +OpenRound(2:1-2:2),OpBinaryMinus(2:2-2:3),Int(2:3-2:4),CloseRound(2:4-2:5),EndOfFile(2:5-2:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "i")) +~~~ +# FORMATTED +~~~roc +i +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/stmts_in_empty_record_assignment.md b/src/snapshots/old_syntax/stmts_in_empty_record_assignment.md new file mode 100644 index 0000000000..b01068c943 --- /dev/null +++ b/src/snapshots/old_syntax/stmts_in_empty_record_assignment.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=stmts_in_empty_record_assignment +type=expr +~~~ +# SOURCE +~~~roc +{}= + p + t +J +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +OpenCurly(1:1-1:2),CloseCurly(1:2-1:3),OpAssign(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:2-2:3),Newline(1:1-1:1), +LowerIdent(3:2-3:3),Newline(1:1-1:1), +UpperIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-record @1.1-1.3) +~~~ +# FORMATTED +~~~roc +{} +~~~ +# CANONICALIZE +~~~clojure +(e-empty_record @1.1-1.3 (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "{}")) +~~~ diff --git a/src/snapshots/old_syntax/str_block_multiple_newlines.md b/src/snapshots/old_syntax/str_block_multiple_newlines.md new file mode 100644 index 0000000000..04927a4c92 --- /dev/null +++ b/src/snapshots/old_syntax/str_block_multiple_newlines.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=str_block_multiple_newlines +type=expr +~~~ +# SOURCE +~~~roc +""" + + +#"""# +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**str_block_multiple_newlines.md:1:1:1:4:** +```roc +""" +``` +^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:4),Newline(1:1-1:1), +Newline(1:1-1:1), +Newline(1:1-1:1), +EndOfFile(4:6-4:6), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.4 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/str_minus_pnc_call_multiline_str.md b/src/snapshots/old_syntax/str_minus_pnc_call_multiline_str.md new file mode 100644 index 0000000000..c7e9f0ecb0 --- /dev/null +++ b/src/snapshots/old_syntax/str_minus_pnc_call_multiline_str.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=str_minus_pnc_call_multiline_str +type=expr +~~~ +# SOURCE +~~~roc +"" -""""""() +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:2),StringEnd(1:2-1:3),OpUnaryMinus(1:4-1:5),MultilineStringStart(1:5-1:8),StringPart(1:8-1:8),MultilineStringEnd(1:8-1:11),NoSpaceOpenRound(1:11-1:12),CloseRound(1:12-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.3 + (e-string-part @1.2-1.2 (raw ""))) +~~~ +# FORMATTED +~~~roc +"" +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.3 (id 74) + (e-literal @1.2-1.2 (string ""))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/str_over_large_unicode_escape.md b/src/snapshots/old_syntax/str_over_large_unicode_escape.md new file mode 100644 index 0000000000..b76b9dc6f1 --- /dev/null +++ b/src/snapshots/old_syntax/str_over_large_unicode_escape.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=str_over_large_unicode_escape fail +type=expr +~~~ +# SOURCE +~~~roc +'\u(FFFFFFFFF)' +~~~ +# PROBLEMS +**UNCLOSED SINGLE QUOTE** +This character literal is missing a closing single quote. + +**UNEXPECTED TOKEN IN EXPRESSION** +The token **'\u(FFFFFFFFF)'** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**str_over_large_unicode_escape.md:1:1:1:16:** +```roc +'\u(FFFFFFFFF)' +``` +^^^^^^^^^^^^^^^ + + +# TOKENS +~~~zig +SingleQuote(1:1-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.16 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/string_without_escape.md b/src/snapshots/old_syntax/string_without_escape.md new file mode 100644 index 0000000000..1e9ca78382 --- /dev/null +++ b/src/snapshots/old_syntax/string_without_escape.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=string_without_escape +type=expr +~~~ +# SOURCE +~~~roc +"123 abc 456 def" +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:17),StringEnd(1:17-1:18),EndOfFile(1:18-1:18), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.18 + (e-string-part @1.2-1.17 (raw "123 abc 456 def"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.18 (id 74) + (e-literal @1.2-1.17 (string "123 abc 456 def"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/sub_minus_o_apply_minus_crash_bang.md b/src/snapshots/old_syntax/sub_minus_o_apply_minus_crash_bang.md new file mode 100644 index 0000000000..e990d3b970 --- /dev/null +++ b/src/snapshots/old_syntax/sub_minus_o_apply_minus_crash_bang.md @@ -0,0 +1,57 @@ +# META +~~~ini +description=sub_minus_o_apply_minus_crash_bang fail +type=expr +~~~ +# SOURCE +~~~roc +h- +-o -crash! +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-o** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**sub_minus_o_apply_minus_crash_bang.md:2:1:2:3:** +```roc +-o -crash! +``` +^^ + + +**UNDEFINED VARIABLE** +Nothing is named `h` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),Newline(1:1-1:1), +OpUnaryMinus(2:1-2:2),LowerIdent(2:2-2:3),OpUnaryMinus(2:4-2:5),LowerIdent(2:5-2:11),EndOfFile(2:11-2:11), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-2.3 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "h")) + (e-malformed @2.1-2.3 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +h - + +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-2.3 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/sub_var_with_spaces.md b/src/snapshots/old_syntax/sub_var_with_spaces.md new file mode 100644 index 0000000000..a19b736927 --- /dev/null +++ b/src/snapshots/old_syntax/sub_var_with_spaces.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=sub_var_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +x - 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:3-1:4),Int(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.6 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-int @1.5-1.6 (raw "2"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.6 (op "sub") (id 76) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.5-1.6 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/sub_with_spaces.md b/src/snapshots/old_syntax/sub_with_spaces.md new file mode 100644 index 0000000000..49b7dc41ed --- /dev/null +++ b/src/snapshots/old_syntax/sub_with_spaces.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=sub_with_spaces +type=expr +~~~ +# SOURCE +~~~roc +1 - 2 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpBinaryMinus(1:4-1:5),Int(1:8-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.9 (op "-") + (e-int @1.1-1.2 (raw "1")) + (e-int @1.8-1.9 (raw "2"))) +~~~ +# FORMATTED +~~~roc +1 - 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.9 (op "sub") (id 75) + (e-int @1.1-1.2 (value "1")) + (e-int @1.8-1.9 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/suffixed_question.md b/src/snapshots/old_syntax/suffixed_question.md new file mode 100644 index 0000000000..ad67b39071 --- /dev/null +++ b/src/snapshots/old_syntax/suffixed_question.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=suffixed_question +type=expr +~~~ +# SOURCE +~~~roc +Stdout.line??? +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **?** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**suffixed_question.md:1:14:1:15:** +```roc +Stdout.line??? +``` + ^ + + +**UNDEFINED VARIABLE** +Nothing is named `line` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +UpperIdent(1:1-1:7),NoSpaceDotLowerIdent(1:7-1:12),OpDoubleQuestion(1:12-1:14),NoSpaceOpQuestion(1:14-1:15),EndOfFile(1:15-1:15), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.15 (op "??") + (e-ident @1.1-1.12 (qaul "Stdout") (raw ".line")) + (e-malformed @1.14-1.15 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +Stdout.line ?? +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.15 (op "null_coalesce") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/suffixed_question_nested.md b/src/snapshots/old_syntax/suffixed_question_nested.md new file mode 100644 index 0000000000..9725a17161 --- /dev/null +++ b/src/snapshots/old_syntax/suffixed_question_nested.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=suffixed_question_nested +type=expr +~~~ +# SOURCE +~~~roc +foo? ( bar? baz) ( blah stuff) +~~~ +# PROBLEMS +**NOT IMPLEMENTED** +This feature is not yet implemented: canonicalize suffix_single_question expression + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),NoSpaceOpQuestion(1:4-1:5),OpenRound(1:7-1:8),LowerIdent(1:10-1:13),NoSpaceOpQuestion(1:13-1:14),LowerIdent(1:15-1:18),CloseRound(1:18-1:19),OpenRound(1:21-1:22),LowerIdent(1:23-1:27),LowerIdent(1:28-1:33),CloseRound(1:33-1:34),EndOfFile(1:34-1:34), +~~~ +# PARSE +~~~clojure +(e-question-suffix @1.1-1.5 + (e-ident @1.1-1.4 (qaul "") (raw "foo"))) +~~~ +# FORMATTED +~~~roc +foo? +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "not_implemented") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tag_destructure_bang.md b/src/snapshots/old_syntax/tag_destructure_bang.md new file mode 100644 index 0000000000..e6a6d66605 --- /dev/null +++ b/src/snapshots/old_syntax/tag_destructure_bang.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=tag_destructure_bang +type=expr +~~~ +# SOURCE +~~~roc +Config launchTheNukes! code = cfg + +launchTheNukes! code +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:7),LowerIdent(1:8-1:23),LowerIdent(1:24-1:28),OpAssign(1:29-1:30),LowerIdent(1:31-1:34),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:16),LowerIdent(3:17-3:21),EndOfFile(3:21-3:21), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.7 (raw "Config")) +~~~ +# FORMATTED +~~~roc +Config +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.7 (ext-var 73) (name "Config") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Config]*")) +~~~ diff --git a/src/snapshots/old_syntax/tag_destructure_bang_no_space.md b/src/snapshots/old_syntax/tag_destructure_bang_no_space.md new file mode 100644 index 0000000000..c53c613be9 --- /dev/null +++ b/src/snapshots/old_syntax/tag_destructure_bang_no_space.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=tag_destructure_bang_no_space +type=expr +~~~ +# SOURCE +~~~roc +Config launchTheNukes!code = cfg + +launchTheNukes! code +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:7),LowerIdent(1:8-1:27),OpAssign(1:28-1:29),LowerIdent(1:30-1:33),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:16),LowerIdent(3:17-3:21),EndOfFile(3:21-3:21), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.7 (raw "Config")) +~~~ +# FORMATTED +~~~roc +Config +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.7 (ext-var 73) (name "Config") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Config]*")) +~~~ diff --git a/src/snapshots/old_syntax/tag_pattern.md b/src/snapshots/old_syntax/tag_pattern.md new file mode 100644 index 0000000000..c171b578f9 --- /dev/null +++ b/src/snapshots/old_syntax/tag_pattern.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=tag_pattern +type=expr +~~~ +# SOURCE +~~~roc +\Thing -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\Thing** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**tag_pattern.md:1:1:1:7:** +```roc +\Thing -> 42 +``` +^^^^^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:7),OpArrow(1:8-1:10),Int(1:11-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.7 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_ann_with_as.md b/src/snapshots/old_syntax/tag_union_ann_with_as.md new file mode 100644 index 0000000000..db4710a9f7 --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_ann_with_as.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=tag_union_ann_with_as +type=expr +~~~ +# SOURCE +~~~roc +1:[N(*as(S))] +_ +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),OpenSquare(1:3-1:4),UpperIdent(1:4-1:5),NoSpaceOpenRound(1:5-1:6),OpStar(1:6-1:7),KwAs(1:7-1:9),NoSpaceOpenRound(1:9-1:10),UpperIdent(1:10-1:11),CloseRound(1:11-1:12),CloseRound(1:12-1:13),CloseSquare(1:13-1:14),Newline(1:1-1:1), +Underscore(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_end.md b/src/snapshots/old_syntax/tag_union_end.md new file mode 100644 index 0000000000..32bb346764 --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_end.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=tag_union_end fail +type=expr +~~~ +# SOURCE +~~~roc +f : [Yes, +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenSquare(1:5-1:6),UpperIdent(1:6-1:9),Comma(1:9-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_functions_as.md b/src/snapshots/old_syntax/tag_union_functions_as.md new file mode 100644 index 0000000000..48ff9010f3 --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_functions_as.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=tag_union_functions_as +type=expr +~~~ +# SOURCE +~~~roc +main_for_host : [StdoutWrite Str ({} -> Op), StderrWrite Str ({} -> Op), Done] as Op +main_for_host = main +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `main_for_host` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:14),OpColon(1:15-1:16),OpenSquare(1:17-1:18),UpperIdent(1:18-1:29),UpperIdent(1:30-1:33),OpenRound(1:34-1:35),OpenCurly(1:35-1:36),CloseCurly(1:36-1:37),OpArrow(1:38-1:40),UpperIdent(1:41-1:43),CloseRound(1:43-1:44),Comma(1:44-1:45),UpperIdent(1:46-1:57),UpperIdent(1:58-1:61),OpenRound(1:62-1:63),OpenCurly(1:63-1:64),CloseCurly(1:64-1:65),OpArrow(1:66-1:68),UpperIdent(1:69-1:71),CloseRound(1:71-1:72),Comma(1:72-1:73),UpperIdent(1:74-1:78),CloseSquare(1:78-1:79),KwAs(1:80-1:82),UpperIdent(1:83-1:85),Newline(1:1-1:1), +LowerIdent(2:1-2:14),OpAssign(2:15-2:16),LowerIdent(2:17-2:21),Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.14 (qaul "") (raw "main_for_host")) +~~~ +# FORMATTED +~~~roc +main_for_host +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_lowercase_tag_name.md b/src/snapshots/old_syntax/tag_union_lowercase_tag_name.md new file mode 100644 index 0000000000..7bfc3e2410 --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_lowercase_tag_name.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=tag_union_lowercase_tag_name fail +type=expr +~~~ +# SOURCE +~~~roc +f : [lowercase] +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenSquare(1:5-1:6),LowerIdent(1:6-1:15),CloseSquare(1:15-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_open.md b/src/snapshots/old_syntax/tag_union_open.md new file mode 100644 index 0000000000..4958231caa --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_open.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=tag_union_open fail +type=expr +~~~ +# SOURCE +~~~roc +f : [ +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenSquare(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tag_union_second_lowercase_tag_name.md b/src/snapshots/old_syntax/tag_union_second_lowercase_tag_name.md new file mode 100644 index 0000000000..17b96a5d1d --- /dev/null +++ b/src/snapshots/old_syntax/tag_union_second_lowercase_tag_name.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=tag_union_second_lowercase_tag_name fail +type=expr +~~~ +# SOURCE +~~~roc +f : [Good, bad] +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenSquare(1:5-1:6),UpperIdent(1:6-1:10),Comma(1:10-1:11),LowerIdent(1:12-1:15),CloseSquare(1:15-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/ten_times_eleven.md b/src/snapshots/old_syntax/ten_times_eleven.md new file mode 100644 index 0000000000..466611322a --- /dev/null +++ b/src/snapshots/old_syntax/ten_times_eleven.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=ten_times_eleven +type=expr +~~~ +# SOURCE +~~~roc +10*11 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:3),OpStar(1:3-1:4),Int(1:4-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.6 (op "*") + (e-int @1.1-1.3 (raw "10")) + (e-int @1.4-1.6 (raw "11"))) +~~~ +# FORMATTED +~~~roc +10 * 11 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.6 (op "mul") (id 75) + (e-int @1.1-1.3 (value "10")) + (e-int @1.4-1.6 (value "11"))) +~~~ +# TYPES +~~~clojure +(expr (id 75) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/three_arg_closure.md b/src/snapshots/old_syntax/three_arg_closure.md new file mode 100644 index 0000000000..4feecebe7e --- /dev/null +++ b/src/snapshots/old_syntax/three_arg_closure.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=three_arg_closure +type=expr +~~~ +# SOURCE +~~~roc +\a, b, c -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\a** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**three_arg_closure.md:1:1:1:3:** +```roc +\a, b, c -> 42 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),Comma(1:3-1:4),LowerIdent(1:5-1:6),Comma(1:6-1:7),LowerIdent(1:8-1:9),OpArrow(1:10-1:12),Int(1:13-1:15),EndOfFile(1:15-1:15), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/trailing_operator.md b/src/snapshots/old_syntax/trailing_operator.md new file mode 100644 index 0000000000..60d332a7f9 --- /dev/null +++ b/src/snapshots/old_syntax/trailing_operator.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=trailing_operator fail +type=expr +~~~ +# SOURCE +~~~roc +J- +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**trailing_operator.md:1:3:1:3:** +```roc +J- +``` + + + +**UNKNOWN OPERATOR** +This looks like an operator, but it's not one I recognize! +Check the spelling and make sure you're using a valid Roc operator. + +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),EndOfFile(1:3-1:3), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.3 (op "-") + (e-tag @1.1-1.2 (raw "J")) + (e-malformed @1.3-1.3 (reason "expr_unexpected_token"))) +~~~ +# FORMATTED +~~~roc +J - +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.3 (op "sub") (id 77) + (e-tag @1.1-1.2 (ext-var 73) (name "J") (args "TODO")) + (e-runtime-error (tag "expr_not_canonicalized"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/triple_paren_pat_ann.md b/src/snapshots/old_syntax/triple_paren_pat_ann.md new file mode 100644 index 0000000000..eaa7781a03 --- /dev/null +++ b/src/snapshots/old_syntax/triple_paren_pat_ann.md @@ -0,0 +1,52 @@ +# META +~~~ini +description=triple_paren_pat_ann +type=expr +~~~ +# SOURCE +~~~roc +1((0(0 +)))f:f +i +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),NoSpaceOpenRound(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Int(1:4-1:5),NoSpaceOpenRound(1:5-1:6),Int(1:6-1:7),Newline(1:1-1:1), +CloseRound(2:1-2:2),CloseRound(2:2-2:3),CloseRound(2:3-2:4),LowerIdent(2:4-2:5),OpColon(2:5-2:6),LowerIdent(2:6-2:7),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-apply @1.1-2.4 + (e-int @1.1-1.2 (raw "1")) + (e-tuple @1.3-2.3 + (e-apply @1.4-2.2 + (e-int @1.4-1.5 (raw "0")) + (e-int @1.6-1.7 (raw "0"))))) +~~~ +# FORMATTED +~~~roc +1( + ( + 0( + 0, + ), + ), +) +~~~ +# CANONICALIZE +~~~clojure +(e-call @1.1-2.4 (id 80) + (e-int @1.1-1.2 (value "1")) + (e-tuple @1.3-2.3 + (elems + (e-call @1.4-2.2 + (e-int @1.4-1.5 (value "0")) + (e-int @1.6-1.7 (value "0")))))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/triple_quote_craziness.md b/src/snapshots/old_syntax/triple_quote_craziness.md new file mode 100644 index 0000000000..50be4a29b0 --- /dev/null +++ b/src/snapshots/old_syntax/triple_quote_craziness.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=triple_quote_craziness +type=expr +~~~ +# SOURCE +~~~roc +H""""""=f"""""" +f! +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),MultilineStringStart(1:2-1:5),StringPart(1:5-1:5),MultilineStringEnd(1:5-1:8),OpAssign(1:8-1:9),LowerIdent(1:9-1:10),MultilineStringStart(1:10-1:13),StringPart(1:13-1:13),MultilineStringEnd(1:13-1:16),Newline(1:1-1:1), +LowerIdent(2:1-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "H")) +~~~ +# FORMATTED +~~~roc +H +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "H") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[H]*")) +~~~ diff --git a/src/snapshots/old_syntax/triple_quote_newline_after_dollar.md b/src/snapshots/old_syntax/triple_quote_newline_after_dollar.md new file mode 100644 index 0000000000..150247a45d --- /dev/null +++ b/src/snapshots/old_syntax/triple_quote_newline_after_dollar.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=triple_quote_newline_after_dollar fail +type=expr +~~~ +# SOURCE +~~~roc +"""$ +( +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **"""$** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**triple_quote_newline_after_dollar.md:1:1:1:5:** +```roc +"""$ +``` +^^^^ + + +# TOKENS +~~~zig +MultilineStringStart(1:1-1:4),StringPart(1:4-1:5),Newline(1:1-1:1), +OpenRound(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/try_blank_in_list.md b/src/snapshots/old_syntax/try_blank_in_list.md new file mode 100644 index 0000000000..7dd6d825be --- /dev/null +++ b/src/snapshots/old_syntax/try_blank_in_list.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=try_blank_in_list +type=expr +~~~ +# SOURCE +~~~roc +L[try#[then2[# +] +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpenSquare(1:2-1:3),LowerIdent(1:3-1:6),Newline(1:7-1:15), +CloseSquare(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "L")) +~~~ +# FORMATTED +~~~roc +L +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "L") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[L]*")) +~~~ diff --git a/src/snapshots/old_syntax/try_function_after_pipe.md b/src/snapshots/old_syntax/try_function_after_pipe.md new file mode 100644 index 0000000000..1e0af9cf35 --- /dev/null +++ b/src/snapshots/old_syntax/try_function_after_pipe.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=try_function_after_pipe +type=expr +~~~ +# SOURCE +~~~roc +"123" + |> try Str.toU64 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:5),StringEnd(1:5-1:6),Newline(1:1-1:1), +OpPizza(2:8-2:10),LowerIdent(2:11-2:14),UpperIdent(2:15-2:18),NoSpaceDotLowerIdent(2:18-2:24),EndOfFile(2:24-2:24), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.6 + (e-string-part @1.2-1.5 (raw "123"))) +~~~ +# FORMATTED +~~~roc +"123" +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.6 (id 74) + (e-literal @1.2-1.5 (string "123"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/try_pipe_suffix.md b/src/snapshots/old_syntax/try_pipe_suffix.md new file mode 100644 index 0000000000..1213c44d22 --- /dev/null +++ b/src/snapshots/old_syntax/try_pipe_suffix.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=try_pipe_suffix +type=expr +~~~ +# SOURCE +~~~roc +Str.toU64 "123"|> try +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `toU64` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +UpperIdent(1:1-1:4),NoSpaceDotLowerIdent(1:4-1:10),StringStart(1:11-1:12),StringPart(1:12-1:15),StringEnd(1:15-1:16),OpPizza(1:16-1:18),LowerIdent(1:19-1:22),EndOfFile(1:22-1:22), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.10 (qaul "Str") (raw ".toU64")) +~~~ +# FORMATTED +~~~roc +Str.toU64 +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/try_plain_prefix.md b/src/snapshots/old_syntax/try_plain_prefix.md new file mode 100644 index 0000000000..767bf5fb28 --- /dev/null +++ b/src/snapshots/old_syntax/try_plain_prefix.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=try_plain_prefix +type=expr +~~~ +# SOURCE +~~~roc +try Str.toU64 "123" +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `try` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),UpperIdent(1:6-1:9),NoSpaceDotLowerIdent(1:9-1:15),StringStart(1:17-1:18),StringPart(1:18-1:21),StringEnd(1:21-1:22),EndOfFile(1:22-1:22), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "try")) +~~~ +# FORMATTED +~~~roc +try +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/try_subtract.md b/src/snapshots/old_syntax/try_subtract.md new file mode 100644 index 0000000000..632400285f --- /dev/null +++ b/src/snapshots/old_syntax/try_subtract.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=try_subtract +type=expr +~~~ +# SOURCE +~~~roc +try-w +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `try` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `w` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpBinaryMinus(1:4-1:5),LowerIdent(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.6 (op "-") + (e-ident @1.1-1.4 (qaul "") (raw "try")) + (e-ident @1.5-1.6 (qaul "") (raw "w"))) +~~~ +# FORMATTED +~~~roc +try - w +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.6 (op "sub") (id 77) + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope"))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_access_after_ident.md b/src/snapshots/old_syntax/tuple_access_after_ident.md new file mode 100644 index 0000000000..a5cadd68e6 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_access_after_ident.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=tuple_access_after_ident +type=expr +~~~ +# SOURCE +~~~roc +abc = (1, 2, 3) +abc.0 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `abc` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpAssign(1:5-1:6),OpenRound(1:7-1:8),Int(1:8-1:9),Comma(1:9-1:10),Int(1:11-1:12),Comma(1:12-1:13),Int(1:14-1:15),CloseRound(1:15-1:16),Newline(1:1-1:1), +LowerIdent(2:1-2:4),NoSpaceDotInt(2:4-2:6),EndOfFile(2:6-2:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "abc")) +~~~ +# FORMATTED +~~~roc +abc +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_access_after_record.md b/src/snapshots/old_syntax/tuple_access_after_record.md new file mode 100644 index 0000000000..4889c40503 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_access_after_record.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=tuple_access_after_record +type=expr +~~~ +# SOURCE +~~~roc +{ a: (1, 2) }.a.0 +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expr_no_space_dot_int` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**tuple_access_after_record.md:1:16:1:18:** +```roc +{ a: (1, 2) }.a.0 +``` + ^^ + + +# TOKENS +~~~zig +OpenCurly(1:1-1:2),LowerIdent(1:3-1:4),OpColon(1:4-1:5),OpenRound(1:6-1:7),Int(1:7-1:8),Comma(1:8-1:9),Int(1:10-1:11),CloseRound(1:11-1:12),CloseCurly(1:13-1:14),NoSpaceDotLowerIdent(1:14-1:16),NoSpaceDotInt(1:16-1:18),EndOfFile(1:18-1:18), +~~~ +# PARSE +~~~clojure +(e-malformed @1.16-1.18 (reason "expr_no_space_dot_int")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/tuple_accessor_function.md b/src/snapshots/old_syntax/tuple_accessor_function.md new file mode 100644 index 0000000000..dbd6c964c2 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_accessor_function.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=tuple_accessor_function +type=expr +~~~ +# SOURCE +~~~roc +.1 (1, 2, 3) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **.1 (** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**tuple_accessor_function.md:1:1:1:5:** +```roc +.1 (1, 2, 3) +``` +^^^^ + + +# TOKENS +~~~zig +DotInt(1:1-1:3),OpenRound(1:4-1:5),Int(1:5-1:6),Comma(1:6-1:7),Int(1:8-1:9),Comma(1:9-1:10),Int(1:11-1:12),CloseRound(1:12-1:13),EndOfFile(1:13-1:13), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/tuple_apply_parens_comment.md b/src/snapshots/old_syntax/tuple_apply_parens_comment.md new file mode 100644 index 0000000000..d424d5b1e4 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_apply_parens_comment.md @@ -0,0 +1,58 @@ +# META +~~~ini +description=tuple_apply_parens_comment +type=expr +~~~ +# SOURCE +~~~roc +((L +L)L,L)#\ +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**tuple_apply_parens_comment.md:2:2:2:4:** +```roc +L)L,L)#\ +``` + ^^ + + +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**tuple_apply_parens_comment.md:2:6:2:9:** +```roc +L)L,L)#\ +``` + ^^^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),NoSpaceOpenRound(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +UpperIdent(2:1-2:2),CloseRound(2:2-2:3),UpperIdent(2:3-2:4),Comma(2:4-2:5),UpperIdent(2:5-2:6),CloseRound(2:6-2:7),EndOfFile(2:9-2:9), +~~~ +# PARSE +~~~clojure +(e-malformed @2.6-2.9 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/tuple_destructure_bang.md b/src/snapshots/old_syntax/tuple_destructure_bang.md new file mode 100644 index 0000000000..7e9ac39e18 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_destructure_bang.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=tuple_destructure_bang +type=expr +~~~ +# SOURCE +~~~roc +(launchTheNukes!, code) = config + +launchTheNukes! code +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `launchTheNukes!` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `code` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:17),Comma(1:17-1:18),LowerIdent(1:19-1:23),CloseRound(1:23-1:24),OpAssign(1:25-1:26),LowerIdent(1:27-1:33),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:16),LowerIdent(3:17-3:21),EndOfFile(3:21-3:21), +~~~ +# PARSE +~~~clojure +(e-tuple @1.1-1.24 + (e-ident @1.2-1.17 (qaul "") (raw "launchTheNukes!")) + (e-ident @1.19-1.23 (qaul "") (raw "code"))) +~~~ +# FORMATTED +~~~roc +(launchTheNukes!, code) +~~~ +# CANONICALIZE +~~~clojure +(e-tuple @1.1-1.24 (id 77) + (elems + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 77) (type "(Error, Error)")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_funcs_in_parens.md b/src/snapshots/old_syntax/tuple_funcs_in_parens.md new file mode 100644 index 0000000000..23a31c5695 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_funcs_in_parens.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=tuple_funcs_in_parens +type=expr +~~~ +# SOURCE +~~~roc +f: (a, b -> c, d -> e, g) +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),OpenRound(1:4-1:5),LowerIdent(1:5-1:6),Comma(1:6-1:7),LowerIdent(1:8-1:9),OpArrow(1:10-1:12),LowerIdent(1:13-1:14),Comma(1:14-1:15),LowerIdent(1:16-1:17),OpArrow(1:18-1:20),LowerIdent(1:21-1:22),Comma(1:22-1:23),LowerIdent(1:24-1:25),CloseRound(1:25-1:26),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_function_annotation.md b/src/snapshots/old_syntax/tuple_function_annotation.md new file mode 100644 index 0000000000..53a01b7e25 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_function_annotation.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=tuple_function_annotation +type=expr +~~~ +# SOURCE +~~~roc +11 +:(I,s +,Mw->r)l +asl +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:3),Newline(1:1-1:1), +OpColon(2:1-2:2),NoSpaceOpenRound(2:2-2:3),UpperIdent(2:3-2:4),Comma(2:4-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +Comma(3:1-3:2),UpperIdent(3:2-3:4),OpArrow(3:4-3:6),LowerIdent(3:6-3:7),CloseRound(3:7-3:8),LowerIdent(3:8-3:9),Newline(1:1-1:1), +LowerIdent(4:1-4:4),EndOfFile(4:4-4:4), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.3 (raw "11")) +~~~ +# FORMATTED +~~~roc +11 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.3 (value "11") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_type.md b/src/snapshots/old_syntax/tuple_type.md new file mode 100644 index 0000000000..720e9b8d13 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_type.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=tuple_type +type=expr +~~~ +# SOURCE +~~~roc +f: (Str, Str) -> (Str, Str) +f = \x -> x + +f (1, 2) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),OpenRound(1:4-1:5),UpperIdent(1:5-1:8),Comma(1:8-1:9),UpperIdent(1:10-1:13),CloseRound(1:13-1:14),OpArrow(1:15-1:17),OpenRound(1:18-1:19),UpperIdent(1:19-1:22),Comma(1:22-1:23),UpperIdent(1:24-1:27),CloseRound(1:27-1:28),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),OpBackslash(2:5-2:6),LowerIdent(2:6-2:7),OpArrow(2:8-2:10),LowerIdent(2:11-2:12),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),OpenRound(4:3-4:4),Int(4:4-4:5),Comma(4:5-4:6),Int(4:7-4:8),CloseRound(4:8-4:9),EndOfFile(4:9-4:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tuple_type_ext.md b/src/snapshots/old_syntax/tuple_type_ext.md new file mode 100644 index 0000000000..28e7e7e4a8 --- /dev/null +++ b/src/snapshots/old_syntax/tuple_type_ext.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=tuple_type_ext +type=expr +~~~ +# SOURCE +~~~roc +f: (Str, Str)a -> (Str, Str)a +f = \x -> x + +f (1, 2) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),OpenRound(1:4-1:5),UpperIdent(1:5-1:8),Comma(1:8-1:9),UpperIdent(1:10-1:13),CloseRound(1:13-1:14),LowerIdent(1:14-1:15),OpArrow(1:16-1:18),OpenRound(1:19-1:20),UpperIdent(1:20-1:23),Comma(1:23-1:24),UpperIdent(1:25-1:28),CloseRound(1:28-1:29),LowerIdent(1:29-1:30),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),OpBackslash(2:5-2:6),LowerIdent(2:6-2:7),OpArrow(2:8-2:10),LowerIdent(2:11-2:12),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),OpenRound(4:3-4:4),Int(4:4-4:5),Comma(4:5-4:6),Int(4:7-4:8),CloseRound(4:8-4:9),EndOfFile(4:9-4:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/tuples_parens_comments.md b/src/snapshots/old_syntax/tuples_parens_comments.md new file mode 100644 index 0000000000..c4fbc5a12b --- /dev/null +++ b/src/snapshots/old_syntax/tuples_parens_comments.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=tuples_parens_comments +type=expr +~~~ +# SOURCE +~~~roc +(i,# + +( +# +(EsE)) +ui) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**tuples_parens_comments.md:6:3:6:4:** +```roc +ui) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),Comma(1:3-1:4),Newline(1:5-1:5), +Newline(1:1-1:1), +OpenRound(3:1-3:2),Newline(1:1-1:1), +Newline(4:2-4:2), +OpenRound(5:1-5:2),UpperIdent(5:2-5:5),CloseRound(5:5-5:6),CloseRound(5:6-5:7),Newline(1:1-1:1), +LowerIdent(6:1-6:3),CloseRound(6:3-6:4),EndOfFile(6:4-6:4), +~~~ +# PARSE +~~~clojure +(e-malformed @6.3-6.4 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/two_arg_closure.md b/src/snapshots/old_syntax/two_arg_closure.md new file mode 100644 index 0000000000..d2ff48108f --- /dev/null +++ b/src/snapshots/old_syntax/two_arg_closure.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=two_arg_closure +type=expr +~~~ +# SOURCE +~~~roc +\a, b -> 42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\a** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**two_arg_closure.md:1:1:1:3:** +```roc +\a, b -> 42 +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),LowerIdent(1:2-1:3),Comma(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),Int(1:10-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/two_branch_when.md b/src/snapshots/old_syntax/two_branch_when.md new file mode 100644 index 0000000000..6d3bf43393 --- /dev/null +++ b/src/snapshots/old_syntax/two_branch_when.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=two_branch_when +type=expr +~~~ +# SOURCE +~~~roc +when x is + "" -> 1 + "mise" -> 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +StringStart(2:2-2:3),StringPart(2:3-2:3),StringEnd(2:3-2:4),OpArrow(2:5-2:7),Int(2:8-2:9),Newline(1:1-1:1), +StringStart(3:2-3:3),StringPart(3:3-3:7),StringEnd(3:7-3:8),OpArrow(3:9-3:11),Int(3:12-3:13),EndOfFile(3:13-3:13), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/two_spaced_def.md b/src/snapshots/old_syntax/two_spaced_def.md new file mode 100644 index 0000000000..eecc08b582 --- /dev/null +++ b/src/snapshots/old_syntax/two_spaced_def.md @@ -0,0 +1,53 @@ +# META +~~~ini +description=two_spaced_def +type=expr +~~~ +# SOURCE +~~~roc +# leading comment +x = 5 +y = 6 + +42 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token ** leading comment +x** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**two_spaced_def.md:1:2:2:2:** +```roc +# leading comment +x = 5 +``` + + +# TOKENS +~~~zig +Newline(1:2-1:18), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +LowerIdent(3:1-3:2),OpAssign(3:3-3:4),Int(3:5-3:6),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(5:1-5:3),EndOfFile(5:3-5:3), +~~~ +# PARSE +~~~clojure +(e-malformed @1.2-2.2 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/type_ann_tag_union_parens_applies.md b/src/snapshots/old_syntax/type_ann_tag_union_parens_applies.md new file mode 100644 index 0000000000..cf5037120e --- /dev/null +++ b/src/snapshots/old_syntax/type_ann_tag_union_parens_applies.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=type_ann_tag_union_parens_applies +type=expr +~~~ +# SOURCE +~~~roc +1:[N(H(S +))] +_ +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),OpenSquare(1:3-1:4),UpperIdent(1:4-1:5),NoSpaceOpenRound(1:5-1:6),UpperIdent(1:6-1:7),NoSpaceOpenRound(1:7-1:8),UpperIdent(1:8-1:9),Newline(1:1-1:1), +CloseRound(2:1-2:2),CloseRound(2:2-2:3),CloseSquare(2:3-2:4),Newline(1:1-1:1), +Underscore(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/type_annotation_double_colon.md b/src/snapshots/old_syntax/type_annotation_double_colon.md new file mode 100644 index 0000000000..e32a441dab --- /dev/null +++ b/src/snapshots/old_syntax/type_annotation_double_colon.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_annotation_double_colon fail +type=expr +~~~ +# SOURCE +~~~roc +f :: I64 +f = 42 + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpColon(1:4-1:5),UpperIdent(1:6-1:9),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:7),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_apply_stray_dot.md b/src/snapshots/old_syntax/type_apply_stray_dot.md new file mode 100644 index 0000000000..6501adc7d8 --- /dev/null +++ b/src/snapshots/old_syntax/type_apply_stray_dot.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=type_apply_stray_dot fail +type=expr +~~~ +# SOURCE +~~~roc +f : . +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),Dot(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_argument_arrow_then_nothing.md b/src/snapshots/old_syntax/type_argument_arrow_then_nothing.md new file mode 100644 index 0000000000..a1a9d6818a --- /dev/null +++ b/src/snapshots/old_syntax/type_argument_arrow_then_nothing.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_argument_arrow_then_nothing fail +type=expr +~~~ +# SOURCE +~~~roc +f : I64, I64 -> +f = 0 + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),Comma(1:8-1:9),UpperIdent(1:10-1:13),OpArrow(1:14-1:16),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_argument_no_arrow.md b/src/snapshots/old_syntax/type_argument_no_arrow.md new file mode 100644 index 0000000000..91658d7f7b --- /dev/null +++ b/src/snapshots/old_syntax/type_argument_no_arrow.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_argument_no_arrow fail +type=expr +~~~ +# SOURCE +~~~roc +f : I64, I64 +f = 0 + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),Comma(1:8-1:9),UpperIdent(1:10-1:13),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_decl_with_underscore.md b/src/snapshots/old_syntax/type_decl_with_underscore.md new file mode 100644 index 0000000000..b6824bfa42 --- /dev/null +++ b/src/snapshots/old_syntax/type_decl_with_underscore.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=type_decl_with_underscore +type=expr +~~~ +# SOURCE +~~~roc +doStuff : UserId -> Dict Str _ +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `doStuff` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:8),OpColon(1:9-1:10),UpperIdent(1:11-1:17),OpArrow(1:18-1:20),UpperIdent(1:21-1:25),UpperIdent(1:26-1:29),Underscore(1:30-1:31),Newline(1:1-1:1), +Int(2:1-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.8 (qaul "") (raw "doStuff")) +~~~ +# FORMATTED +~~~roc +doStuff +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_double_comma.md b/src/snapshots/old_syntax/type_double_comma.md new file mode 100644 index 0000000000..1e53a538b6 --- /dev/null +++ b/src/snapshots/old_syntax/type_double_comma.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_double_comma fail +type=expr +~~~ +# SOURCE +~~~roc +f : I64,,I64 -> I64 +f = 0 + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),Comma(1:8-1:9),Comma(1:9-1:10),UpperIdent(1:10-1:13),OpArrow(1:14-1:16),UpperIdent(1:17-1:20),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_in_parens_end.md b/src/snapshots/old_syntax/type_in_parens_end.md new file mode 100644 index 0000000000..4a15c6e590 --- /dev/null +++ b/src/snapshots/old_syntax/type_in_parens_end.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=type_in_parens_end fail +type=expr +~~~ +# SOURCE +~~~roc +f : ( I64 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenRound(1:5-1:6),UpperIdent(1:7-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_in_parens_start.md b/src/snapshots/old_syntax/type_in_parens_start.md new file mode 100644 index 0000000000..019bbaa0eb --- /dev/null +++ b/src/snapshots/old_syntax/type_in_parens_start.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=type_in_parens_start fail +type=expr +~~~ +# SOURCE +~~~roc +f : ( +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),OpenRound(1:5-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_inline_alias.md b/src/snapshots/old_syntax/type_inline_alias.md new file mode 100644 index 0000000000..3ee3176ecf --- /dev/null +++ b/src/snapshots/old_syntax/type_inline_alias.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_inline_alias fail +type=expr +~~~ +# SOURCE +~~~roc +f : I64 as +f = 0 + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),UpperIdent(1:5-1:8),KwAs(1:9-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:2),OpAssign(2:3-2:4),Int(2:5-2:6),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_signature_def.md b/src/snapshots/old_syntax/type_signature_def.md new file mode 100644 index 0000000000..fb9f1f0f00 --- /dev/null +++ b/src/snapshots/old_syntax/type_signature_def.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_signature_def +type=expr +~~~ +# SOURCE +~~~roc +foo : Int +foo = 4 + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `foo` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpColon(1:5-1:6),UpperIdent(1:7-1:10),Newline(1:1-1:1), +LowerIdent(2:1-2:4),OpAssign(2:5-2:6),Int(2:7-2:8),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "foo")) +~~~ +# FORMATTED +~~~roc +foo +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_signature_function_def.md b/src/snapshots/old_syntax/type_signature_function_def.md new file mode 100644 index 0000000000..f42394c22c --- /dev/null +++ b/src/snapshots/old_syntax/type_signature_function_def.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=type_signature_function_def +type=expr +~~~ +# SOURCE +~~~roc +foo : Int, Float -> Bool +foo = \x, _ -> 42 + +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `foo` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:4),OpColon(1:5-1:6),UpperIdent(1:7-1:10),Comma(1:10-1:11),UpperIdent(1:12-1:17),OpArrow(1:18-1:20),UpperIdent(1:21-1:25),Newline(1:1-1:1), +LowerIdent(2:1-2:4),OpAssign(2:5-2:6),OpBackslash(2:7-2:8),LowerIdent(2:8-2:9),Comma(2:9-2:10),Underscore(2:11-2:12),OpArrow(2:13-2:15),Int(2:16-2:18),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(4:1-4:3),EndOfFile(4:3-4:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.4 (qaul "") (raw "foo")) +~~~ +# FORMATTED +~~~roc +foo +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/type_tuple_where_annotation.md b/src/snapshots/old_syntax/type_tuple_where_annotation.md new file mode 100644 index 0000000000..ec71f7ed93 --- /dev/null +++ b/src/snapshots/old_syntax/type_tuple_where_annotation.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=type_tuple_where_annotation +type=expr +~~~ +# SOURCE +~~~roc +nextWhileLess : List Bucket, k, U8 -> (U64, U32) where k implements Hash & Eq +nextWhileLess = \buckets, key, shifts -> foo +nextWhileLess +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `nextWhileLess` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:14),OpColon(1:15-1:16),UpperIdent(1:17-1:21),UpperIdent(1:22-1:28),Comma(1:28-1:29),LowerIdent(1:30-1:31),Comma(1:31-1:32),UpperIdent(1:33-1:35),OpArrow(1:36-1:38),OpenRound(1:39-1:40),UpperIdent(1:40-1:43),Comma(1:43-1:44),UpperIdent(1:45-1:48),CloseRound(1:48-1:49),KwWhere(1:50-1:55),LowerIdent(1:56-1:57),KwImplements(1:58-1:68),UpperIdent(1:69-1:73),OpAmpersand(1:74-1:75),UpperIdent(1:76-1:78),Newline(1:1-1:1), +LowerIdent(2:1-2:14),OpAssign(2:15-2:16),OpBackslash(2:17-2:18),LowerIdent(2:18-2:25),Comma(2:25-2:26),LowerIdent(2:27-2:30),Comma(2:30-2:31),LowerIdent(2:32-2:38),OpArrow(2:39-2:41),LowerIdent(2:42-2:45),Newline(1:1-1:1), +LowerIdent(3:1-3:14),EndOfFile(3:14-3:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.14 (qaul "") (raw "nextWhileLess")) +~~~ +# FORMATTED +~~~roc +nextWhileLess +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/unary_negation.md b/src/snapshots/old_syntax/unary_negation.md new file mode 100644 index 0000000000..1ff876205c --- /dev/null +++ b/src/snapshots/old_syntax/unary_negation.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=unary_negation +type=expr +~~~ +# SOURCE +~~~roc +-foo +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-foo** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unary_negation.md:1:1:1:5:** +```roc +-foo +``` +^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),LowerIdent(1:2-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.5 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/unary_negation_access.md b/src/snapshots/old_syntax/unary_negation_access.md new file mode 100644 index 0000000000..cfef1461cf --- /dev/null +++ b/src/snapshots/old_syntax/unary_negation_access.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=unary_negation_access +type=expr +~~~ +# SOURCE +~~~roc +-rec1.field +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-rec1** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unary_negation_access.md:1:1:1:6:** +```roc +-rec1.field +``` +^^^^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),LowerIdent(1:2-1:6),NoSpaceDotLowerIdent(1:6-1:12),EndOfFile(1:12-1:12), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.6 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/unary_negation_arg.md b/src/snapshots/old_syntax/unary_negation_arg.md new file mode 100644 index 0000000000..10e3b21523 --- /dev/null +++ b/src/snapshots/old_syntax/unary_negation_arg.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=unary_negation_arg +type=expr +~~~ +# SOURCE +~~~roc +whee 12 -foo +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whee` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:7-1:9),OpUnaryMinus(1:10-1:11),LowerIdent(1:11-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "whee")) +~~~ +# FORMATTED +~~~roc +whee +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/unary_negation_with_parens.md b/src/snapshots/old_syntax/unary_negation_with_parens.md new file mode 100644 index 0000000000..7f54620620 --- /dev/null +++ b/src/snapshots/old_syntax/unary_negation_with_parens.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=unary_negation_with_parens +type=expr +~~~ +# SOURCE +~~~roc +-(whee 12 foo) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **-(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unary_negation_with_parens.md:1:1:1:3:** +```roc +-(whee 12 foo) +``` +^^ + + +# TOKENS +~~~zig +OpUnaryMinus(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:7),Int(1:9-1:11),LowerIdent(1:12-1:15),CloseRound(1:15-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/unary_not.md b/src/snapshots/old_syntax/unary_not.md new file mode 100644 index 0000000000..4e482ec908 --- /dev/null +++ b/src/snapshots/old_syntax/unary_not.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=unary_not +type=expr +~~~ +# SOURCE +~~~roc +!blah +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!blah** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unary_not.md:1:1:1:6:** +```roc +!blah +``` +^^^^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),LowerIdent(1:2-1:6),EndOfFile(1:6-1:6), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.6 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/unary_not_with_parens.md b/src/snapshots/old_syntax/unary_not_with_parens.md new file mode 100644 index 0000000000..96459a2712 --- /dev/null +++ b/src/snapshots/old_syntax/unary_not_with_parens.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=unary_not_with_parens +type=expr +~~~ +# SOURCE +~~~roc +!(whee 12 foo) +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **!(** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unary_not_with_parens.md:1:1:1:3:** +```roc +!(whee 12 foo) +``` +^^ + + +# TOKENS +~~~zig +OpBang(1:1-1:2),NoSpaceOpenRound(1:2-1:3),LowerIdent(1:3-1:7),Int(1:9-1:11),LowerIdent(1:12-1:15),CloseRound(1:15-1:16),EndOfFile(1:16-1:16), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/underscore_expr_in_def.md b/src/snapshots/old_syntax/underscore_expr_in_def.md new file mode 100644 index 0000000000..0d6aaa780a --- /dev/null +++ b/src/snapshots/old_syntax/underscore_expr_in_def.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=underscore_expr_in_def +type=expr +~~~ +# SOURCE +~~~roc +J:R +n_p +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +LowerIdent(2:1-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "J")) +~~~ +# FORMATTED +~~~roc +J +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "J") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[J]*")) +~~~ diff --git a/src/snapshots/old_syntax/underscore_in_assignment_pattern.md b/src/snapshots/old_syntax/underscore_in_assignment_pattern.md new file mode 100644 index 0000000000..0e1872f9d9 --- /dev/null +++ b/src/snapshots/old_syntax/underscore_in_assignment_pattern.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=underscore_in_assignment_pattern +type=expr +~~~ +# SOURCE +~~~roc +Pair x _ = Pair 0 1 +Pair _ y = Pair 0 1 +Pair _ _ = Pair 0 1 +_ = Pair 0 1 +Pair (Pair x _) (Pair _ y) = Pair (Pair 0 1) (Pair 2 3) + +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:5),LowerIdent(1:6-1:7),Underscore(1:8-1:9),OpAssign(1:10-1:11),UpperIdent(1:12-1:16),Int(1:17-1:18),Int(1:19-1:20),Newline(1:1-1:1), +UpperIdent(2:1-2:5),Underscore(2:6-2:7),LowerIdent(2:8-2:9),OpAssign(2:10-2:11),UpperIdent(2:12-2:16),Int(2:17-2:18),Int(2:19-2:20),Newline(1:1-1:1), +UpperIdent(3:1-3:5),Underscore(3:6-3:7),Underscore(3:8-3:9),OpAssign(3:10-3:11),UpperIdent(3:12-3:16),Int(3:17-3:18),Int(3:19-3:20),Newline(1:1-1:1), +Underscore(4:1-4:2),OpAssign(4:3-4:4),UpperIdent(4:5-4:9),Int(4:10-4:11),Int(4:12-4:13),Newline(1:1-1:1), +UpperIdent(5:1-5:5),OpenRound(5:6-5:7),UpperIdent(5:7-5:11),LowerIdent(5:12-5:13),Underscore(5:14-5:15),CloseRound(5:15-5:16),OpenRound(5:17-5:18),UpperIdent(5:18-5:22),Underscore(5:23-5:24),LowerIdent(5:25-5:26),CloseRound(5:26-5:27),OpAssign(5:28-5:29),UpperIdent(5:30-5:34),OpenRound(5:35-5:36),UpperIdent(5:36-5:40),Int(5:41-5:42),Int(5:43-5:44),CloseRound(5:44-5:45),OpenRound(5:46-5:47),UpperIdent(5:47-5:51),Int(5:52-5:53),Int(5:54-5:55),CloseRound(5:55-5:56),Newline(1:1-1:1), +Newline(1:1-1:1), +Int(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.5 (raw "Pair")) +~~~ +# FORMATTED +~~~roc +Pair +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.5 (ext-var 73) (name "Pair") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[Pair]*")) +~~~ diff --git a/src/snapshots/old_syntax/underscore_name_type_annotation.md b/src/snapshots/old_syntax/underscore_name_type_annotation.md new file mode 100644 index 0000000000..e7b67c8c17 --- /dev/null +++ b/src/snapshots/old_syntax/underscore_name_type_annotation.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=underscore_name_type_annotation fail +type=expr +~~~ +# SOURCE +~~~roc +A +:_h +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),Newline(1:1-1:1), +OpColon(2:1-2:2),NamedUnderscore(2:2-2:4),EndOfFile(2:4-2:4), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "A")) +~~~ +# FORMATTED +~~~roc +A +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "A") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[A]*")) +~~~ diff --git a/src/snapshots/old_syntax/unfinished_closure_pattern_in_parens.md b/src/snapshots/old_syntax/unfinished_closure_pattern_in_parens.md new file mode 100644 index 0000000000..82e7eedfd3 --- /dev/null +++ b/src/snapshots/old_syntax/unfinished_closure_pattern_in_parens.md @@ -0,0 +1,36 @@ +# META +~~~ini +description=unfinished_closure_pattern_in_parens fail +type=expr +~~~ +# SOURCE +~~~roc +x = \( a +) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),OpBackslash(1:5-1:6),NoSpaceOpenRound(1:6-1:7),LowerIdent(1:8-1:9),Newline(1:1-1:1), +CloseRound(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/unicode_not_hex.md b/src/snapshots/old_syntax/unicode_not_hex.md new file mode 100644 index 0000000000..8b76e99027 --- /dev/null +++ b/src/snapshots/old_syntax/unicode_not_hex.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=unicode_not_hex fail +type=expr +~~~ +# SOURCE +~~~roc +"abc\u(zzzz)def" +~~~ +# PROBLEMS +**INVALID UNICODE ESCAPE SEQUENCE** +This Unicode escape sequence is not valid. + +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:16),StringEnd(1:16-1:17),EndOfFile(1:17-1:17), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.17 + (e-string-part @1.2-1.16 (raw "abc\u(zzzz)def"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.17 (id 74) + (e-literal @1.2-1.16 (string "abc\u(zzzz)def"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/unicode_overflow_str.md b/src/snapshots/old_syntax/unicode_overflow_str.md new file mode 100644 index 0000000000..3e8c5e2400 --- /dev/null +++ b/src/snapshots/old_syntax/unicode_overflow_str.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=unicode_overflow_str +type=expr +~~~ +# SOURCE +~~~roc +m"\u(FFFFFF)"s +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `m` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),StringStart(1:2-1:3),StringPart(1:3-1:13),StringEnd(1:13-1:14),LowerIdent(1:14-1:15),EndOfFile(1:15-1:15), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "m")) +~~~ +# FORMATTED +~~~roc +m +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/unindented_if_in_closure.md b/src/snapshots/old_syntax/unindented_if_in_closure.md new file mode 100644 index 0000000000..3fa2826559 --- /dev/null +++ b/src/snapshots/old_syntax/unindented_if_in_closure.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=unindented_if_in_closure +type=expr +~~~ +# SOURCE +~~~roc +\A->if!s!then +f +else-9 +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **\A** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**unindented_if_in_closure.md:1:1:1:3:** +```roc +\A->if!s!then +``` +^^ + + +# TOKENS +~~~zig +OpBackslash(1:1-1:2),UpperIdent(1:2-1:3),OpArrow(1:3-1:5),LowerIdent(1:5-1:14),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +KwElse(3:1-3:5),OpBinaryMinus(3:5-3:6),Int(3:6-3:7),EndOfFile(3:7-3:7), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.3 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/value_def_confusion.md b/src/snapshots/old_syntax/value_def_confusion.md new file mode 100644 index 0000000000..8e4c093ea2 --- /dev/null +++ b/src/snapshots/old_syntax/value_def_confusion.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=value_def_confusion +type=expr +~~~ +# SOURCE +~~~roc +a:F +F +:h +abc +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `a` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),Newline(1:1-1:1), +UpperIdent(2:1-2:2),Newline(1:1-1:1), +OpColon(3:1-3:2),LowerIdent(3:2-3:3),Newline(1:1-1:1), +LowerIdent(4:1-4:4),EndOfFile(4:4-4:4), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "a")) +~~~ +# FORMATTED +~~~roc +a +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/var_else.md b/src/snapshots/old_syntax/var_else.md new file mode 100644 index 0000000000..5f0abc68aa --- /dev/null +++ b/src/snapshots/old_syntax/var_else.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=var_else +type=expr +~~~ +# SOURCE +~~~roc +elsewhere +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `elsewhere` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:10),EndOfFile(1:10-1:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.10 (qaul "") (raw "elsewhere")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/var_if.md b/src/snapshots/old_syntax/var_if.md new file mode 100644 index 0000000000..453aa906bd --- /dev/null +++ b/src/snapshots/old_syntax/var_if.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=var_if +type=expr +~~~ +# SOURCE +~~~roc +iffy +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `iffy` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "iffy")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/var_is.md b/src/snapshots/old_syntax/var_is.md new file mode 100644 index 0000000000..ee949886b4 --- /dev/null +++ b/src/snapshots/old_syntax/var_is.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=var_is +type=expr +~~~ +# SOURCE +~~~roc +isnt +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `isnt` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),EndOfFile(1:5-1:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "isnt")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/var_minus_two.md b/src/snapshots/old_syntax/var_minus_two.md new file mode 100644 index 0000000000..8f0f63bc94 --- /dev/null +++ b/src/snapshots/old_syntax/var_minus_two.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=var_minus_two +type=expr +~~~ +# SOURCE +~~~roc +x-2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpBinaryMinus(1:2-1:3),Int(1:3-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.4 (op "-") + (e-ident @1.1-1.2 (qaul "") (raw "x")) + (e-int @1.3-1.4 (raw "2"))) +~~~ +# FORMATTED +~~~roc +x - 2 +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.4 (op "sub") (id 76) + (e-runtime-error (tag "ident_not_in_scope")) + (e-int @1.3-1.4 (value "2"))) +~~~ +# TYPES +~~~clojure +(expr (id 76) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/var_then.md b/src/snapshots/old_syntax/var_then.md new file mode 100644 index 0000000000..e5f3654fe0 --- /dev/null +++ b/src/snapshots/old_syntax/var_then.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=var_then +type=expr +~~~ +# SOURCE +~~~roc +thenever +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `thenever` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.9 (qaul "") (raw "thenever")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/var_when.md b/src/snapshots/old_syntax/var_when.md new file mode 100644 index 0000000000..a27415c8da --- /dev/null +++ b/src/snapshots/old_syntax/var_when.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=var_when +type=expr +~~~ +# SOURCE +~~~roc +whenever +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `whenever` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:9),EndOfFile(1:9-1:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.9 (qaul "") (raw "whenever")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/weird_escape.md b/src/snapshots/old_syntax/weird_escape.md new file mode 100644 index 0000000000..ee50d5387d --- /dev/null +++ b/src/snapshots/old_syntax/weird_escape.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=weird_escape fail +type=expr +~~~ +# SOURCE +~~~roc +"abc\qdef" +~~~ +# PROBLEMS +**INVALID ESCAPE SEQUENCE** +This escape sequence is not recognized. + +# TOKENS +~~~zig +StringStart(1:1-1:2),StringPart(1:2-1:10),StringEnd(1:10-1:11),EndOfFile(1:11-1:11), +~~~ +# PARSE +~~~clojure +(e-string @1.1-1.11 + (e-string-part @1.2-1.10 (raw "abc\qdef"))) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-string @1.1-1.11 (id 74) + (e-literal @1.2-1.10 (string "abc\qdef"))) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Str")) +~~~ diff --git a/src/snapshots/old_syntax/when_branch_comment_after_parens.md b/src/snapshots/old_syntax/when_branch_comment_after_parens.md new file mode 100644 index 0000000000..2247a06229 --- /dev/null +++ b/src/snapshots/old_syntax/when_branch_comment_after_parens.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_branch_comment_after_parens +type=expr +~~~ +# SOURCE +~~~roc +when n is +O->(s +)# +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +UpperIdent(2:1-2:2),OpArrow(2:2-2:4),NoSpaceOpenRound(2:4-2:5),LowerIdent(2:5-2:6),Newline(1:1-1:1), +CloseRound(3:1-3:2),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_comment_after_pattern.md b/src/snapshots/old_syntax/when_comment_after_pattern.md new file mode 100644 index 0000000000..80f5ece4ee --- /dev/null +++ b/src/snapshots/old_syntax/when_comment_after_pattern.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_comment_after_pattern +type=expr +~~~ +# SOURCE +~~~roc +when nns is +O# + ->r +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:9),LowerIdent(1:10-1:12),Newline(1:1-1:1), +UpperIdent(2:1-2:2),Newline(2:3-2:3), +OpArrow(3:2-3:4),LowerIdent(3:4-3:5),EndOfFile(3:5-3:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_comment_bbefore_if.md b/src/snapshots/old_syntax/when_comment_bbefore_if.md new file mode 100644 index 0000000000..5c2e007b2a --- /dev/null +++ b/src/snapshots/old_syntax/when_comment_bbefore_if.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_comment_bbefore_if +type=expr +~~~ +# SOURCE +~~~roc +when 0 +is S# + if S->e +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),UpperIdent(2:4-2:5),Newline(2:6-2:6), +KwIf(3:2-3:4),UpperIdent(3:5-3:6),OpArrow(3:6-3:8),LowerIdent(3:8-3:9),EndOfFile(3:9-3:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_if_guard.md b/src/snapshots/old_syntax/when_if_guard.md new file mode 100644 index 0000000000..055b3c06a8 --- /dev/null +++ b/src/snapshots/old_syntax/when_if_guard.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=when_if_guard +type=expr +~~~ +# SOURCE +~~~roc +when x is + _ -> + 1 + + _ -> + 2 + + Ok -> + 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Underscore(2:5-2:6),OpArrow(2:7-2:9),Newline(1:1-1:1), +Int(3:9-3:10),Newline(1:1-1:1), +Newline(1:1-1:1), +Underscore(5:5-5:6),OpArrow(5:7-5:9),Newline(1:1-1:1), +Int(6:9-6:10),Newline(1:1-1:1), +Newline(1:1-1:1), +UpperIdent(8:5-8:7),OpArrow(8:8-8:10),Newline(1:1-1:1), +Int(9:9-9:10),EndOfFile(9:10-9:10), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_assignment.md b/src/snapshots/old_syntax/when_in_assignment.md new file mode 100644 index 0000000000..da2221adee --- /dev/null +++ b/src/snapshots/old_syntax/when_in_assignment.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_in_assignment +type=expr +~~~ +# SOURCE +~~~roc +x = when n is + 0 -> 0 +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `x` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:3-1:4),LowerIdent(1:5-1:9),LowerIdent(1:10-1:11),LowerIdent(1:12-1:14),Newline(1:1-1:1), +Int(2:6-2:7),OpArrow(2:8-2:10),Int(2:11-2:12),Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "x")) +~~~ +# FORMATTED +~~~roc +x +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_binop_in_assign_with_sneaky_newline.md b/src/snapshots/old_syntax/when_in_binop_in_assign_with_sneaky_newline.md new file mode 100644 index 0000000000..4cf806736a --- /dev/null +++ b/src/snapshots/old_syntax/when_in_binop_in_assign_with_sneaky_newline.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=when_in_binop_in_assign_with_sneaky_newline +type=expr +~~~ +# SOURCE +~~~roc +j=m%when f +is e->(i +) +h +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `j` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpAssign(1:2-1:3),LowerIdent(1:3-1:4),OpPercent(1:4-1:5),LowerIdent(1:5-1:9),LowerIdent(1:10-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:3),LowerIdent(2:4-2:5),OpArrow(2:5-2:7),NoSpaceOpenRound(2:7-2:8),LowerIdent(2:8-2:9),Newline(1:1-1:1), +CloseRound(3:1-3:2),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "j")) +~~~ +# FORMATTED +~~~roc +j +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_binop_in_closure_in_when_guard_wow_fuzzer.md b/src/snapshots/old_syntax/when_in_binop_in_closure_in_when_guard_wow_fuzzer.md new file mode 100644 index 0000000000..c8d4d2f97f --- /dev/null +++ b/src/snapshots/old_syntax/when_in_binop_in_closure_in_when_guard_wow_fuzzer.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=when_in_binop_in_closure_in_when_guard_wow_fuzzer +type=expr +~~~ +# SOURCE +~~~roc +when f +is +3 if\t->m%when f +is z->e + z->m +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),Newline(1:1-1:1), +Int(3:1-3:2),KwIf(3:3-3:5),OpBackslash(3:5-3:6),LowerIdent(3:6-3:7),OpArrow(3:7-3:9),LowerIdent(3:9-3:10),OpPercent(3:10-3:11),LowerIdent(3:11-3:15),LowerIdent(3:16-3:17),Newline(1:1-1:1), +LowerIdent(4:1-4:3),LowerIdent(4:4-4:5),OpArrow(4:5-4:7),LowerIdent(4:7-4:8),Newline(1:1-1:1), +LowerIdent(5:2-5:3),OpArrow(5:3-5:5),LowerIdent(5:5-5:6),EndOfFile(5:6-5:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_binops.md b/src/snapshots/old_syntax/when_in_binops.md new file mode 100644 index 0000000000..8a5f08a051 --- /dev/null +++ b/src/snapshots/old_syntax/when_in_binops.md @@ -0,0 +1,54 @@ +# META +~~~ini +description=when_in_binops +type=expr +~~~ +# SOURCE +~~~roc +di7e + zl +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `di` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:3),OpLessThan(1:3-1:4),LowerIdent(1:4-1:5),OpLessThan(1:5-1:6),LowerIdent(1:6-1:10),LowerIdent(1:11-1:12),Newline(1:1-1:1), +LowerIdent(2:2-2:4),Int(2:5-2:6),OpArrow(2:6-2:8),MalformedNumberNoExponentDigits(2:8-2:10),Newline(1:1-1:1), +LowerIdent(3:2-3:4),EndOfFile(3:4-3:4), +~~~ +# PARSE +~~~clojure +(e-binop @1.1-1.12 (op "<") + (e-ident @1.1-1.3 (qaul "") (raw "di")) + (e-binop @1.4-1.12 (op "<") + (e-ident @1.4-1.5 (qaul "") (raw "s")) + (e-ident @1.6-1.10 (qaul "") (raw "when")))) +~~~ +# FORMATTED +~~~roc +di < s < when +~~~ +# CANONICALIZE +~~~clojure +(e-binop @1.1-1.12 (op "lt") (id 80) + (e-runtime-error (tag "ident_not_in_scope")) + (e-binop @1.4-1.12 (op "lt") + (e-runtime-error (tag "ident_not_in_scope")) + (e-runtime-error (tag "ident_not_in_scope")))) +~~~ +# TYPES +~~~clojure +(expr (id 80) (type "*")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_closure_in_when_guard_wtf.md b/src/snapshots/old_syntax/when_in_closure_in_when_guard_wtf.md new file mode 100644 index 0000000000..14011f936c --- /dev/null +++ b/src/snapshots/old_syntax/when_in_closure_in_when_guard_wtf.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=when_in_closure_in_when_guard_wtf +type=expr +~~~ +# SOURCE +~~~roc +when f +is +s if\t->when 0 +is z->f + z->m +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),KwIf(3:3-3:5),OpBackslash(3:5-3:6),LowerIdent(3:6-3:7),OpArrow(3:7-3:9),LowerIdent(3:9-3:13),Int(3:14-3:15),Newline(1:1-1:1), +LowerIdent(4:1-4:3),LowerIdent(4:4-4:5),OpArrow(4:5-4:7),LowerIdent(4:7-4:8),Newline(1:1-1:1), +LowerIdent(5:2-5:3),OpArrow(5:3-5:5),LowerIdent(5:5-5:6),EndOfFile(5:6-5:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_function.md b/src/snapshots/old_syntax/when_in_function.md new file mode 100644 index 0000000000..21724fe574 --- /dev/null +++ b/src/snapshots/old_syntax/when_in_function.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_in_function +type=expr +~~~ +# SOURCE +~~~roc +func = \x -> when n is + 0 -> 0 +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `func` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),OpBackslash(1:8-1:9),LowerIdent(1:9-1:10),OpArrow(1:11-1:13),LowerIdent(1:14-1:18),LowerIdent(1:19-1:20),LowerIdent(1:21-1:23),Newline(1:1-1:1), +Int(2:15-2:16),OpArrow(2:17-2:19),Int(2:20-2:21),Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "func")) +~~~ +# FORMATTED +~~~roc +func +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_function_python_style_indent.md b/src/snapshots/old_syntax/when_in_function_python_style_indent.md new file mode 100644 index 0000000000..95dd96376e --- /dev/null +++ b/src/snapshots/old_syntax/when_in_function_python_style_indent.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_in_function_python_style_indent +type=expr +~~~ +# SOURCE +~~~roc +func = \x -> when n is + 0 -> 0 +42 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `func` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),OpBackslash(1:8-1:9),LowerIdent(1:9-1:10),OpArrow(1:11-1:13),LowerIdent(1:14-1:18),LowerIdent(1:19-1:20),LowerIdent(1:21-1:23),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),Int(2:10-2:11),Newline(1:1-1:1), +Int(3:1-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "func")) +~~~ +# FORMATTED +~~~roc +func +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_in_list.md b/src/snapshots/old_syntax/when_in_list.md new file mode 100644 index 0000000000..d117c364a4 --- /dev/null +++ b/src/snapshots/old_syntax/when_in_list.md @@ -0,0 +1,47 @@ +# META +~~~ini +description=when_in_list +type=expr +~~~ +# SOURCE +~~~roc +[when 2 is 8->[ +]] +~~~ +# PROBLEMS +**LIST NOT CLOSED** +This list is missing a closing bracket or has a syntax error. +Lists must be closed with **]** and list items must be separated by commas. +For example: [1, 2, 3] + +Here is the problematic code: +**when_in_list.md:2:1:2:3:** +```roc +]] +``` +^^ + + +# TOKENS +~~~zig +OpenSquare(1:1-1:2),LowerIdent(1:2-1:6),Int(1:7-1:8),LowerIdent(1:9-1:11),Int(1:12-1:13),OpArrow(1:13-1:15),OpenSquare(1:15-1:16),Newline(1:1-1:1), +CloseSquare(2:1-2:2),CloseSquare(2:2-2:3),EndOfFile(2:3-2:3), +~~~ +# PARSE +~~~clojure +(e-malformed @2.1-2.3 (reason "expected_expr_close_square_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/when_in_parens.md b/src/snapshots/old_syntax/when_in_parens.md new file mode 100644 index 0000000000..4c76fbd0ba --- /dev/null +++ b/src/snapshots/old_syntax/when_in_parens.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=when_in_parens +type=expr +~~~ +# SOURCE +~~~roc +(when x is + Ok -> + 3) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**when_in_parens.md:3:10:3:11:** +```roc + 3) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:6),LowerIdent(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +UpperIdent(2:5-2:7),OpArrow(2:8-2:10),Newline(1:1-1:1), +Int(3:9-3:10),CloseRound(3:10-3:11),EndOfFile(3:11-3:11), +~~~ +# PARSE +~~~clojure +(e-malformed @3.10-3.11 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/when_in_parens_indented.md b/src/snapshots/old_syntax/when_in_parens_indented.md new file mode 100644 index 0000000000..959c063425 --- /dev/null +++ b/src/snapshots/old_syntax/when_in_parens_indented.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=when_in_parens_indented +type=expr +~~~ +# SOURCE +~~~roc +(when x is + Ok -> 3 + ) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**when_in_parens_indented.md:3:6:3:7:** +```roc + ) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:6),LowerIdent(1:7-1:8),LowerIdent(1:9-1:11),Newline(1:1-1:1), +UpperIdent(2:5-2:7),OpArrow(2:8-2:10),Int(2:11-2:12),Newline(1:1-1:1), +CloseRound(3:6-3:7),EndOfFile(3:7-3:7), +~~~ +# PARSE +~~~clojure +(e-malformed @3.6-3.7 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/when_in_when_guard_wtf.md b/src/snapshots/old_syntax/when_in_when_guard_wtf.md new file mode 100644 index 0000000000..dcd5899119 --- /dev/null +++ b/src/snapshots/old_syntax/when_in_when_guard_wtf.md @@ -0,0 +1,42 @@ +# META +~~~ini +description=when_in_when_guard_wtf +type=expr +~~~ +# SOURCE +~~~roc +when f +is +s if when 0 +is z->f + z->m +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),Newline(1:1-1:1), +LowerIdent(3:1-3:2),KwIf(3:3-3:5),LowerIdent(3:6-3:10),Int(3:11-3:12),Newline(1:1-1:1), +LowerIdent(4:1-4:3),LowerIdent(4:4-4:5),OpArrow(4:5-4:7),LowerIdent(4:7-4:8),Newline(1:1-1:1), +LowerIdent(5:2-5:3),OpArrow(5:3-5:5),LowerIdent(5:5-5:6),EndOfFile(5:6-5:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_missing_arrow.md b/src/snapshots/old_syntax/when_missing_arrow.md new file mode 100644 index 0000000000..863e20bb42 --- /dev/null +++ b/src/snapshots/old_syntax/when_missing_arrow.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_missing_arrow fail +type=expr +~~~ +# SOURCE +~~~roc +when 5 is + 1 -> 2 + _ +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),Int(2:10-2:11),Newline(1:1-1:1), +Underscore(3:5-3:6),EndOfFile(3:6-3:6), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_newline_after_condition.md b/src/snapshots/old_syntax/when_newline_after_condition.md new file mode 100644 index 0000000000..b99c64e53c --- /dev/null +++ b/src/snapshots/old_syntax/when_newline_after_condition.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_newline_after_condition +type=expr +~~~ +# SOURCE +~~~roc +when n +#s +is O->1 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),Newline(1:1-1:1), +Newline(2:2-2:3), +LowerIdent(3:1-3:3),UpperIdent(3:4-3:5),OpArrow(3:5-3:7),Int(3:7-3:8),EndOfFile(3:8-3:8), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_newline_before_is_and_in_branch_parens.md b/src/snapshots/old_syntax/when_newline_before_is_and_in_branch_parens.md new file mode 100644 index 0000000000..5665ea9186 --- /dev/null +++ b/src/snapshots/old_syntax/when_newline_before_is_and_in_branch_parens.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_newline_before_is_and_in_branch_parens +type=expr +~~~ +# SOURCE +~~~roc +when 0 +is B->( +t) +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),Newline(1:1-1:1), +LowerIdent(2:1-2:3),UpperIdent(2:4-2:5),OpArrow(2:5-2:7),NoSpaceOpenRound(2:7-2:8),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_outdented_branch.md b/src/snapshots/old_syntax/when_outdented_branch.md new file mode 100644 index 0000000000..e40e4d6d04 --- /dev/null +++ b/src/snapshots/old_syntax/when_outdented_branch.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_outdented_branch fail +type=expr +~~~ +# SOURCE +~~~roc +when 4 is + 5 -> 2 + 2 -> 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),Int(2:10-2:11),Newline(1:1-1:1), +Int(3:2-3:3),OpArrow(3:4-3:6),Int(3:7-3:8),EndOfFile(3:8-3:8), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_over_indented_int.md b/src/snapshots/old_syntax/when_over_indented_int.md new file mode 100644 index 0000000000..6bddb42c9a --- /dev/null +++ b/src/snapshots/old_syntax/when_over_indented_int.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_over_indented_int fail +type=expr +~~~ +# SOURCE +~~~roc +when 4 is + 5 -> Num.neg + 2 -> 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),UpperIdent(2:10-2:13),NoSpaceDotLowerIdent(2:13-2:17),Newline(1:1-1:1), +Int(3:6-3:7),OpArrow(3:8-3:10),Int(3:11-3:12),EndOfFile(3:12-3:12), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_over_indented_underscore.md b/src/snapshots/old_syntax/when_over_indented_underscore.md new file mode 100644 index 0000000000..ec4724d8df --- /dev/null +++ b/src/snapshots/old_syntax/when_over_indented_underscore.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_over_indented_underscore fail +type=expr +~~~ +# SOURCE +~~~roc +when 4 is + 5 -> 2 + _ -> 2 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),Int(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),Int(2:10-2:11),Newline(1:1-1:1), +Underscore(3:6-3:7),OpArrow(3:8-3:10),Int(3:11-3:12),EndOfFile(3:12-3:12), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_result_list.md b/src/snapshots/old_syntax/when_result_list.md new file mode 100644 index 0000000000..ff46e39740 --- /dev/null +++ b/src/snapshots/old_syntax/when_result_list.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_result_list +type=expr +~~~ +# SOURCE +~~~roc +when Ok [] is + Ok [] -> {} + _ -> {} +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),UpperIdent(1:6-1:8),OpenSquare(1:9-1:10),CloseSquare(1:10-1:11),LowerIdent(1:12-1:14),Newline(1:1-1:1), +UpperIdent(2:5-2:7),OpenSquare(2:8-2:9),CloseSquare(2:9-2:10),OpArrow(2:11-2:13),OpenCurly(2:14-2:15),CloseCurly(2:15-2:16),Newline(1:1-1:1), +Underscore(3:5-3:6),OpArrow(3:7-3:9),OpenCurly(3:10-3:11),CloseCurly(3:11-3:12),EndOfFile(3:12-3:12), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_alternative_patterns.md b/src/snapshots/old_syntax/when_with_alternative_patterns.md new file mode 100644 index 0000000000..0e56c6e689 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_alternative_patterns.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=when_with_alternative_patterns +type=expr +~~~ +# SOURCE +~~~roc +when x is + "blah" | "blop" -> 1 + "foo" | + "bar" + |"baz" -> 2 + "stuff" -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +StringStart(2:2-2:3),StringPart(2:3-2:7),StringEnd(2:7-2:8),OpBar(2:9-2:10),StringStart(2:11-2:12),StringPart(2:12-2:16),StringEnd(2:16-2:17),OpArrow(2:18-2:20),Int(2:21-2:22),Newline(1:1-1:1), +StringStart(3:2-3:3),StringPart(3:3-3:6),StringEnd(3:6-3:7),OpBar(3:8-3:9),Newline(1:1-1:1), +StringStart(4:3-4:4),StringPart(4:4-4:7),StringEnd(4:7-4:8),Newline(1:1-1:1), +OpBar(5:2-5:3),StringStart(5:3-5:4),StringPart(5:4-5:7),StringEnd(5:7-5:8),OpArrow(5:9-5:11),Int(5:12-5:13),Newline(1:1-1:1), +StringStart(6:2-6:3),StringPart(6:3-6:8),StringEnd(6:8-6:9),OpArrow(6:10-6:12),Int(6:13-6:14),EndOfFile(6:14-6:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_function_application.md b/src/snapshots/old_syntax/when_with_function_application.md new file mode 100644 index 0000000000..cae1d818e9 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_function_application.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=when_with_function_application +type=expr +~~~ +# SOURCE +~~~roc +when x is + 1 -> Num.neg + 2 + _ -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:5-2:6),OpArrow(2:7-2:9),UpperIdent(2:10-2:13),NoSpaceDotLowerIdent(2:13-2:17),Newline(1:1-1:1), +Int(3:6-3:7),Newline(1:1-1:1), +Underscore(4:5-4:6),OpArrow(4:7-4:9),Int(4:10-4:11),EndOfFile(4:11-4:11), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_negative_numbers.md b/src/snapshots/old_syntax/when_with_negative_numbers.md new file mode 100644 index 0000000000..95df9d0669 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_negative_numbers.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_with_negative_numbers +type=expr +~~~ +# SOURCE +~~~roc +when x is + 1 -> 2 + -3 -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:2-2:3),OpArrow(2:4-2:6),Int(2:7-2:8),Newline(1:1-1:1), +Int(3:2-3:4),OpArrow(3:5-3:7),Int(3:8-3:9),EndOfFile(3:9-3:9), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_numbers.md b/src/snapshots/old_syntax/when_with_numbers.md new file mode 100644 index 0000000000..65809262d5 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_numbers.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_with_numbers +type=expr +~~~ +# SOURCE +~~~roc +when x is + 1 -> 2 + 3 -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +Int(2:2-2:3),OpArrow(2:4-2:6),Int(2:7-2:8),Newline(1:1-1:1), +Int(3:2-3:3),OpArrow(3:4-3:6),Int(3:7-3:8),EndOfFile(3:8-3:8), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_records.md b/src/snapshots/old_syntax/when_with_records.md new file mode 100644 index 0000000000..158f3a8685 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_records.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_with_records +type=expr +~~~ +# SOURCE +~~~roc +when x is + { y } -> 2 + { z, w } -> 4 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),LowerIdent(1:6-1:7),LowerIdent(1:8-1:10),Newline(1:1-1:1), +OpenCurly(2:2-2:3),LowerIdent(2:4-2:5),CloseCurly(2:6-2:7),OpArrow(2:8-2:10),Int(2:11-2:12),Newline(1:1-1:1), +OpenCurly(3:2-3:3),LowerIdent(3:4-3:5),Comma(3:5-3:6),LowerIdent(3:7-3:8),CloseCurly(3:9-3:10),OpArrow(3:11-3:13),Int(3:14-3:15),EndOfFile(3:15-3:15), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_tuple_in_record.md b/src/snapshots/old_syntax/when_with_tuple_in_record.md new file mode 100644 index 0000000000..a089d96557 --- /dev/null +++ b/src/snapshots/old_syntax/when_with_tuple_in_record.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_with_tuple_in_record +type=expr +~~~ +# SOURCE +~~~roc +when {foo: (1, 2)} is + {foo: (1, x)} -> x + {foo: (_, b)} -> 3 + b +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenCurly(1:6-1:7),LowerIdent(1:7-1:10),OpColon(1:10-1:11),OpenRound(1:12-1:13),Int(1:13-1:14),Comma(1:14-1:15),Int(1:16-1:17),CloseRound(1:17-1:18),CloseCurly(1:18-1:19),LowerIdent(1:20-1:22),Newline(1:1-1:1), +OpenCurly(2:2-2:3),LowerIdent(2:3-2:6),OpColon(2:6-2:7),OpenRound(2:8-2:9),Int(2:9-2:10),Comma(2:10-2:11),LowerIdent(2:12-2:13),CloseRound(2:13-2:14),CloseCurly(2:14-2:15),OpArrow(2:16-2:18),LowerIdent(2:19-2:20),Newline(1:1-1:1), +OpenCurly(3:2-3:3),LowerIdent(3:3-3:6),OpColon(3:6-3:7),OpenRound(3:8-3:9),Underscore(3:9-3:10),Comma(3:10-3:11),LowerIdent(3:12-3:13),CloseRound(3:13-3:14),CloseCurly(3:14-3:15),OpArrow(3:16-3:18),Int(3:19-3:20),OpPlus(3:21-3:22),LowerIdent(3:23-3:24),EndOfFile(3:24-3:24), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/when_with_tuples.md b/src/snapshots/old_syntax/when_with_tuples.md new file mode 100644 index 0000000000..4b8684baba --- /dev/null +++ b/src/snapshots/old_syntax/when_with_tuples.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=when_with_tuples +type=expr +~~~ +# SOURCE +~~~roc +when (1, 2) is + (1, x) -> x + (_, b) -> 3 + b +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `when` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpenRound(1:6-1:7),Int(1:7-1:8),Comma(1:8-1:9),Int(1:10-1:11),CloseRound(1:11-1:12),LowerIdent(1:13-1:15),Newline(1:1-1:1), +OpenRound(2:2-2:3),Int(2:3-2:4),Comma(2:4-2:5),LowerIdent(2:6-2:7),CloseRound(2:7-2:8),OpArrow(2:9-2:11),LowerIdent(2:12-2:13),Newline(1:1-1:1), +OpenRound(3:2-3:3),Underscore(3:3-3:4),Comma(3:4-3:5),LowerIdent(3:6-3:7),CloseRound(3:7-3:8),OpArrow(3:9-3:11),Int(3:12-3:13),OpPlus(3:14-3:15),LowerIdent(3:16-3:17),EndOfFile(3:17-3:17), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "when")) +~~~ +# FORMATTED +~~~roc +when +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_and_implements_lookalikes.md b/src/snapshots/old_syntax/where_and_implements_lookalikes.md new file mode 100644 index 0000000000..a18508c8ae --- /dev/null +++ b/src/snapshots/old_syntax/where_and_implements_lookalikes.md @@ -0,0 +1,48 @@ +# META +~~~ini +description=where_and_implements_lookalikes +type=expr +~~~ +# SOURCE +~~~roc +(i:a# + wherew implementsI +e) +~~~ +# PROBLEMS +**PARSE ERROR** +A parsing error occurred: `expected_expr_close_round_or_comma` +This is an unexpected parsing error. Please check your syntax. + +Here is the problematic code: +**where_and_implements_lookalikes.md:3:2:3:3:** +```roc +e) +``` + ^ + + +# TOKENS +~~~zig +OpenRound(1:1-1:2),LowerIdent(1:2-1:3),OpColon(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:6-1:6), +LowerIdent(2:3-2:9),LowerIdent(2:10-2:21),Newline(1:1-1:1), +LowerIdent(3:1-3:2),CloseRound(3:2-3:3),EndOfFile(3:3-3:3), +~~~ +# PARSE +~~~clojure +(e-malformed @3.2-3.3 (reason "expected_expr_close_round_or_comma")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_function.md b/src/snapshots/old_syntax/where_clause_function.md new file mode 100644 index 0000000000..3b50079d5f --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_function.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=where_clause_function +type=expr +~~~ +# SOURCE +~~~roc +f : a -> (b -> c) where a implements A + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),OpenRound(1:10-1:11),LowerIdent(1:11-1:12),OpArrow(1:13-1:15),LowerIdent(1:16-1:17),CloseRound(1:17-1:18),KwWhere(1:19-1:24),LowerIdent(1:25-1:26),KwImplements(1:27-1:37),UpperIdent(1:38-1:39),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_multiple_bound_abilities.md b/src/snapshots/old_syntax/where_clause_multiple_bound_abilities.md new file mode 100644 index 0000000000..f68017476e --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_multiple_bound_abilities.md @@ -0,0 +1,46 @@ +# META +~~~ini +description=where_clause_multiple_bound_abilities +type=expr +~~~ +# SOURCE +~~~roc +f : a -> b where a implements Hash & Eq, b implements Eq & Hash & Display + +f : a -> b + where a implements Hash & Eq, + b implements Hash & Display & Eq + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),LowerIdent(1:10-1:11),KwWhere(1:12-1:17),LowerIdent(1:18-1:19),KwImplements(1:20-1:30),UpperIdent(1:31-1:35),OpAmpersand(1:36-1:37),UpperIdent(1:38-1:40),Comma(1:40-1:41),LowerIdent(1:42-1:43),KwImplements(1:44-1:54),UpperIdent(1:55-1:57),OpAmpersand(1:58-1:59),UpperIdent(1:60-1:64),OpAmpersand(1:65-1:66),UpperIdent(1:67-1:74),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:2),OpColon(3:3-3:4),LowerIdent(3:5-3:6),OpArrow(3:7-3:9),LowerIdent(3:10-3:11),Newline(1:1-1:1), +KwWhere(4:3-4:8),LowerIdent(4:9-4:10),KwImplements(4:11-4:21),UpperIdent(4:22-4:26),OpAmpersand(4:27-4:28),UpperIdent(4:29-4:31),Comma(4:31-4:32),Newline(1:1-1:1), +LowerIdent(5:5-5:6),KwImplements(5:7-5:17),UpperIdent(5:18-5:22),OpAmpersand(5:23-5:24),UpperIdent(5:25-5:32),OpAmpersand(5:33-5:34),UpperIdent(5:35-5:37),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_multiple_has.md b/src/snapshots/old_syntax/where_clause_multiple_has.md new file mode 100644 index 0000000000..59ce661ef3 --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_multiple_has.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=where_clause_multiple_has +type=expr +~~~ +# SOURCE +~~~roc +f : a -> (b -> c) where a implements A, b implements Eq, c implements Ord + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),OpenRound(1:10-1:11),LowerIdent(1:11-1:12),OpArrow(1:13-1:15),LowerIdent(1:16-1:17),CloseRound(1:17-1:18),KwWhere(1:19-1:24),LowerIdent(1:25-1:26),KwImplements(1:27-1:37),UpperIdent(1:38-1:39),Comma(1:39-1:40),LowerIdent(1:41-1:42),KwImplements(1:43-1:53),UpperIdent(1:54-1:56),Comma(1:56-1:57),LowerIdent(1:58-1:59),KwImplements(1:60-1:70),UpperIdent(1:71-1:74),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_multiple_has_across_newlines.md b/src/snapshots/old_syntax/where_clause_multiple_has_across_newlines.md new file mode 100644 index 0000000000..d26e729b5a --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_multiple_has_across_newlines.md @@ -0,0 +1,44 @@ +# META +~~~ini +description=where_clause_multiple_has_across_newlines +type=expr +~~~ +# SOURCE +~~~roc +f : a -> (b -> c) + where a implements Hash, + b implements Eq, + c implements Ord + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),OpenRound(1:10-1:11),LowerIdent(1:11-1:12),OpArrow(1:13-1:15),LowerIdent(1:16-1:17),CloseRound(1:17-1:18),Newline(1:1-1:1), +KwWhere(2:5-2:10),LowerIdent(2:11-2:12),KwImplements(2:13-2:23),UpperIdent(2:24-2:28),Comma(2:28-2:29),Newline(1:1-1:1), +LowerIdent(3:7-3:8),KwImplements(3:9-3:19),UpperIdent(3:20-3:22),Comma(3:22-3:23),Newline(1:1-1:1), +LowerIdent(4:7-4:8),KwImplements(4:9-4:19),UpperIdent(4:20-4:23),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(6:1-6:2),EndOfFile(6:2-6:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_non_function.md b/src/snapshots/old_syntax/where_clause_non_function.md new file mode 100644 index 0000000000..a8052dce36 --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_non_function.md @@ -0,0 +1,38 @@ +# META +~~~ini +description=where_clause_non_function +type=expr +~~~ +# SOURCE +~~~roc +f : a where a implements A + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),KwWhere(1:7-1:12),LowerIdent(1:13-1:14),KwImplements(1:15-1:25),UpperIdent(1:26-1:27),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_clause_on_newline.md b/src/snapshots/old_syntax/where_clause_on_newline.md new file mode 100644 index 0000000000..24fb46470b --- /dev/null +++ b/src/snapshots/old_syntax/where_clause_on_newline.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=where_clause_on_newline +type=expr +~~~ +# SOURCE +~~~roc +f : a -> U64 + where a implements Hash + +f +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `f` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:3-1:4),LowerIdent(1:5-1:6),OpArrow(1:7-1:9),UpperIdent(1:10-1:13),Newline(1:1-1:1), +KwWhere(2:5-2:10),LowerIdent(2:11-2:12),KwImplements(2:13-2:23),UpperIdent(2:24-2:28),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "f")) +~~~ +# FORMATTED +~~~roc +f +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/where_ident.md b/src/snapshots/old_syntax/where_ident.md new file mode 100644 index 0000000000..13ad59eaca --- /dev/null +++ b/src/snapshots/old_syntax/where_ident.md @@ -0,0 +1,50 @@ +# META +~~~ini +description=where_ident +type=expr +~~~ +# SOURCE +~~~roc +where : {where: I32} +where = {where: 1} + +where.where +~~~ +# PROBLEMS +**UNEXPECTED TOKEN IN EXPRESSION** +The token **where :** is not expected in an expression. +Expressions can be identifiers, literals, function calls, or operators. + +Here is the problematic code: +**where_ident.md:1:1:1:8:** +```roc +where : {where: I32} +``` +^^^^^^^ + + +# TOKENS +~~~zig +KwWhere(1:1-1:6),OpColon(1:7-1:8),OpenCurly(1:9-1:10),KwWhere(1:10-1:15),OpColon(1:15-1:16),UpperIdent(1:17-1:20),CloseCurly(1:20-1:21),Newline(1:1-1:1), +KwWhere(2:1-2:6),OpAssign(2:7-2:8),OpenCurly(2:9-2:10),KwWhere(2:10-2:15),OpColon(2:15-2:16),Int(2:17-2:18),CloseCurly(2:18-2:19),Newline(1:1-1:1), +Newline(1:1-1:1), +KwWhere(4:1-4:6),NoSpaceDotLowerIdent(4:6-4:12),EndOfFile(4:12-4:12), +~~~ +# PARSE +~~~clojure +(e-malformed @1.1-1.8 (reason "expr_unexpected_token")) +~~~ +# FORMATTED +~~~roc + +~~~ +# CANONICALIZE +~~~clojure +(can-ir (empty true)) +~~~ +# TYPES +~~~clojure +(inferred-types + (defs) + (expressions)) +~~~ diff --git a/src/snapshots/old_syntax/where_implements_lots_of_newlines.md b/src/snapshots/old_syntax/where_implements_lots_of_newlines.md new file mode 100644 index 0000000000..bdfecea071 --- /dev/null +++ b/src/snapshots/old_syntax/where_implements_lots_of_newlines.md @@ -0,0 +1,43 @@ +# META +~~~ini +description=where_implements_lots_of_newlines +type=expr +~~~ +# SOURCE +~~~roc +T:[ +]# + where +e +implements +T +e +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),OpenSquare(1:3-1:4),Newline(1:1-1:1), +CloseSquare(2:1-2:2),Newline(2:3-2:3), +KwWhere(3:3-3:8),Newline(1:1-1:1), +LowerIdent(4:1-4:2),Newline(1:1-1:1), +KwImplements(5:1-5:11),Newline(1:1-1:1), +UpperIdent(6:1-6:2),Newline(1:1-1:1), +LowerIdent(7:1-7:2),EndOfFile(7:2-7:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "T")) +~~~ +# FORMATTED +~~~roc +T +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "T") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[T]*")) +~~~ diff --git a/src/snapshots/old_syntax/where_in_parens.md b/src/snapshots/old_syntax/where_in_parens.md new file mode 100644 index 0000000000..24e3d029f4 --- /dev/null +++ b/src/snapshots/old_syntax/where_in_parens.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=where_in_parens +type=expr +~~~ +# SOURCE +~~~roc +L:(l where +e +implements Z)I +s +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +UpperIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),KwWhere(1:6-1:11),Newline(1:1-1:1), +LowerIdent(2:1-2:2),Newline(1:1-1:1), +KwImplements(3:1-3:11),UpperIdent(3:12-3:13),CloseRound(3:13-3:14),UpperIdent(3:14-3:15),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-tag @1.1-1.2 (raw "L")) +~~~ +# FORMATTED +~~~roc +L +~~~ +# CANONICALIZE +~~~clojure +(e-tag @1.1-1.2 (ext-var 73) (name "L") (args "TODO") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "[L]*")) +~~~ diff --git a/src/snapshots/old_syntax/where_in_tuple_after_comment.md b/src/snapshots/old_syntax/where_in_tuple_after_comment.md new file mode 100644 index 0000000000..b74263dd6a --- /dev/null +++ b/src/snapshots/old_syntax/where_in_tuple_after_comment.md @@ -0,0 +1,35 @@ +# META +~~~ini +description=where_in_tuple_after_comment +type=expr +~~~ +# SOURCE +~~~roc +1:(*# +where e implements J)* +l +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),OpStar(1:4-1:5),Newline(1:6-1:6), +KwWhere(2:1-2:6),LowerIdent(2:7-2:8),KwImplements(2:9-2:19),UpperIdent(2:20-2:21),CloseRound(2:21-2:22),OpStar(2:22-2:23),Newline(1:1-1:1), +LowerIdent(3:1-3:2),EndOfFile(3:2-3:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/where_in_tuple_plain.md b/src/snapshots/old_syntax/where_in_tuple_plain.md new file mode 100644 index 0000000000..9aa7eb1662 --- /dev/null +++ b/src/snapshots/old_syntax/where_in_tuple_plain.md @@ -0,0 +1,33 @@ +# META +~~~ini +description=where_in_tuple_plain +type=expr +~~~ +# SOURCE +~~~roc +1:A(*where e implements J) * +l +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),UpperIdent(1:3-1:4),NoSpaceOpenRound(1:4-1:5),OpStar(1:5-1:6),KwWhere(1:6-1:11),LowerIdent(1:12-1:13),KwImplements(1:14-1:24),UpperIdent(1:25-1:26),CloseRound(1:26-1:27),OpStar(1:28-1:29),Newline(1:1-1:1), +LowerIdent(2:1-2:2),EndOfFile(2:2-2:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "1")) +~~~ +# FORMATTED +~~~roc +1 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "1") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/where_newline_p_implements.md b/src/snapshots/old_syntax/where_newline_p_implements.md new file mode 100644 index 0000000000..79e49fb79a --- /dev/null +++ b/src/snapshots/old_syntax/where_newline_p_implements.md @@ -0,0 +1,37 @@ +# META +~~~ini +description=where_newline_p_implements +type=expr +~~~ +# SOURCE +~~~roc +2:( +)e where +p implements T +e +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),Newline(1:1-1:1), +CloseRound(2:1-2:2),LowerIdent(2:2-2:3),KwWhere(2:4-2:9),Newline(1:1-1:1), +LowerIdent(3:1-3:2),KwImplements(3:3-3:13),UpperIdent(3:14-3:15),Newline(1:1-1:1), +LowerIdent(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "2")) +~~~ +# FORMATTED +~~~roc +2 +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "2") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/src/snapshots/old_syntax/where_type_variable.md b/src/snapshots/old_syntax/where_type_variable.md new file mode 100644 index 0000000000..6e6c5c1592 --- /dev/null +++ b/src/snapshots/old_syntax/where_type_variable.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=where_type_variable fail +type=expr +~~~ +# SOURCE +~~~roc +role : Role where +role = Admin + +role +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `role` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpColon(1:6-1:7),UpperIdent(1:8-1:12),KwWhere(1:13-1:18),Newline(1:1-1:1), +LowerIdent(2:1-2:5),OpAssign(2:6-2:7),UpperIdent(2:8-2:13),Newline(1:1-1:1), +Newline(1:1-1:1), +LowerIdent(4:1-4:5),EndOfFile(4:5-4:5), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "role")) +~~~ +# FORMATTED +~~~roc +role +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/wherem_implementsf.md b/src/snapshots/old_syntax/wherem_implementsf.md new file mode 100644 index 0000000000..9a6afb5203 --- /dev/null +++ b/src/snapshots/old_syntax/wherem_implementsf.md @@ -0,0 +1,40 @@ +# META +~~~ini +description=wherem_implementsf fail +type=expr +~~~ +# SOURCE +~~~roc +s:(s +wherem +implementsF)A +_ +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `s` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:2),OpColon(1:2-1:3),NoSpaceOpenRound(1:3-1:4),LowerIdent(1:4-1:5),Newline(1:1-1:1), +LowerIdent(2:1-2:7),Newline(1:1-1:1), +LowerIdent(3:1-3:12),CloseRound(3:12-3:13),UpperIdent(3:13-3:14),Newline(1:1-1:1), +Underscore(4:1-4:2),EndOfFile(4:2-4:2), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.2 (qaul "") (raw "s")) +~~~ +# FORMATTED +~~~roc +s +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/wild_case_arrow.md b/src/snapshots/old_syntax/wild_case_arrow.md new file mode 100644 index 0000000000..27388ef518 --- /dev/null +++ b/src/snapshots/old_syntax/wild_case_arrow.md @@ -0,0 +1,34 @@ +# META +~~~ini +description=wild_case_arrow fail +type=expr +~~~ +# SOURCE +~~~roc +main = 5 -> 3 +~~~ +# PROBLEMS +**UNDEFINED VARIABLE** +Nothing is named `main` in this scope. +Is there an `import` or `exposing` missing up-top? + +# TOKENS +~~~zig +LowerIdent(1:1-1:5),OpAssign(1:6-1:7),Int(1:8-1:9),OpArrow(1:10-1:12),Int(1:13-1:14),EndOfFile(1:14-1:14), +~~~ +# PARSE +~~~clojure +(e-ident @1.1-1.5 (qaul "") (raw "main")) +~~~ +# FORMATTED +~~~roc +main +~~~ +# CANONICALIZE +~~~clojure +(e-runtime-error (tag "ident_not_in_scope") (id 74)) +~~~ +# TYPES +~~~clojure +(expr (id 74) (type "Error")) +~~~ diff --git a/src/snapshots/old_syntax/zero_float.md b/src/snapshots/old_syntax/zero_float.md new file mode 100644 index 0000000000..c2bbd87d3d --- /dev/null +++ b/src/snapshots/old_syntax/zero_float.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=zero_float +type=expr +~~~ +# SOURCE +~~~roc +0.0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Float(1:1-1:4),EndOfFile(1:4-1:4), +~~~ +# PARSE +~~~clojure +(e-frac @1.1-1.4 (raw "0.0")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-dec-small @1.1-1.4 (numerator "0") (denominator-power-of-ten "1") (value "0.0") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Frac(*)")) +~~~ diff --git a/src/snapshots/old_syntax/zero_int.md b/src/snapshots/old_syntax/zero_int.md new file mode 100644 index 0000000000..09d03a41e2 --- /dev/null +++ b/src/snapshots/old_syntax/zero_int.md @@ -0,0 +1,31 @@ +# META +~~~ini +description=zero_int +type=expr +~~~ +# SOURCE +~~~roc +0 +~~~ +# PROBLEMS +NIL +# TOKENS +~~~zig +Int(1:1-1:2),EndOfFile(1:2-1:2), +~~~ +# PARSE +~~~clojure +(e-int @1.1-1.2 (raw "0")) +~~~ +# FORMATTED +~~~roc +NO CHANGE +~~~ +# CANONICALIZE +~~~clojure +(e-int @1.1-1.2 (value "0") (id 73)) +~~~ +# TYPES +~~~clojure +(expr (id 73) (type "Num(*)")) +~~~ diff --git a/typos.toml b/typos.toml index d02108f92f..78b314c5b8 100644 --- a/typos.toml +++ b/typos.toml @@ -1,11 +1,20 @@ [files] -extend-exclude = ["design/language/Abilities.md", "src/snapshots/fuzz_crash", "crates/vendor/", "authors", "crates", "examples/static-site-gen/input/", "COPYRIGHT", "crates/compiler/checkmate/www/package-lock.json", "src/zig_llvm.h"] +extend-exclude = [ + "design/language/Abilities.md", + "src/snapshots/fuzz_crash", + "crates/vendor/", + "authors", + "crates", + "examples/static-site-gen/input/", + "COPYRIGHT", + "crates/compiler/checkmate/www/package-lock.json", + "src/zig_llvm.h", + "src/snapshots/", +] [default] -extend-ignore-identifiers-re = [ - ".*_SME_.*" -] +extend-ignore-identifiers-re = [".*_SME_.*"] [default.extend-words] HSA = "HSA" -typ = "typ" \ No newline at end of file +typ = "typ"