Indented { indent :: Int, parts :: [Antiquoted Text] }
| Field | Type | Description |
indent | Int | Indentation level (spaces stripped from each line) |
parts | [Antiquoted Text] | List of string parts |
# Nix
''
hello
world
''
# String node
{
"tag": "Indented",
"indent": 2,
"parts": [
{ "tag": "Plain", "contents": "hello\nworld" }
]
}
# Nix
''
hello
${name}
''
# String node
{
"tag": "Indented",
"indent": 2,
"parts": [
{ "tag": "Plain", "contents": "hello\n" },
{ "tag": "Antiquoted", "contents": { "tag": "Sym", "contents": "name" } }
]
}
# Nix
''
first line \
second line
''
# String node
{
"tag": "Indented",
"indent": 2,
"parts": [
{ "tag": "Plain", "contents": "first line " },
{ "tag": "EscapedNewline" },
{ "tag": "Plain", "contents": "second line" }
]
}
{
"tag": "Str",
"contents": { "tag": "Indented", "indent": 2, "parts": [...] }
}
syntax.mkStr (syntax.mkIndented 2 [syntax.mkPlain "hello\nworld"])