An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Snowfall Sleet


Nix Flakes Ready


Built With Snowfall

  

> 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.