-
Notifications
You must be signed in to change notification settings - Fork 830
Parser: Update OBLOCKSEP token passing #18921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9f9c0ec
8347ba2
3e1a3c7
02d2984
9139f3e
489cf4f
74db5c8
fcc7b41
ae13b59
c9be8b7
fb776ab
8828dad
aa7bd57
04d0c5b
ffdaa6e
7d89c7b
37b3cf1
d138a23
1ff5bed
53809e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,21 +308,13 @@ type SeqExprOnly = SeqExprOnly of bool | |
|
|
||
| [<NoEquality; NoComparison; RequireQualifiedAccess>] | ||
| type BlockSeparator = | ||
| | Semicolon of range: range * position: pos option | ||
| | Comma of range: range * position: pos option | ||
| | Offside of range: range * position: pos option | ||
| | Semicolon of range: range | ||
| | Comma of range: range | ||
|
|
||
| member this.Range = | ||
| match this with | ||
| | Semicolon(range = m) | ||
| | Comma(range = m) | ||
| | Offside(range = m) -> m | ||
|
|
||
| member this.Position = | ||
| match this with | ||
| | Semicolon(position = p) | ||
| | Comma(position = p) | ||
| | Offside(position = p) -> p | ||
| | Comma(range = m) -> m | ||
|
|
||
| type RecordFieldName = SynLongIdent * bool | ||
|
|
||
|
|
@@ -549,18 +541,19 @@ type SynExpr = | |
|
|
||
| | AnonRecd of | ||
| isStruct: bool * | ||
| copyInfo: (SynExpr * BlockSeparator) option * | ||
| copyInfo: (SynExpr * BlockSeparator option) option * | ||
| recordFields: (SynLongIdent * range option * SynExpr) list * | ||
| range: range * | ||
| trivia: SynExprAnonRecdTrivia | ||
| trivia: SynExprRecdTrivia | ||
|
|
||
| | ArrayOrList of isArray: bool * exprs: SynExpr list * range: range | ||
|
|
||
| | Record of | ||
| baseInfo: (SynType * SynExpr * range * BlockSeparator option * range) option * | ||
| copyInfo: (SynExpr * BlockSeparator) option * | ||
| copyInfo: (SynExpr * BlockSeparator option) option * | ||
|
Comment on lines
-561
to
+553
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This place still looks very wrong. We've stored the |
||
| recordFields: SynExprRecordField list * | ||
| range: range | ||
| range: range * | ||
| trivia: SynExprRecdTrivia | ||
|
|
||
| | New of isProtected: bool * targetType: SynType * expr: SynExpr * range: range | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does
4magic constant come from? If we assume that a separator is;or,then it can't be 4 characters long.If this is a
withkeyword range, it should not be calculated from the id, it's job of the parser to preserve it correctly, like it was before.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was how it was originally. See https://github.com/dotnet/fsharp/pull/18899/files#diff-1e790bba80026c421a964cb1d8be0297aff37a0a3dbe7cbf954b54f6e3544e40L93-L100. But I think in this case we do not have a separator we can use
range0?