mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
feat: early abort on error
This commit is contained in:
parent
4e873a1fe4
commit
a35638f586
3 changed files with 4 additions and 1 deletions
|
@ -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 =
|
||||
|
|
1
tests/cases/error/in
Normal file
1
tests/cases/error/in
Normal file
|
@ -0,0 +1 @@
|
|||
;-)
|
1
tests/cases/error/out
Normal file
1
tests/cases/error/out
Normal file
|
@ -0,0 +1 @@
|
|||
;-)
|
Loading…
Add table
Add a link
Reference in a new issue