mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Merge pull request #3635 from rtfeldman/joshuawarner32/multiline
Strip indents and the first/last newline from multiline strings
This commit is contained in:
commit
fa5bd442f8
8 changed files with 284 additions and 44 deletions
|
@ -0,0 +1,114 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(2147483649),
|
||||
Index(2147483650),
|
||||
],
|
||||
regions: [
|
||||
@0-22,
|
||||
@23-49,
|
||||
@50-92,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
Slice(start = 1, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
Slice(start = 2, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Identifier(
|
||||
"a",
|
||||
),
|
||||
@4-22 Str(
|
||||
Line(
|
||||
[
|
||||
Plaintext(
|
||||
"Hello,",
|
||||
),
|
||||
EscapedChar(
|
||||
Newline,
|
||||
),
|
||||
EscapedChar(
|
||||
Newline,
|
||||
),
|
||||
Plaintext(
|
||||
"World!",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@23-24 Identifier(
|
||||
"b",
|
||||
),
|
||||
@27-49 Str(
|
||||
Block(
|
||||
[
|
||||
[
|
||||
Plaintext(
|
||||
"Hello,",
|
||||
),
|
||||
EscapedChar(
|
||||
Newline,
|
||||
),
|
||||
EscapedChar(
|
||||
Newline,
|
||||
),
|
||||
Plaintext(
|
||||
"World!",
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Body(
|
||||
@50-51 Identifier(
|
||||
"c",
|
||||
),
|
||||
@58-92 SpaceBefore(
|
||||
Str(
|
||||
Block(
|
||||
[
|
||||
[
|
||||
Plaintext(
|
||||
"Hello,\n",
|
||||
),
|
||||
Plaintext(
|
||||
"\n",
|
||||
),
|
||||
Plaintext(
|
||||
"World!",
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@93-95 SpaceBefore(
|
||||
Num(
|
||||
"42",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
a = "Hello,\n\nWorld!"
|
||||
b = """Hello,\n\nWorld!"""
|
||||
c =
|
||||
"""
|
||||
Hello,
|
||||
|
||||
World!
|
||||
"""
|
||||
42
|
Loading…
Add table
Add a link
Reference in a new issue