WIP: switch to fully decomposed tokens internally

This commit is contained in:
Aleksey Kladov 2019-09-09 14:52:31 +03:00
parent e2ebb467bd
commit 40170885e7
12 changed files with 422 additions and 279 deletions

View file

@ -15,6 +15,18 @@ fn lexer_tests() {
})
}
#[test]
fn parse_smoke_test() {
let code = r##"
fn main() {
println!("Hello, world!")
}
"##;
let parse = SourceFile::parse(code);
assert!(parse.ok().is_ok());
}
#[test]
fn parser_tests() {
dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| {
@ -75,7 +87,9 @@ fn self_hosting_parsing() {
{
count += 1;
let text = read_text(entry.path());
SourceFile::parse(&text).ok().expect("There should be no errors in the file");
if let Err(errors) = SourceFile::parse(&text).ok() {
panic!("Parsing errors:\n{:?}\n{}\n", errors, entry.path().display());
}
}
assert!(
count > 30,