Skip to main content

Module validator

Module validator 

Source
Expand description

Semantic validation for query ASTs

This module provides validation for parsed query ASTs, checking:

  • Field names against the field registry
  • Operator compatibility with field types
  • Value type matching
  • Regex pattern validity
  • Contradiction detection

The validator provides helpful error messages with suggestions for typos and clear explanations of validation failures.

§Regex Support (FT-C.1)

The validator supports both standard regex patterns (via the regex crate) and advanced patterns with lookaround assertions (via the fancy-regex crate).

Lookaround support includes:

  • Positive lookahead: (?=...)
  • Negative lookahead: (?!...)
  • Positive lookbehind: (?<=...)
  • Negative lookbehind: (?<!...)

The validator automatically detects lookaround patterns and uses the appropriate regex engine.

Structs§

ContradictionWarning
Warning about a potential contradiction in the query
ValidationOptions
Semantic validator for query ASTs
Validator
Validator for query expressions and field/value semantics.