begin writing parser
This commit is contained in:
parent
3d6157e03a
commit
49408a310b
4 changed files with 46 additions and 15 deletions
41
argus-parser/src/lexer.rs
Normal file
41
argus-parser/src/lexer.rs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
use std::collections::HashMap;
|
||||
use std::{env, fmt, fs};
|
||||
|
||||
use ariadne::{sources, Color, Label, Report, ReportKind};
|
||||
use chumsky::prelude::*;
|
||||
|
||||
pub type Span = SimpleSpan<usize>;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Token<'src> {
|
||||
Semicolon,
|
||||
LBracket,
|
||||
RBracket,
|
||||
LParen,
|
||||
RParen,
|
||||
Comma,
|
||||
Bool(bool),
|
||||
Num(&'src str),
|
||||
Ident(&'src str),
|
||||
Minus,
|
||||
Plus,
|
||||
Times,
|
||||
Divide,
|
||||
Lt,
|
||||
Le,
|
||||
Gt,
|
||||
Ge,
|
||||
Eq,
|
||||
Neq,
|
||||
Assign,
|
||||
Not,
|
||||
And,
|
||||
Or,
|
||||
Implies,
|
||||
Xor,
|
||||
Equiv,
|
||||
Next,
|
||||
Always,
|
||||
Eventually,
|
||||
Until,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue