Skip to content

Parser and AST (@signalql/parser)

The @signalql/parser package exposes:

  • parse(query: string)Query
  • tokenize(query: string) for tokenizer debugging
  • ParseError for structured failures

Implementation lives in @signalql/compiler; the standalone parser package gives downstream tools a stable import surface without pulling codegen unless needed.

Stability expectations

  • AST node kinds span every spec version — v0.1 (count, funnel), v0.2 (retrieve, sequence), v0.3 (retrieve_v03, funnel_v03, describe, watch), and v0.4 (graph, reachability, path, trace, context) — and align with schemas/signalql-ast-v0.4.schema.json (current).
  • Breaking AST changes require a spec minor/major bump and schema revision.

Tests

See packages/parser/test/parser.test.ts and packages/compiler/test/compile.test.ts.