I created a parser test that I used to debug the error:
#[test]
fn test_parse_inline_function() {
let raw = "
fn main() = 1
";
let tokens = tokenize(raw).unwrap();
let tree = parse(tokens, Some(raw.to_string()), "".into());
assert!(tree.is_ok())
}
It seems like the error is an issue with how the parse_expression function peeks tokens. I added a test stub to investigate this later.
I get an
Error: Expected token
when running this function:I created a parser test that I used to debug the error:
It seems like the error is an issue with how the
parse_expression
function peeks tokens. I added a test stub to investigate this later.Originally posted by @garritfra in https://github.com/antimony-lang/antimony/issues/95#issuecomment-2039664468