/scarpet-parser

A parser for the Scarpet language (Carpet Mod)

Primary LanguageJavaScriptMIT LicenseMIT

Scarpet Parser

A fault tolerant parser for the Scarpet language (a scripting language for the Carpet Mod).

This parser produces an AST from valid or invalid Scarpet source code. It is intended to be used for implementing language servers/linters and other similar tooling.

Errors, warnings or other hints are pushed to a list of diagnostics -- a compatible subset of the Diagnostic type in LSP.

This parser tries its best to be consistent with Carpet Mod's behavior, but it tends to be a bit more pedantic and may occasionally produce diagnostic errors or warnings on code that executes just fine in Carpet Mod.

The reverse however (a script parsing without diagnostics producing a parse error in Carpet Mod) is generally an indication of a bug. Please report it on GitHub.