Skip to content

rune-langium / core/src / ParseResult

Interface: ParseResult

Defined in: packages/core/src/api/parse.ts:28

Result of parsing a Rosetta DSL source string.

Remarks

Even when hasErrors is false, the returned value is always a valid (possibly partial) RosettaModel. Callers should check hasErrors before relying on cross-reference resolution — unresolved references in the AST will have ref === undefined.

Pitfalls

  • Do NOT mutate fields on the returned value — Langium's incremental reparser tracks AST identity; mutating nodes bypasses indexing and causes stale cross-references on the next build.
  • LangiumDocument objects obtained via lower-level APIs must not be cached across workspace changes — cross-references become stale after DocumentBuilder.update() invalidates the index.

Properties

PropertyTypeDescriptionDefined in
hasErrorsbooleanWhether the parse completed without errors.packages/core/src/api/parse.ts:46
lexerErrors{ column?: number; line?: number; message: string; offset: number; }[]Lexer errors encountered during parsing.packages/core/src/api/parse.ts:32
parserErrors{ column?: number; line?: number; message: string; offset?: number; }[]Parser errors encountered during parsing.packages/core/src/api/parse.ts:39
valueRosettaModelThe root AST node.packages/core/src/api/parse.ts:30

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.