Skip to content

Commit

Permalink
Fix wild self id pat range, simplify grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
auduchinok committed Feb 27, 2020
1 parent 5d28cc5 commit 0ef7dbe
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/fsharp/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -1933,18 +1933,12 @@ opt_typ:
| COLON typ { Some $2 }

atomicPatternLongIdent:
| UNDERSCORE DOT pathOp {
| opt_access UNDERSCORE DOT pathOp {
if not (parseState.LexBuffer.SupportsFeature LanguageFeature.SingleUnderscorePattern) then
raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolDot())
let (LongIdentWithDots(lid,dotms)) = $3 in (None,LongIdentWithDots(ident("_",rhs parseState 1)::lid, rhs parseState 2::dotms))
}
raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedSymbolDot())
let (LongIdentWithDots(lid,dotms)) = $4 in ($1,LongIdentWithDots(ident("_", rhs parseState 2) :: lid, rhs parseState 3 :: dotms)) }
| GLOBAL DOT pathOp { let (LongIdentWithDots(lid,dotms)) = $3 in (None,LongIdentWithDots(ident(MangledGlobalName,rhs parseState 1) :: lid, rhs parseState 2 :: dotms)) }
| pathOp { (None,$1) }
| access UNDERSCORE DOT pathOp {
if not (parseState.LexBuffer.SupportsFeature LanguageFeature.SingleUnderscorePattern) then
raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolDot())
let (LongIdentWithDots(lid,dotms)) = $4 in (Some($1),LongIdentWithDots(ident("_",rhs parseState 1)::lid, rhs parseState 2::dotms))
}
| access pathOp { (Some($1), $2) }


Expand Down

0 comments on commit 0ef7dbe

Please sign in to comment.