@snowfallorg/sleet
v0.12.4
Published
A parser for Nix.
Downloads
492
Readme
Snowfall Sleet
A Nix parser written in TypeScript.
Usage
Lexer
To use the lexer, import the Lexer
class and create a new instance.
import { Lexer } from "@snowfallorg/sleet";
const lexer = new Lexer();
const tokens = lexer.lex("let x = 4; in x");
Parser
To use the parser, import the Parser
class and create a new instance.
import { Parser } from "@snowfallorg/sleet";
const parser = new Parser();
const ast = parser.parse("let x = 4; in x");
Implementation
This parser is not resilient. On any malformed input, Sleet will throw an error. This may change in the future, but for now you should know that resilient parsing is not a part of this library.