Documentation
¶
Overview ¶
Package parser is the recursive-descent GQL parser (SPEC-04 §3 EBNF).
M6 (landed): the grammar-complete parser. Precedence `!` > `&&` > `||` (parseOr → parseAnd → parseNot → parsePrimary); sugar (`=` → `==`, AND/OR/NOT in any casing → the symbolic nodes); `field!="value"` as its own OpNeq comparison; IN lists capped at 256 elements; the quantified blocks ANY(f){ … } (accepted) and ALL(f){ … } (parses — the M7 validator rejects it in v0.0.1); the functional exists(field) form AND the bare-field presence test; positions from the source tokens on every node. Parse-time K-13 enforcement: node count ≤ 1024, depth ≤ 32 (constants at the top of parser.go — the normative spec values are not vendored in-repo; these bounds are the tuning point). Grammar failures abort with GQL_E_PARSE at the offending token plus a did-you-mean keyword hint when the text is within edit distance 1 of a keyword (errors.go); the error points at the misspelled FIELD when the field is the misspelling.
Consumes internal/gql/lexer, produces internal/gql/ast; never imports any collector or egress package (ADR-0010; AC-3.1).
Index ¶
Constants ¶
const CodeParse = "GQL_E_PARSE"
CodeParse is the stable GQL grammar-error code (SPEC-04 §3).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
Detail string // what failed, including "line L, column C"
Why string // likely why
Next string // concrete Try: hint (may carry did-you-mean)
Line int // 1-based line the error points at
Col int // 1-based (rune) column the error points at
}
Error is a GQL parse error with its source position.