Skip to content

Commit fcc7b41

Browse files
committed
Remove position from BlockSeparator
1 parent 74db5c8 commit fcc7b41

19 files changed

+40
-56
lines changed

src/Compiler/Service/ServiceParseTreeWalk.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ module SyntaxTraversal =
500500
// inherit A()
501501
// $
502502
// field1 = 5
503-
diveIntoSeparator blockSep.Position None)
503+
diveIntoSeparator blockSep.Range.End None)
504504
| None -> ()
505505
| _ -> ()
506506

@@ -561,7 +561,7 @@ module SyntaxTraversal =
561561
// field1 = 5
562562
// $
563563
// field2 = 5
564-
diveIntoSeparator blockSep.Position copyOpt)
564+
diveIntoSeparator blockSep.Range.End copyOpt)
565565
| _ -> ()
566566

567567
]

src/Compiler/SyntaxTree/SyntaxTree.fs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,19 +308,14 @@ type SeqExprOnly = SeqExprOnly of bool
308308

309309
[<NoEquality; NoComparison; RequireQualifiedAccess>]
310310
type BlockSeparator =
311-
| Semicolon of range: range * position: pos
312-
| Comma of range: range * position: pos
311+
| Semicolon of range: range
312+
| Comma of range: range
313313

314314
member this.Range =
315315
match this with
316316
| Semicolon(range = m)
317317
| Comma(range = m) -> m
318318

319-
member this.Position =
320-
match this with
321-
| Semicolon(position = p) -> p
322-
| Comma(position = p) -> p
323-
324319
type RecordFieldName = SynLongIdent * bool
325320

326321
type ExprAtomicFlag =

src/Compiler/SyntaxTree/SyntaxTree.fsi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,17 +359,13 @@ type SeqExprOnly =
359359
type BlockSeparator =
360360
/// A separator consisting of a semicolon ';'
361361
/// range is the range of the semicolon
362-
/// position is the position of the semicolon
363-
| Semicolon of range: range * position: pos
362+
| Semicolon of range: range
364363
/// A separator consisting of a comma ','
365364
/// range is the range of the comma
366-
/// position is the position of the comma
367-
| Comma of range: range * position: pos
365+
| Comma of range: range
368366

369367
member Range: range
370368

371-
member Position: pos
372-
373369
/// Represents a record field name plus a flag indicating if given record field name is syntactically
374370
/// correct and can be used in name resolution.
375371
type RecordFieldName = SynLongIdent * bool

src/Compiler/pars.fsy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5771,13 +5771,13 @@ seps_block:
57715771

57725772
| SEMICOLON
57735773
{ let m = (rhs parseState 1)
5774-
Some (BlockSeparator.Semicolon(m, m.End)) }
5774+
Some (BlockSeparator.Semicolon(m)) }
57755775

57765776
| SEMICOLON OBLOCKSEP
5777-
{ Some (BlockSeparator.Semicolon((rhs2 parseState 1 2), (rhs parseState 1).End)) }
5777+
{ Some (BlockSeparator.Semicolon((rhs2 parseState 1 2))) }
57785778

57795779
| OBLOCKSEP SEMICOLON
5780-
{ Some (BlockSeparator.Semicolon((rhs2 parseState 1 2), (rhs parseState 2).End)) }
5780+
{ Some (BlockSeparator.Semicolon((rhs2 parseState 1 2))) }
57815781

57825782

57835783
/* identifier can start from the underscore */

tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5919,12 +5919,8 @@ FSharp.Compiler.Symbols.FSharpXmlDoc: Int32 GetHashCode(System.Collections.IEqua
59195919
FSharp.Compiler.Symbols.FSharpXmlDoc: Int32 Tag
59205920
FSharp.Compiler.Symbols.FSharpXmlDoc: Int32 get_Tag()
59215921
FSharp.Compiler.Symbols.FSharpXmlDoc: System.String ToString()
5922-
FSharp.Compiler.Syntax.BlockSeparator+Comma: FSharp.Compiler.Text.Position get_position()
5923-
FSharp.Compiler.Syntax.BlockSeparator+Comma: FSharp.Compiler.Text.Position position
59245922
FSharp.Compiler.Syntax.BlockSeparator+Comma: FSharp.Compiler.Text.Range get_range()
59255923
FSharp.Compiler.Syntax.BlockSeparator+Comma: FSharp.Compiler.Text.Range range
5926-
FSharp.Compiler.Syntax.BlockSeparator+Semicolon: FSharp.Compiler.Text.Position get_position()
5927-
FSharp.Compiler.Syntax.BlockSeparator+Semicolon: FSharp.Compiler.Text.Position position
59285924
FSharp.Compiler.Syntax.BlockSeparator+Semicolon: FSharp.Compiler.Text.Range get_range()
59295925
FSharp.Compiler.Syntax.BlockSeparator+Semicolon: FSharp.Compiler.Text.Range range
59305926
FSharp.Compiler.Syntax.BlockSeparator+Tags: Int32 Comma
@@ -5933,13 +5929,11 @@ FSharp.Compiler.Syntax.BlockSeparator: Boolean IsComma
59335929
FSharp.Compiler.Syntax.BlockSeparator: Boolean IsSemicolon
59345930
FSharp.Compiler.Syntax.BlockSeparator: Boolean get_IsComma()
59355931
FSharp.Compiler.Syntax.BlockSeparator: Boolean get_IsSemicolon()
5936-
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator NewComma(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Position)
5937-
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator NewSemicolon(FSharp.Compiler.Text.Range, FSharp.Compiler.Text.Position)
5932+
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator NewComma(FSharp.Compiler.Text.Range)
5933+
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator NewSemicolon(FSharp.Compiler.Text.Range)
59385934
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator+Comma
59395935
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator+Semicolon
59405936
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Syntax.BlockSeparator+Tags
5941-
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Text.Position Position
5942-
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Text.Position get_Position()
59435937
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Text.Range Range
59445938
FSharp.Compiler.Syntax.BlockSeparator: FSharp.Compiler.Text.Range get_Range()
59455939
FSharp.Compiler.Syntax.BlockSeparator: Int32 Tag

tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ ImplFile
1414
(LongIdent (SynLongIdent ([Exception], [], [None])),
1515
Paren
1616
(Ident msg, (2,19--2,20), Some (2,23--2,24), (2,19--2,24)),
17-
(2,10--2,24), Some (Semicolon ((2,24--2,25), (2,25))),
18-
(2,2--2,9)), None,
17+
(2,10--2,24), Some (Semicolon (2,24--2,25)), (2,2--2,9)),
18+
None,
1919
[SynExprRecordField
2020
((SynLongIdent ([X], [], [None]), true), Some (2,28--2,29),
2121
Some (Const (Int32 1, (2,30--2,31))), (2,26--2,31),
22-
Some (Semicolon ((2,31--2,32), (2,32))))], (2,0--2,34)),
23-
(2,0--2,34))], PreXmlDocEmpty, [], None, (2,0--2,34),
24-
{ LeadingKeyword = None })], (true, true),
25-
{ ConditionalDirectives = []
26-
WarnDirectives = []
27-
CodeComments = [] }, set []))
22+
Some (Semicolon (2,31--2,32)))], (2,0--2,34)), (2,0--2,34))],
23+
PreXmlDocEmpty, [], None, (2,0--2,34), { LeadingKeyword = None })],
24+
(true, true), { ConditionalDirectives = []
25+
WarnDirectives = []
26+
CodeComments = [] }, set []))

tests/service/data/SyntaxTree/Pattern/Named field 01.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ImplFile
1313
([NamePatPairField
1414
(SynLongIdent ([a], [], [None]), Some (4,6--4,7),
1515
(4,4--4,9), Wild (4,8--4,9),
16-
Some (Semicolon ((4,9--4,10), (4,10))));
16+
Some (Semicolon (4,9--4,10)));
1717
NamePatPairField
1818
(SynLongIdent ([b], [], [None]), Some (4,13--4,14),
1919
(4,11--4,16), Wild (4,15--4,16), None)],

tests/service/data/SyntaxTree/Pattern/Named field 02.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ImplFile
1313
([NamePatPairField
1414
(SynLongIdent ([a], [], [None]), Some (4,6--4,7),
1515
(4,4--4,9), Wild (4,8--4,9),
16-
Some (Semicolon ((4,9--4,10), (4,10))));
16+
Some (Semicolon (4,9--4,10)));
1717
NamePatPairField
1818
(SynLongIdent ([b], [], [None]), Some (4,13--4,14),
1919
(4,11--4,14),

tests/service/data/SyntaxTree/Pattern/Named field 03.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ImplFile
1313
([NamePatPairField
1414
(SynLongIdent ([a], [], [None]), Some (4,6--4,7),
1515
(4,4--4,9), Wild (4,8--4,9),
16-
Some (Semicolon ((4,9--4,10), (4,10))));
16+
Some (Semicolon (4,9--4,10)));
1717
NamePatPairField
1818
(SynLongIdent ([b], [], [None]), None,
1919
(4,11--4,12),

tests/service/data/SyntaxTree/Pattern/Named field 04.fs.bsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ ImplFile
1313
([NamePatPairField
1414
(SynLongIdent ([a], [], [None]), Some (4,6--4,7),
1515
(4,4--4,9), Wild (4,8--4,9),
16-
Some (Semicolon ((4,9--4,10), (4,10))))],
17-
(4,4--4,10), { ParenRange = (4,3--4,11) }), None,
18-
(4,2--4,11)), None, Const (Int32 2, (4,15--4,16)),
19-
(4,2--4,16), Yes, { ArrowRange = Some (4,12--4,14)
20-
BarRange = Some (4,0--4,1) })],
21-
(3,0--4,16), { MatchKeyword = (3,0--3,5)
22-
WithKeyword = (3,8--3,12) }), (3,0--4,16))],
16+
Some (Semicolon (4,9--4,10)))], (4,4--4,10),
17+
{ ParenRange = (4,3--4,11) }), None, (4,2--4,11)),
18+
None, Const (Int32 2, (4,15--4,16)), (4,2--4,16), Yes,
19+
{ ArrowRange = Some (4,12--4,14)
20+
BarRange = Some (4,0--4,1) })], (3,0--4,16),
21+
{ MatchKeyword = (3,0--3,5)
22+
WithKeyword = (3,8--3,12) }), (3,0--4,16))],
2323
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None,
2424
(1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true),
2525
{ ConditionalDirectives = []

0 commit comments

Comments
 (0)