Skip to content

Commit 3d7ea01

Browse files
authored
Fix attribute list range for list ending with semicolon (#8969)
1 parent 35d741c commit 3d7ea01

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/fsharp/pars.fsy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ attributes:
13641364
/* One set of custom attributes, including [< ... >] */
13651365
attributeList:
13661366
| LBRACK_LESS attributeListElements opt_seps GREATER_RBRACK opt_OBLOCKSEP
1367-
{ mkAttributeList $2 (rhs2 parseState 1 3) }
1367+
{ mkAttributeList $2 (rhs2 parseState 1 4) }
13681368

13691369
| LBRACK_LESS error GREATER_RBRACK opt_OBLOCKSEP
13701370
{ mkAttributeList [] (rhs2 parseState 1 3) }

tests/service/ServiceUntypedParseTests.fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ let foo6 = ()
126126
127127
[<>]
128128
let foo7 = ()
129+
130+
[<A;>]
131+
let foo8 = ()
129132
"""
130133
let (SynModuleOrNamespace (_, _, _, decls, _, _, _, _)) = parseSourceCodeAndGetModule source
131134
decls |> List.map (fun decl ->
@@ -145,7 +148,8 @@ let foo7 = ()
145148
[ (1, ((12, 0), (13, 0))) ]
146149
[ (1, ((15, 0), (15, 4))) ]
147150
[ (0, ((18, 0), (18, 2))) ]
148-
[ (0, ((21, 0), (21, 4))) ] ]
151+
[ (0, ((21, 0), (21, 4))) ]
152+
[ (1, ((24, 0), (24, 6))) ] ]
149153

150154

151155
module TypeMemberRanges =

0 commit comments

Comments
 (0)