mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Add test for removing indents in multiline strings
This commit is contained in:
parent
a1512dfd79
commit
61b1ab059a
3 changed files with 112 additions and 0 deletions
|
@ -0,0 +1,102 @@
|
||||||
|
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(
|
||||||
|
PlainLine(
|
||||||
|
"\n Hello,\n\n World!\n ",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
@93-95 SpaceBefore(
|
||||||
|
Num(
|
||||||
|
"42",
|
||||||
|
),
|
||||||
|
[
|
||||||
|
Newline,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
|
@ -0,0 +1,9 @@
|
||||||
|
a = "Hello,\n\nWorld!"
|
||||||
|
b = """Hello,\n\nWorld!"""
|
||||||
|
c =
|
||||||
|
"""
|
||||||
|
Hello,
|
||||||
|
|
||||||
|
World!
|
||||||
|
"""
|
||||||
|
42
|
|
@ -204,6 +204,7 @@ mod test_parse {
|
||||||
pass/not_docs.expr,
|
pass/not_docs.expr,
|
||||||
pass/number_literal_suffixes.expr,
|
pass/number_literal_suffixes.expr,
|
||||||
pass/one_backpassing.expr,
|
pass/one_backpassing.expr,
|
||||||
|
pass/multiline_string.expr,
|
||||||
pass/one_char_string.expr,
|
pass/one_char_string.expr,
|
||||||
pass/one_def.expr,
|
pass/one_def.expr,
|
||||||
pass/one_minus_two.expr,
|
pass/one_minus_two.expr,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue