Documentation
¶
Overview ¶
Package dsl provides syntax highlighting and syntax-error diagnostics for OpenFGA DSL text, built on the openfga/language ANTLR lexer and parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cell ¶
Cell is a single source rune paired with its syntax color (nil = default foreground). Cells preserves every rune of the input in order, including whitespace, newlines, and comments (which have a style.Faintc Color).
type Diagnostic ¶
Diagnostic is a single syntax error located in DSL source. Line and Col are zero-based (Line matches the library's stored line index; render as Line+1, Col+1 for humans).
func Diagnostics ¶
func Diagnostics(dsl string) []Diagnostic
Diagnostics parses dsl and returns one Diagnostic per syntax error, or nil when the DSL is syntactically valid. It performs no semantic validation.
func UndefinedTypeDiagnostics ¶
func UndefinedTypeDiagnostics(dsl string) []Diagnostic
UndefinedTypeDiagnostics returns a diagnostic for each reference to a type that is not declared in the DSL (e.g. `[user]` when there is no `type user`). It validates types only, not relations. It should be called only when the DSL has no syntax errors, so the token stream is reliable.