Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DoubleQuoted (Standard String)

Definition

DoubleQuoted [Antiquoted Text]

Fields

FieldTypeDescription
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": [...] }
}
  • Indented: multi-line indented strings
  • Antiquoted: Plain, Antiquoted, EscapedNewline parts
  • 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")])