Adds a todo
This commit is contained in:
parent
2b13830ffd
commit
92c6f5ece0
|
|
@ -0,0 +1,79 @@
|
|||
# Current Tools
|
||||
## TableGen
|
||||
|
||||
# Todo
|
||||
* Auto path (by default)
|
||||
* Document
|
||||
|
||||
## Tablegen
|
||||
* Dissociate path from feature
|
||||
* Force replace/ask
|
||||
* Have interactive mode ?
|
||||
* Dissociate Model from generation
|
||||
|
||||
## Test Units
|
||||
|
||||
|
||||
|
||||
# Futures tools
|
||||
* Lexer/Checker
|
||||
|
||||
## Lexer
|
||||
` Command: grammar --check `
|
||||
|
||||
Tries to do a quick grammar check and locate errors
|
||||
|
||||
* https://brunocalza.me/writing-a-simple-lexer-in-rust/
|
||||
* https://github.com/goffrie/plex
|
||||
|
||||
### Logos, fast lexer
|
||||
|
||||
* https://crates.io/crates/logos
|
||||
```rust
|
||||
use logos::Logos;
|
||||
|
||||
#[derive(Logos, Debug, PartialEq)]
|
||||
#[logos(skip r"[ \t\n\f]+")] // Ignore this regex pattern between tokens
|
||||
enum Token {
|
||||
// Tokens can be literal strings, of any length.
|
||||
#[token("fast")]
|
||||
Fast,
|
||||
|
||||
#[token(".")]
|
||||
Period,
|
||||
|
||||
// Or regular expressions.
|
||||
#[regex("[a-zA-Z]+")]
|
||||
Text,
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Chumsky, full parser
|
||||
|
||||
```rust
|
||||
use chumsky::prelude::*;
|
||||
|
||||
#[derive(Clone)]
|
||||
enum Instr {
|
||||
Left, Right,
|
||||
Incr, Decr,
|
||||
Read, Write,
|
||||
Loop(Vec<Self>),
|
||||
}
|
||||
|
||||
fn parser() -> impl Parser<char, Vec<Instr>, Error = Simple<char>> {
|
||||
recursive(|bf| choice((
|
||||
just('<').to(Instr::Left),
|
||||
just('>').to(Instr::Right),
|
||||
just('+').to(Instr::Incr),
|
||||
just('-').to(Instr::Decr),
|
||||
just(',').to(Instr::Read),
|
||||
just('.').to(Instr::Write),
|
||||
bf.delimited_by(just('['), just(']')).map(Instr::Loop),
|
||||
))
|
||||
.repeated())
|
||||
}
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue