Skip to main content

Module token

Module token 

Source

Structs§

Token
A lexical token with its type, literal value, and source position.

Enums§

TokenType
Token types for the Cypher lexer.

Constants§

CLAUSE_KEYWORDS
The clause keywords: keyword tokens that start or continue a clause (MATCH, ORDER BY, AS, DISTINCT, …). is_ident_like() rejects them as variables, aliases and map keys, so (WHERE ...) does not read WHERE as the element variable. ADR-0169: they are still label and relationship-type names (is_schema_name()).
CLAUSE_STARTER_TOKENS
The reserved-keyword clause-starter tokens: the keyword tokens that start a new clause at clause position (MATCH, CREATE, UNWIND, FOR (CIP-250), …). The grammar authority is the clause dispatch (Parser::parse_clause_inner); this table is the derived vocabulary every lookahead over the same fact consults instead of re-spelling a second hand-maintained list – through [is_clause_boundary], by Parser::group_by_ends_clause (whose round-5 comment records the LOAD/DROP drift that motivated it) and the simple-CASE lookahead – and the dispatch-coverage pin test. A new clause-start dispatch arm extends this one table. OPTIONAL is a member: it starts a clause only immediately before MATCH/CALL (the arm that checks what follows). The contextual (identifier-spelled) starters are the separate CONTEXTUAL_CLAUSE_WORDS below.
CONTEXTUAL_CLAUSE_WORDS
The contextual (non-reserved, identifier-spelled) clause keywords: words that start or continue a clause when they appear as a plain Identifier at clause position, recognized by spelling – the same role as CLAUSE_KEYWORDS, but these stay usable as ordinary variable/label names everywhere else (MATCH (show) RETURN show). Single-sourced here so the clause dispatcher (Parser::parse_clause_inner) and the SHOW SETTINGS-style filter-expression starter (Parser::peek_starts_show_filter_expr, which excludes exactly this set so a following composed clause is not swallowed as a filter expression) can never drift apart.

Functions§

identifier_needs_quotes
True when name must be backtick-quoted to round-trip as a Cypher name.
is_contextual_clause_keyword
True if literal (any case) spells one of the CONTEXTUAL_CLAUSE_WORDS.
lookup_keyword
Look up a keyword from an identifier string (case-insensitive uppercase).
quote_identifier
Renders name as a Cypher identifier for generated Cypher text: bare when identifier_needs_quotes is false, otherwise through relate_model::identifier::quote_identifier_always (the one spelling of the quoting escape).