DoubleQuoted (Standard String)
Definition
DoubleQuoted [Antiquoted Text]
Fields
| Field | Type | Description |
|---|---|---|
contents | [Antiquoted Text] | List of string parts |
Nix Source ↔ AST
Simple String
# Nix
"hello"
# String node
{
"tag": "DoubleQuoted",
"contents": [
{ "tag": "Plain", "contents": "hello" }
]
}
With Antiquotation
# Nix
"hello ${name}"
# String node
{
"tag": "DoubleQuoted",
"contents": [
{ "tag": "Plain", "contents": "hello " },
{ "tag": "Antiquoted", "contents": { "tag": "Sym", "contents": "name" } }
]
}
Expression Wrapper
The expression-level node is Str wrapping this:
{
"tag": "Str",
"contents": { "tag": "DoubleQuoted", "contents": [...] }
}
Related
- Indented: multi-line indented strings
- Antiquoted:
Plain,Antiquoted,EscapedNewlineparts - Str: expression wrapper
Nix Library Access
syntax.mkStr (syntax.mkDoubleQuoted [syntax.mkPlain "hello"])
syntax.mkStr (syntax.mkDoubleQuoted [syntax.mkPlain "hello ", syntax.mkAntiquoted (syntax.mkSym "name")])