https://github.com/snowfallorg/sleet
A Nix parser written in TypeScript
https://github.com/snowfallorg/sleet
Last synced: over 1 year ago
JSON representation
A Nix parser written in TypeScript
- Host: GitHub
- URL: https://github.com/snowfallorg/sleet
- Owner: snowfallorg
- License: other
- Created: 2023-07-04T01:33:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T04:36:14.000Z (over 2 years ago)
- Last Synced: 2025-03-05T02:36:00.083Z (over 1 year ago)
- Language: TypeScript
- Size: 1.27 MB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snowfall Sleet
> A Nix parser written in TypeScript.
## Usage
### Lexer
To use the lexer, import the `Lexer` class and create a new instance.
```ts
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.
```ts
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.