Skip to content

Commit 43ab249

Browse files
committed
remove ast output in broken parser case files
1 parent a3c6caa commit 43ab249

File tree

2 files changed

+22
-57
lines changed

2 files changed

+22
-57
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// --- BROKEN PARSER CASES ---
22
// This below demonstrates an issue when what you're completing is the _last_ labelled argument, and there's a unit application after it. The parser wrongly merges the unit argument as the expression of the labelled argument assignment, where is should really let the trailing unit argument be, and set a %rescript.exprhole as the expression of the assignment, just like it normally does.
33
// let _ = someFn(~isOff=, ())
4-
// ^ast
4+
// ^com
55

66
// This should parse as a single item tuple when in a pattern?
77
// switch s { | (t) }
8-
// ^ast
8+
// ^com
99

1010
// Here the parser eats the arrow and considers the None in the expression part of the pattern.
1111
// let _ = switch x { | None | => None }
12-
// ^ast
12+
// ^com
1313

Lines changed: 19 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,20 @@
1-
Dump AST src/BrokenParserCases.res 2:24
2-
3-
Source:
4-
// let _ = someFn(~isOff=, ())
5-
// ^ast
6-
7-
<*>Pstr_value(
8-
value:
9-
Ppat_any
10-
expr:
11-
<*>Pexp_apply(
12-
expr:
13-
Pexp_ident:someFn
14-
args:
15-
<*>~isOff=
16-
[@ns.namedArgLoc]Pexp_construct(())
17-
)
18-
)
19-
20-
Dump AST src/BrokenParserCases.res 6:17
21-
22-
Source:
23-
// switch s { | (t) }
24-
// ^ast
25-
26-
<*>Pstr_eval(
27-
<*>Pexp_match(Pexp_ident:s)
28-
case 1:
29-
pattern<*>:
30-
<*>Ppat_var(<*>t)
31-
expr<x>:
32-
<x>Pexp_extension(%<x>rescript.exprhole)
33-
)
34-
35-
Dump AST src/BrokenParserCases.res 10:29
36-
37-
Source:
38-
// let _ = switch x { | None | => None }
39-
// ^ast
40-
41-
<*>Pstr_value(
42-
value:
43-
Ppat_any
44-
expr:
45-
<*>Pexp_match(Pexp_ident:x)
46-
case 1:
47-
pattern<*>:
48-
<*>Ppat_or(
49-
Ppat_construct(None),
50-
Ppat_construct(None)
51-
)
52-
expr<x>:
53-
<x>Pexp_extension(%<x>rescript.exprhole)
54-
)
1+
Complete src/BrokenParserCases.res 2:24
2+
posCursor:[2:24] posNoWhite:[2:23] Found expr:[2:11->2:30]
3+
Pexp_apply ...[2:11->2:17] (~isOff2:19->2:24=...[2:27->2:29])
4+
Completable: CnamedArg(Value[someFn], isOff, [isOff])
5+
[]
6+
7+
Complete src/BrokenParserCases.res 6:17
8+
posCursor:[6:17] posNoWhite:[6:16] Found expr:[6:3->6:21]
9+
posCursor:[6:17] posNoWhite:[6:16] Found pattern:[6:16->6:19]
10+
Completable: Cpattern Value[s]=t
11+
[]
12+
13+
Complete src/BrokenParserCases.res 10:29
14+
posCursor:[10:29] posNoWhite:[10:27] Found expr:[10:11->10:41]
15+
posCursor:[10:29] posNoWhite:[10:27] Found pattern:[10:24->10:39]
16+
posCursor:[10:29] posNoWhite:[10:27] Found pattern:[10:24->10:28]
17+
Ppat_construct None:[10:24->10:28]
18+
Completable: Cpath Value[None]
19+
[]
5520

0 commit comments

Comments
 (0)