Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 docs/release-notes/.FSharp.Compiler.Service/11.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Type checker: recover on checking binding parameter constraints ([#19046](https://github.com/dotnet/fsharp/pull/19046))
* Debugger: provide breakpoint ranges for short lambdas ([#19067](https://github.com/dotnet/fsharp/pull/19067))
* FSharpDiagnostic: add default severity ([#19152](https://github.com/dotnet/fsharp/pull/19152))
* Add support for triple quoted ASCII byte string ([#19182](https://github.com/dotnet/fsharp/pull/19182))

### Changed

Expand Down
6 changes: 6 additions & 0 deletions src/Compiler/lex.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,12 @@ and tripleQuoteString (sargs: LexerStringArgs) (skip: bool) = parse
let cont = LexCont.Token(args.ifdefStack, args.stringNest)
fin.Finish buf kind LexerStringFinisherContext.TripleQuote cont }

| '"' '"' '"' 'B'
{ let (buf, fin, _m, kind, args) = sargs
args.interpolationDelimiterLength <- 0
let cont = LexCont.Token(args.ifdefStack, args.stringNest)
fin.Finish buf { kind with IsByteString = true } LexerStringFinisherContext.TripleQuote cont }

| newline
{ let (buf, _fin, m, kind, args) = sargs
incrLine lexbuf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ module ``Basic Grammar Element Constants`` =

[<Fact>]
let ``Basic constants compile `` () =
let tripleQuotedByteString = " \"\"\" \" \"\"\"B "

CompilerAssert.Pass
"""
$"""
let sbyteConst = 1y
let int16Const = 1us
let int32Const = 1ul
Expand Down Expand Up @@ -42,6 +44,8 @@ let charConst = '1'
let stringConst = "1"
let bytestringConst = "1"B
let byteTripleQuotedStringConst = {tripleQuotedByteString}
let bytecharConst = '1'B
Expand Down
Loading