Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
034d4d6
Add a new token GREATER_BAR_RBRACE
edgarfgp May 11, 2025
0745593
Update lex.fsl
edgarfgp May 11, 2025
120c02c
Update FSStrings
edgarfgp May 11, 2025
c87844d
Update ServiceLexing
edgarfgp May 11, 2025
afd4adf
Update CompilerDiagnostics
edgarfgp May 11, 2025
28cf61f
Update LexFilter
edgarfgp May 11, 2025
95180ae
Add SyntaxTree tests
edgarfgp May 11, 2025
15ec291
more tests
edgarfgp May 11, 2025
136c8b5
Merge branch 'main' into fix-10629
edgarfgp May 11, 2025
5d72ba9
Update baselines
edgarfgp May 11, 2025
046588c
Merge branch 'fix-10629' of github.com:edgarfgp/fsharp into fix-10629
edgarfgp May 11, 2025
306e18f
Add more tests
edgarfgp May 11, 2025
8ba39be
release notes
edgarfgp May 11, 2025
e0ef7df
ILVerify
edgarfgp May 11, 2025
729ebbb
more tests
edgarfgp May 11, 2025
52994ec
Merge branch 'main' into fix-10629
edgarfgp May 12, 2025
9d60b9c
Merge branch 'main' into fix-10629
edgarfgp May 13, 2025
d1db7d3
Merge branch 'main' into fix-10629
edgarfgp May 14, 2025
18e4fd1
Merge branch 'main' into fix-10629
edgarfgp May 15, 2025
d6457ed
update syntax tree tests
edgarfgp May 15, 2025
fa7cbd9
Add LanguageFeature BetterAnonymousRecordParsing
edgarfgp May 15, 2025
69ba907
release notes
edgarfgp May 15, 2025
2c5b65e
release notes
edgarfgp May 15, 2025
6ca06c5
update baselines
edgarfgp May 15, 2025
addd36a
Merge branch 'fix-10629' of github.com:edgarfgp/fsharp into fix-10629
edgarfgp May 15, 2025
3a6aa30
Merge branch 'main' into fix-10629
edgarfgp May 16, 2025
077f33a
Merge branch 'main' into fix-10629
T-Gro May 16, 2025
434662f
Merge branch 'main' into fix-10629
edgarfgp May 19, 2025
5ca1e99
update ILVerify tests
edgarfgp May 19, 2025
900927c
Merge branch 'main' into fix-10629
edgarfgp May 20, 2025
882b0bb
Merge branch 'main' into fix-10629
T-Gro May 22, 2025
72b7b9b
Merge branch 'main' into fix-10629
edgarfgp May 22, 2025
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
1 change: 1 addition & 0 deletions src/Compiler/Driver/CompilerDiagnostics.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ type Exception with
| Parser.TOKEN_COLON_EQUALS -> SR.GetString("Parser.TOKEN.COLON.EQUALS")
| Parser.TOKEN_LARROW -> SR.GetString("Parser.TOKEN.LARROW")
| Parser.TOKEN_EQUALS -> SR.GetString("Parser.TOKEN.EQUALS")
| Parser.TOKEN_GREATER_BAR_RBRACE -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACE")
| Parser.TOKEN_GREATER_BAR_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACK")
| Parser.TOKEN_MINUS -> SR.GetString("Parser.TOKEN.MINUS")
| Parser.TOKEN_ADJACENT_PREFIX_OP -> SR.GetString("Parser.TOKEN.ADJACENT.PREFIX.OP")
Expand Down
3 changes: 3 additions & 0 deletions src/Compiler/FSStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@
<data name="Parser.TOKEN.EQUALS" xml:space="preserve">
<value>symbol '='</value>
</data>
<data name="Parser.TOKEN.GREATER.BAR.RBRACE" xml:space="preserve">
<value>symbol '&gt;|}'</value>
</data>
<data name="Parser.TOKEN.GREATER.BAR.RBRACK" xml:space="preserve">
<value>symbol '&gt;|]'</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions src/Compiler/Service/ServiceLexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ module internal TokenClassifications =
| LBRACE_BAR -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.MatchBraces)

| GREATER_RBRACK
| GREATER_BAR_RBRACE
| GREATER_BAR_RBRACK -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.None)

