Skip to content

Commit

Permalink
fix regex patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
TommYDeeee committed Apr 23, 2024
1 parent 53164c7 commit 3f726c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ pub(crate) enum LogosToken {
#[regex(r"/(([^\\/\n])|(\\.))+/[a-zA-Z0-9]*", |lex| lex.slice().to_string())]
Regexp(String),
// Hexadecimal string
#[regex(r"=\s\{(([\s0-9A-Fa-f?~()|\[\] -]|//.*)*)\}", |lex| lex.slice().to_string())]
#[regex(r"=[ \n]{0,10}\{(([\s0-9A-Fa-f?~()|\[\] -]|//.*)*)\}", |lex| lex.slice().to_string())]
HexString(String),
// Strings
#[regex(r#""(([^"\\]|\\x[0-9a-fA-F]{2}|\\[trn"\\]|\\.)*)""#, |lex| lex.slice().to_string())]
String(String),
// Identifiers
#[regex(r"[a-zA-Z][a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
#[regex(r"[a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
Identifier(String),
// Variables
#[regex(r"\$[a-zA-Z0-9_]*", |lex| lex.slice().to_string())]
Expand Down Expand Up @@ -236,7 +236,7 @@ pub(crate) enum HexLogosToken {
Whitespace,
#[regex(r"~?[0-9a-fA-F?]{2}")]
Lit,
#[regex(r"\[\-?[0-9]*\-?[0-9]*\]")]
#[regex(r"\[\-?[0-9]* ?\-? ?[0-9]*\]")]
Range,
#[regex(r"//.*")]
Comment,
Expand Down

0 comments on commit 3f726c9

Please sign in to comment.