1.6 KiB
1.6 KiB
Current Tools
TableGen
Todo
- Auto path (by default)
- Document
Tablegen
- Dissociate path from feature
- Force replace/ask
- Have interactive mode ?
- Dissociate Model from generation
StatGen
- Get rid of cycle and have a struct that gives stats according to % and keeps tracks of %
- Test VecDeque
- Add testing
- Add the swap algo (swap a bad fit creature with another)
- Save/load states
Test Units
Futures tools
- Lexer/Checker
Lexer
Command: grammar --check
Tries to do a quick grammar check and locate errors
Logos, fast lexer
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
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())
}