quiltlang 0.6.0

Quilt, a polyglot metaprogramming language: source code with arrow-bracket syntax for embedding and manipulating code fragments of other languages at code-generation time.
Documentation
//! Builder-call fragments, per target language.
//!
//! @generated by `bin/gen-chain` from
//! `quilt/src/langs/chain/mk_chain.rs.quilt` — do not edit by hand.
//! `bin/check-chain` regenerates it and fails if it differs.
//!
//! Each field is the source text around the arguments of one builder
//! call, read off a sample quoted in that language and parsed with its
//! own grammar: `py↖ACC.w(LIT)↗` coparses to `ACC.w(LIT)`,
//! which splits into `".w("` and `")"`. See issue #204.
//!
//! What the samples settle, and what they do not:
//!
//! * **The borrows are settled.** `.c(&x)` and `&[..]` are Rust and are
//!   not Python or TypeScript — those samples do not parse, so the
//!   generator fails rather than emitting them. This was two of the
//!   three differences a maintainer had to hold in mind across three
//!   near-identical files.
//! * **`NL` against `NL()` is not.** Both parse as TypeScript, because
//!   it is a fact about the `quilt-wasm` runtime — wasm-bindgen cannot
//!   export a module-scope constant, and a shared singleton would be
//!   consumed by its first use — rather than about the syntax. It is
//!   still a claim; it is now a claim made in one place (#167).
//! * **Escaping is not.** Which characters a literal must escape is
//!   runtime logic, so each meta still supplies its own escaper.
//!
//! `RUST.e` has no caller: Rust splices into a variadic container with
//! an imperative `b_` block, not a fluent `.e()` chain. It is a real
//! builder method and the table is uniform, so it is generated anyway.

use super::Shapes;

/// Read off samples parsed with this language's own grammar. See
/// `mk_chain.rs.quilt` for the sample behind each field.
pub const RUST: Shapes = Shapes {
    tb: ["tb(", ")"],
    w: [".w(", ")"],
    n: ".n()",
    p: [".p(", ")"],
    x: ".x()",
    c: [".c(&", ")"],
    e: [".e(&", ")"],
    t: None,
    b: ".b()",
    sym: ["sym(", ")"],
    leaf: ["leaf(", ", ", ")"],
    quote: ["quote(", ", ", ", ", ", ", ", ", ")"],
    unquote: ["unquote(", ", ", ", ", ", ", ", ", ")"],
    list: ["&[", ", ", "]"],
    cmd: ["cmd(", ")"],
    write: ["write(", ")"],
    push: ["push(", ")"],
    nl: "NL",
    pop: "POP",
    hole: "HOLE",
};
/// Read off samples parsed with this language's own grammar. See
/// `mk_chain.rs.quilt` for the sample behind each field.
pub const PYTHON: Shapes = Shapes {
    tb: ["tb(", ")"],
    w: [".w(", ")"],
    n: ".n()",
    p: [".p(", ")"],
    x: ".x()",
    c: [".c(", ")"],
    e: [".e(", ")"],
    t: None,
    b: ".b()",
    sym: ["sym(", ")"],
    leaf: ["leaf(", ", ", ")"],
    quote: ["quote(", ", ", ", ", ", ", ", ", ")"],
    unquote: ["unquote(", ", ", ", ", ", ", ", ", ")"],
    list: ["[", ", ", "]"],
    cmd: ["cmd(", ")"],
    write: ["write(", ")"],
    push: ["push(", ")"],
    nl: "NL",
    pop: "POP",
    hole: "HOLE",
};
/// Read off samples parsed with this language's own grammar. See
/// `mk_chain.rs.quilt` for the sample behind each field.
pub const TYPESCRIPT: Shapes = Shapes {
    tb: ["tb(", ")"],
    w: [".w(", ")"],
    n: ".n()",
    p: [".p(", ")"],
    x: ".x()",
    c: [".c(", ")"],
    e: [".e(", ")"],
    t: Some([".t(", ")"]),
    b: ".b()",
    sym: ["sym(", ")"],
    leaf: ["leaf(", ", ", ")"],
    quote: ["quote(", ", ", ", ", ", ", ", ", ")"],
    unquote: ["unquote(", ", ", ", ", ", ", ", ", ")"],
    list: ["[", ", ", "]"],
    cmd: ["cmd(", ")"],
    write: ["write(", ")"],
    push: ["push(", ")"],
    nl: "NL()",
    pop: "POP()",
    hole: "HOLE()",
};