Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/Compiler/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -2258,12 +2258,25 @@ opt_typ:
let ty = SynType.FromParseError(mColon.EndRange)
Some ty }


atomicPatternLongIdent:
underscoreLongIdentPat:
| UNDERSCORE DOT pathOp
{ let underscore = ident("_", rhs parseState 1)
let mDot = rhs parseState 2
None, prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $3 }
prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $3 }
| UNDERSCORE DOT %prec prec_recover
{ let underscore = ident("_", rhs parseState 1)
let mDot = rhs parseState 2
reportParseErrorAt mDot.EndRange (FSComp.SR.parsIdentifierExpected())
SynLongIdent([underscore], [mDot], [None]) }
| UNDERSCORE DOT ends_coming_soon_or_recover
{ if not $3 then reportParseErrorAt (rhs parseState 3) (FSComp.SR.parsIdentifierExpected())
let underscore = ident("_", rhs parseState 1)
let mDot = rhs parseState 2
SynLongIdent([underscore], [mDot], [None]) }

atomicPatternLongIdent:
| underscoreLongIdentPat
{ None, $1 }

| GLOBAL DOT pathOp
{ let globalIdent = ident(MangledGlobalName, rhs parseState 1)
Expand All @@ -2273,10 +2286,8 @@ atomicPatternLongIdent:
| pathOp
{ (None, $1) }

| access UNDERSCORE DOT pathOp
{ let underscore = ident("_", rhs parseState 2)
let mDot = rhs parseState 3
Some($1), prependIdentInLongIdentWithTrivia (SynIdent(underscore, None)) mDot $4 }
| access underscoreLongIdentPat
{ Some($1), $2 }

| access pathOp
{ (Some($1), $2) }
Expand Down
17 changes: 9 additions & 8 deletions tests/service/data/SyntaxTree/Member/Member 11.fs.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@ ImplFile
SynValInfo
([[SynArgInfo ([], false, None)]; []],
SynArgInfo ([], false, None)), None),
FromParseError (Wild (6,10--6,10), (6,10--6,10)), None,
ArbitraryAfterError ("classDefnMember1", (6,10--6,10)),
(6,4--6,10), NoneAtInvisible,
Named (SynIdent (_, None), false, None, (6,11--6,12)),
None, ArbitraryAfterError ("memberCore2", (6,12--6,12)),
(6,11--6,12), NoneAtInvisible,
{ LeadingKeyword = Member (6,4--6,10)
InlineKeyword = None
EqualsRange = None }), (6,4--6,10))], None,
(3,5--6,10), { LeadingKeyword = Type (3,0--3,4)
EqualsRange = None }), (6,4--6,12))], None,
(3,5--6,12), { LeadingKeyword = Type (3,0--3,4)
EqualsRange = Some (3,7--3,8)
WithKeyword = None })], (3,0--6,10))],
WithKeyword = None })], (3,0--6,12))],
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None,
(1,0--6,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true),
(1,0--6,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true),
{ ConditionalDirectives = []
WarnDirectives = []
CodeComments = [] }, set []))

(7,0)-(7,0) parse error Incomplete structured construct at or before this point in member definition. Expected identifier, '(', '(*)' or other token.
(7,0)-(7,0) parse error Identifier expected
(7,0)-(7,0) parse error Expecting member body
Original file line number Diff line number Diff line change
Expand Up @@ -1927,11 +1927,11 @@ let _ =
let fileContents =
"""
type G<'a> () =
override _.
override _.g

override x.ToString () = ""

[<AbstractClass]
[<AbstractClass>]
type A () =
abstract member A1: unit -> unit
abstract member A1: string -> unit
Expand All @@ -1953,7 +1953,7 @@ type C () =
override A1 s = ()
"""

VerifyCompletionListExactly(fileContents, "override _.", [ "Equals (obj: obj): bool"; "Finalize (): unit"; "GetHashCode (): int" ])
VerifyCompletionListExactly(fileContents, "override _.g", [ "Equals (obj: obj): bool"; "Finalize (): unit"; "GetHashCode (): int" ])

VerifyCompletionListExactly(
fileContents,
Expand Down
Loading