mindustry logic execution, map- and schematic- parsing and rendering
-rw-r--r--lemu/src/lexer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lemu/src/lexer.rs b/lemu/src/lexer.rs
index bee3d67..cc37ab6 100644
--- a/lemu/src/lexer.rs
+++ b/lemu/src/lexer.rs
@@ -10,7 +10,7 @@ macro_rules! instrs {
Newline,
#[regex("#[^\n]+", priority = 8)]
Comment(&'strings str),
- #[regex(r"[0-9]+(\.[0-9]+)?", |lex| lex.slice().parse().ok())]
+ #[regex(r"-?[0-9]+(\.[0-9]+)?", |lex| lex.slice().parse().ok())]
#[regex(r"(true)|(false)", |lex| lex.slice().parse::<bool>().ok().map(f64::from), priority = 10)]
#[regex(r#"0[xX][0-9a-fA-F]+"#, |lex| u64::from_str_radix(&lex.slice()[2..], 16).map(|v| v as f64).ok())]
#[regex(r#"0[bB][01]+"#, |lex| u64::from_str_radix(&lex.slice()[2..], 2).map(|v| v as f64).ok())]
@@ -20,7 +20,7 @@ macro_rules! instrs {
#[regex(r#"@[^ "\n]*"#, |lex| Cow::from(lex.slice()))]
#[regex(r#""[^"]*""#, callback = |lex| Cow::from(lex.slice()[1..lex.slice().len()-1].replace(r"\n", "\n")), priority = 8)]
String(Cow<'strings, str>),
- #[regex("[^@0-9 \t\n][^ \t\n]*", priority = 7)]
+ #[regex("[^@0-9- \t\n][^ \t\n]*", priority = 7)]
Ident(&'strings str),
$(#[token($z, priority = 8)] $v,)+