Skip to content

Commit ef47a5e

Browse files
committed
Report error at EOF
1 parent 1ff35b4 commit ef47a5e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Compiler/pars.fsy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3551,7 +3551,7 @@ headBindingPattern:
35513551
{ let mColonColon = rhs parseState 2
35523552
SynPat.ListCons($1, $3, rhs2 parseState 1 3, { ColonColonRange = mColonColon }) }
35533553

3554-
| headBindingPattern COLON_COLON recover
3554+
| headBindingPattern COLON_COLON ends_coming_soon_or_recover
35553555
{ let mColonColon = rhs parseState 2
35563556
let pat2 = SynPat.Wild(mColonColon.EndRange)
35573557
SynPat.ListCons($1, pat2, rhs2 parseState 1 2, { ColonColonRange = mColonColon }) }
@@ -3683,8 +3683,9 @@ constrPattern:
36833683
{ let m = unionRanges (rhs parseState 1) $2.Range
36843684
SynPat.IsInst($2, m) }
36853685

3686-
| COLON_QMARK recover %prec pat_isinst
3686+
| COLON_QMARK ends_coming_soon_or_recover %prec pat_isinst
36873687
{ let mColon = rhs parseState 1
3688+
reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
36883689
let ty = SynType.FromParseError(mColon.EndRange)
36893690
SynPat.IsInst(ty, mColon) }
36903691

@@ -3867,8 +3868,9 @@ parenPattern:
38673868
{ let mLhs = lhs parseState
38683869
SynPat.Typed($1, $3, mLhs) }
38693870

3870-
| parenPattern COLON recover
3871+
| parenPattern COLON ends_coming_soon_or_recover
38713872
{ let mColon = rhs parseState 2
3873+
reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
38723874
let ty = SynType.FromParseError(mColon.EndRange)
38733875
SynPat.Typed($1, ty, unionRanges $1.Range mColon) }
38743876

@@ -3880,8 +3882,9 @@ parenPattern:
38803882
{ let mColonColon = rhs parseState 2
38813883
SynPat.ListCons($1, $3, rhs2 parseState 1 3, { ColonColonRange = mColonColon }) }
38823884

3883-
| parenPattern COLON_COLON recover
3885+
| parenPattern COLON_COLON ends_coming_soon_or_recover
38843886
{ let mColonColon = rhs parseState 2
3887+
reportParseErrorAt mColonColon (FSComp.SR.parsExpectingPattern ())
38853888
let pat2 = SynPat.Wild(mColonColon.EndRange)
38863889
SynPat.ListCons($1, pat2, rhs2 parseState 1 2, { ColonColonRange = mColonColon }) }
38873890

0 commit comments

Comments
 (0)