Fix uppercase/lowercase, add custom_binop to e2e tests

This commit is contained in:
Sofia 2025-07-24 21:26:32 +03:00
parent a09bccb255
commit 25fb6bf0fd
2 changed files with 9 additions and 2 deletions

View File

@ -363,14 +363,17 @@ pub fn tokenize<T: Into<String>>(to_tokenize: T) -> Result<Vec<FullToken>, 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;

View File

@ -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);
}