You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: README2.md
+37-10Lines changed: 37 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,28 @@
7
7
8
8
Chumsky is a parser combinator library for Rust that makes writing expressive, high-performance parsers easy.
9
9
10
-
Although chumsky is designed primarily for user-fancing parsers such as compilers, chumsky is just as much at home
11
-
parsing binary protocols in a networking layer, configuration files, or any other form of complex input validation that
12
-
you may need.
13
-
14
10
<ahref = "https://www.github.com/zesterer/tao">
15
11
<img src="https://raw.githubusercontent.com/zesterer/chumsky/master/misc/example.png" alt="Example usage with my own language, Tao"/>
16
12
</a>
17
13
14
+
Although chumsky is designed primarily for user-fancing parsers such as compilers, chumsky is just as much at home
15
+
parsing binary protocols at the networking layer, configuration files, or any other form of complex input validation that
16
+
you may need. It also has `no_std` support, making it suitable for embedded environments.
17
+
18
18
## Features
19
19
20
20
- 🪄 **Expressive combinators** that make writing your parser a joy
21
21
- 🎛️ **Fully generic** across input, token, output, span, and error types
22
-
- 📑 **Zero-copy parsing** minimises your parser's need to allocate
22
+
- 📑 **Zero-copy parsing** minimises allocation by having outputs hold references/slices of the input
23
23
- 🚦 **Flexible error recovery** strategies out of the box
24
24
- 🚀 **Internal optimiser** leverages the power of [GATs](https://smallcultfollowing.com/babysteps/blog/2022/06/27/many-modes-a-gats-pattern/) to optimise your parser for you
25
25
- 📖 **Text-oriented parsers** for text inputs (i.e: `&[u8]` and `&str`)
26
26
- 👁️🗨️ **Context-free grammars** are fully supported, with support for context-sensitivity
27
27
- 🔄 **Left recursion and memoization** have opt-in support
28
-
- 🪺 **Nested inputs** such as token trees are fully supported
28
+
- 🪺 **Nested inputs** such as token trees are fully supported both as inputs and outputs
29
29
- 🏷️ **Pattern labelling** for dynamic, user-friendly error messages
30
+
- 🗃️ **Caching** allows parsers to be created once and reused many times
31
+
- ↔️ **Pratt parsing** support for unary and binary operators
30
32
31
33
*Note: Error diagnostic rendering is performed by [Ariadne](https://github.com/zesterer/ariadne)*
32
34
@@ -39,19 +41,18 @@ See [`examples/brainfuck.rs`](https://github.com/zesterer/chumsky/blob/master/ex
39
41
```rust
40
42
usechumsky::prelude::*;
41
43
42
-
///Define out output AST (Abstract Syntax Tree)
44
+
///An AST (Abstract Syntax Tree) for Brainfuck instructions
43
45
#[derive(Clone)]
44
46
enumInstr {
45
47
Left, Right,
46
48
Incr, Decr,
47
49
Read, Write,
48
-
// In Brainfuck, `[...]` blocks are loops
49
-
Loop(Vec<Self>),
50
+
Loop(Vec<Self>), // In Brainfuck, `[...]` loops contain sub-blocks of instructions
50
51
}
51
52
52
53
/// A function that returns an instance of our Brainfuck parser
0 commit comments