| RQUOTE _
Expand Down Expand Up @@ -1371,6 +1372,7 @@ type FSharpTokenKind =
| Comma
| RightArrow
| GreaterBarRightBracket
| GreaterBarRightBrace
| LeftParenthesisStarRightParenthesis
| Open
| Or
Expand Down Expand Up @@ -1581,6 +1583,7 @@ type FSharpToken =
| STAR -> FSharpTokenKind.Star
| COMMA -> FSharpTokenKind.Comma
| RARROW -> FSharpTokenKind.RightArrow
| GREATER_BAR_RBRACE -> FSharpTokenKind.GreaterBarRightBrace
| GREATER_BAR_RBRACK -> FSharpTokenKind.GreaterBarRightBracket
| LPAREN_STAR_RPAREN -> FSharpTokenKind.LeftParenthesisStarRightParenthesis
| OPEN -> FSharpTokenKind.Open
Expand Down
1 change: 1 addition & 0 deletions src/Compiler/Service/ServiceLexing.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ type public FSharpTokenKind =
| Comma
| RightArrow
| GreaterBarRightBracket
| GreaterBarRightBrace
| LeftParenthesisStarRightParenthesis
| Open
| Or
Expand Down
6 changes: 5 additions & 1 deletion src/Compiler/SyntaxTree/LexFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ type LexFilterImpl (
scanAhead nParen
else
false
| GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK ->
| GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK | GREATER_BAR_RBRACE ->
let nParen = nParen - 1
let hasAfterOp = (match lookaheadToken with GREATER _ -> false | _ -> true)
if nParen > 0 then
Expand Down Expand Up @@ -1201,6 +1201,10 @@ type LexFilterImpl (
delayToken (pool.UseShiftedLocation(tokenTup, INFIX_AT_HAT_OP "@", 1, 0))
delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1))
pool.Return tokenTup
| GREATER_BAR_RBRACE ->
delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0))
delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2))
pool.Return tokenTup
| GREATER_BAR_RBRACK ->
delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0))
delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2))
Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/lex.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ rule token (args: LexArgs) (skip: bool) = parse

| ">" { GREATER false }

| ">|}" { GREATER_BAR_RBRACE }

| "[<" { LBRACK_LESS }

| "]" { RBRACK }
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) ->
%token EXCEPTION FALSE FOR FUN FUNCTION IF IN JOIN_IN FINALLY DO_BANG
%token LAZY OLAZY MATCH MATCH_BANG MUTABLE NEW OF
%token OPEN OR REC THEN TO TRUE TRY TYPE VAL INLINE INTERFACE INSTANCE CONST
%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK LPAREN_STAR_RPAREN
%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK GREATER_BAR_RBRACE LPAREN_STAR_RPAREN
%token QMARK QMARK_QMARK DOT COLON COLON_COLON COLON_GREATER COLON_QMARK_GREATER COLON_QMARK COLON_EQUALS SEMICOLON
%token SEMICOLON_SEMICOLON LARROW EQUALS LBRACK LBRACK_BAR LBRACE_BAR LBRACK_LESS
%token BAR_RBRACK BAR_RBRACE UNDERSCORE
Expand Down
5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compiler/xlf/FSStrings.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ module AnonRecd =
|> shouldFail
|> withErrorCode 3522
|> withMessage "The field 'A' appears multiple times in this record expression."

[<Fact>]
let ``Anonymous Record with unit of measures`` () =
FSharp """
namespace FSharpTest

[<Measure>]
type m

module AnonRecd =
let a = {|a=1<m>|}
let b = {|a=1<m>; b=2<m>|}
let c = {|a=1<m> |}
let d = {| a=1<m>; b=2<m>; c=3<m> |}
"""
|> compile
|> shouldSucceed

[<Fact>]
let ``Anonymous Record missing single field`` () =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11296,6 +11296,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash
Expand Down Expand Up @@ -11491,6 +11492,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash
Expand Down Expand Up @@ -11682,6 +11684,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash()
Expand Down Expand Up @@ -11873,6 +11876,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash
Expand Down Expand Up @@ -12064,6 +12068,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11296,6 +11296,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash
Expand Down Expand Up @@ -11491,6 +11492,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash
Expand Down Expand Up @@ -11682,6 +11684,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash()
Expand Down Expand Up @@ -11873,6 +11876,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash
Expand Down Expand Up @@ -12064,6 +12068,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket()
FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash()
Expand Down
10 changes: 10 additions & 0 deletions tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Module

{|a=1<m> |}

{|a=1<m>|}

{| a=1<m>|}

{| a=1<m> |}

Loading
Loading