diff --git a/src/format.rs b/src/format.rs index 36e99a5..67142ac 100644 --- a/src/format.rs +++ b/src/format.rs @@ -7,7 +7,8 @@ pub fn string( let ast = rnix::parser::parse(tokens); for error in ast.errors() { - eprintln!("Warning: parsing error: {}, at: {}", error, path); + eprintln!("Error: {}, at: {}", error, path); + return ast.node().to_string(); } let green_node = diff --git a/tests/cases/error/in b/tests/cases/error/in new file mode 100644 index 0000000..471697a --- /dev/null +++ b/tests/cases/error/in @@ -0,0 +1 @@ +;-) diff --git a/tests/cases/error/out b/tests/cases/error/out new file mode 100644 index 0000000..471697a --- /dev/null +++ b/tests/cases/error/out @@ -0,0 +1 @@ +;-)