Adds a todo

This commit is contained in:
Dandaedre 2024-04-28 19:26:59 +02:00
parent 2b13830ffd
commit 92c6f5ece0
1 changed files with 79 additions and 0 deletions

79
Todo.md Normal file
View File

@ -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())
}
```