IF Commons GitHub

build

Builders for the nodes a rewrite makes (commons lang-sql 0003-sql-ast-tools FR-003): each takes the range of the node it stands for as its first argument, so that a rewritten tree's ranges are the text's ranges and not made up.

// replace each column `a` by `a + 1`
rewriteExpr(e, { expr: (n) => (n.kind === "name" ? build.binary(n, "+", n, build.number(n, "1")) : undefined) });

Spec: 0003-sql-ast-tools FR-003

Source: commons/lang-sql/src/build.ts

1 of 1 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

buildconst
const build: { ident(at: Span, name: string, quoted?: boolean): Ident; name(at: Span, ...parts: readonly string[]): Name… (518 characters)
const build: { ident(at: Span, name: string, quoted?: boolean): Ident; name(at: Span, ...parts: readonly string[]): Name; number(at: Span, text: string): NumberLit; string(at: Span, value: string, prefix?: string): StringLit; boolean(at: Span, value: boolean): BoolLit; null(at: Span): NullLit; star(at: Span, qualifier?: Name | undefined): Star; unary(at: Span, op: UnaryOp, arg: Expr): Unary; binary(at: Span, op: BinaryOp, left: Expr, right: Expr): Binary; call(at: Span, name: Name, args: readonly Expr[]): Call; }

Builds nodes with the range of the node they stand for.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.