diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index 66ee0bd792e0..3189ef020602 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -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) }