edge case identifiers, simple function parsing

This commit is contained in:
janis 2025-10-28 16:52:17 +01:00
parent 26c37e9dd3
commit 82104cfe0d
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8
2 changed files with 22 additions and 0 deletions

View file

@ -138,8 +138,28 @@ fn main() {
Lexeme(30, "number12345"), Lexeme(30, "number12345"),
Lexeme(30, "____"), Lexeme(30, "____"),
Lexeme(30, "_"), Lexeme(30, "_"),
Lexeme(17, ""), Lexeme(30, "leading-minus"),
Lexeme(30, "trailing-minus-"),
]); ]);
eprint!("Initializing tokeniser.. ");
tokeniser_init(c"tests/tokens/function.l".as_ptr());
eprintln!("ok.");
assert_eq!(&collect_tokens()[..], &[
Lexeme(4, ""),
Lexeme(30, "my-function"),
Lexeme(19, ""),
Lexeme(18, ""),
Lexeme(12, ""),
Lexeme(11, ""),
Lexeme(21, ""),
Lexeme(5, ""),
Lexeme(10, ""),
Lexeme(23, ""),
Lexeme(20, ""),
]);
eprintln!("Finished tokenising."); eprintln!("Finished tokenising.");
} }
} }

View file

@ -5,3 +5,5 @@ mixedCASEIdent
number12345 number12345
____ ____
_ _
-leading-minus
trailing-minus-