Skip to content

Commit

Permalink
Merge pull request #16793 from dotnet/merges/main-to-release/dev17.10
Browse files Browse the repository at this point in the history
Merge main to release/dev17.10
  • Loading branch information
KevinRansom authored Mar 1, 2024
2 parents f0f39f8 + 9f702ad commit cc0ccdf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Fixed

* Fix wrong range start of INTERP_STRING_END. ([PR #16774](https://github.com/dotnet/fsharp/pull/16774))
* Fix wrong range start of INTERP_STRING_END. ([PR #16774](https://github.com/dotnet/fsharp/pull/16774), [PR #16785](https://github.com/dotnet/fsharp/pull/16785))
* Fix missing warning for recursive calls in list comprehensions. ([PR #16652](https://github.com/dotnet/fsharp/pull/16652))
* Code generated files with > 64K methods and generated symbols crash when loaded. Use infered sequence points for debugging. ([Issue #16399](https://github.com/dotnet/fsharp/issues/16399), [#PR 16514](https://github.com/dotnet/fsharp/pull/16514))
* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550), [PR #16743](https://github.com/dotnet/fsharp/pull/16743))
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Service/ServiceLexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module FSharpTokenTag =
let INTERP_STRING_BEGIN_PART =
tagOfToken (INTERP_STRING_BEGIN_PART("a", SynStringKind.Regular, LexCont.Default))

let INTERP_STRING_PART = tagOfToken (INTERP_STRING_PART("a", LexCont.Default))
let INTERP_STRING_PART = tagOfToken (INTERP_STRING_PART("a", None, LexCont.Default))
let INTERP_STRING_END = tagOfToken (INTERP_STRING_END("a", None, LexCont.Default))
let LPAREN = tagOfToken LPAREN
let RPAREN = tagOfToken RPAREN
Expand Down Expand Up @@ -491,7 +491,7 @@ module internal LexerStateEncoding =
| STRING_TEXT cont
| EOF cont
| INTERP_STRING_BEGIN_PART(_, _, cont)
| INTERP_STRING_PART(_, cont)
| INTERP_STRING_PART(_, _, cont)
| INTERP_STRING_BEGIN_END(_, _, cont)
| INTERP_STRING_END(_, _, cont)
| LBRACE cont
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/SyntaxTree/LexHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ type LexerStringFinisher =
else
INTERP_STRING_BEGIN_END(s, synStringKind, cont)
else if isPart then
INTERP_STRING_PART(s, cont)
INTERP_STRING_PART(s, None, cont)
else
INTERP_STRING_END(s, None, cont)
elif kind.IsByteString then
Expand Down
6 changes: 3 additions & 3 deletions src/Compiler/lex.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ let checkExprGreaterColonOp (lexbuf:UnicodeLexing.Lexbuf) =
let unexpectedChar lexbuf =
LEX_FAILURE (FSComp.SR.lexUnexpectedChar(lexeme lexbuf))

let startString args (lexbuf: UnicodeLexing.Lexbuf) altStartForStringEnd =
let startString args (lexbuf: UnicodeLexing.Lexbuf) altStartForStringPartOrEnd =
let buf = ByteBuffer.Create StringCapacity
let m = lexbuf.LexemeRange
let startp = lexbuf.StartPos
Expand Down Expand Up @@ -158,9 +158,9 @@ let startString args (lexbuf: UnicodeLexing.Lexbuf) altStartForStringEnd =
INTERP_STRING_BEGIN_END (s, synStringKind, cont)
else
if isPart then
INTERP_STRING_PART (s, cont)
INTERP_STRING_PART (s, altStartForStringPartOrEnd, cont)
else
INTERP_STRING_END (s, altStartForStringEnd, cont)
INTERP_STRING_END (s, altStartForStringPartOrEnd, cont)
else
let s = Lexhelp.stringBufferAsString buf
let synStringKind =
Expand Down
18 changes: 15 additions & 3 deletions src/Compiler/pars.fsy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) ->
%token <string * SynStringKind * ParseHelpers.LexerContinuation> STRING
%token <string * SynStringKind * ParseHelpers.LexerContinuation> INTERP_STRING_BEGIN_END
%token <string * SynStringKind * ParseHelpers.LexerContinuation> INTERP_STRING_BEGIN_PART
%token <string * ParseHelpers.LexerContinuation> INTERP_STRING_PART
%token <string * range option * ParseHelpers.LexerContinuation> INTERP_STRING_PART
%token <string * range option * ParseHelpers.LexerContinuation> INTERP_STRING_END
%token <ParseHelpers.LexerContinuation> LBRACE RBRACE

Expand Down Expand Up @@ -6784,13 +6784,25 @@ interpolatedStringParts:
[ SynInterpolatedStringPart.String(s, m) ] }

| INTERP_STRING_PART interpolatedStringFill interpolatedStringParts
{ SynInterpolatedStringPart.String(fst $1, rhs parseState 1) :: SynInterpolatedStringPart.FillExpr $2 :: $3 }
{ let (s, altStart, _) = $1
let mOrig = rhs parseState 1
let m =
match altStart with
| Some r -> unionRanges r mOrig
| None -> mOrig
SynInterpolatedStringPart.String(s, m) :: SynInterpolatedStringPart.FillExpr $2 :: $3 }

| INTERP_STRING_PART interpolatedStringParts
{ let rbrace = parseState.InputEndPosition 1
let lbrace = parseState.InputStartPosition 2
reportParseErrorAt (mkSynRange rbrace lbrace) (FSComp.SR.parsEmptyFillInInterpolatedString())
SynInterpolatedStringPart.String(fst $1, rhs parseState 1) :: $2 }
let (s, altStart, _) = $1
let mOrig = rhs parseState 1
let m =
match altStart with
| Some r -> unionRanges r mOrig
| None -> mOrig
SynInterpolatedStringPart.String(s, m) :: $2 }

/* INTERP_STRING_BEGIN_END */
/* INTERP_STRING_BEGIN_PART int32 INTERP_STRING_END */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ImplFile
InterpolatedString
([String ("1 + ", (2,8--2,21));
FillExpr (Const (Int32 41, (2,21--2,23)), None);
String (" = ", (2,25--2,32));
String (" = ", (2,23--2,32));
FillExpr (Const (Int32 6, (2,32--2,33)), None);
String (" * 7", (2,33--2,43))], TripleQuote, (2,8--2,43)),
(2,4--2,5), Yes (2,0--2,43), { LeadingKeyword = Let (2,0--2,3)
Expand Down

0 comments on commit cc0ccdf

Please sign in to comment.