edge case identifiers, simple function parsing
This commit is contained in:
parent
26c37e9dd3
commit
82104cfe0d
|
|
@ -138,8 +138,28 @@ fn main() {
|
|||
Lexeme(30, "number12345"),
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ mixedCASEIdent
|
|||
number12345
|
||||
____
|
||||
_
|
||||
-leading-minus
|
||||
trailing-minus-
|
||||
|
|
|
|||
Loading…
Reference in a new issue