diff --git a/reid/src/lexer.rs b/reid/src/lexer.rs index 3a1d477..e786ae8 100644 --- a/reid/src/lexer.rs +++ b/reid/src/lexer.rs @@ -363,14 +363,17 @@ pub fn tokenize>(to_tokenize: T) -> Result, Error let mut value = NumberType::Decimal(character.to_string()); let mut numerics = DECIMAL_NUMERICS; if let Some(second) = cursor.second() { - if cursor.first() == Some('x') && HEXADECIMAL_NUMERICS.contains(&second) { + if cursor.first() == Some('x') + && HEXADECIMAL_NUMERICS + .contains(&second.to_lowercase().next().unwrap_or('.')) + { cursor.next(); value = NumberType::Hexadecimal(String::new()); numerics = HEXADECIMAL_NUMERICS; } } while let Some(c) = cursor.first() { - if !numerics.contains(&c) { + if !numerics.contains(&c.to_lowercase().next().unwrap_or('.')) { break; } value += c; diff --git a/reid/tests/e2e.rs b/reid/tests/e2e.rs index 61e9815..5b16a47 100644 --- a/reid/tests/e2e.rs +++ b/reid/tests/e2e.rs @@ -132,3 +132,7 @@ fn ptr_hard_compiles_well() { fn loop_hard_compiles_well() { test(include_str!("../../examples/loop_hard.reid"), "test", 0); } +#[test] +fn custom_binop_compiles_well() { + test(include_str!("../../examples/custom_binop.reid"), "test", 21); +}