-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix special case of layout empty expr; tag 0.1.25
- Loading branch information
Showing
12 changed files
with
92 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "cirru_parser" | ||
version = "0.1.24" | ||
version = "0.1.25" | ||
authors = ["jiyinyiyong <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#[cfg(feature = "use-serde")] | ||
use std::{fs, io}; | ||
|
||
#[cfg(feature = "use-serde")] | ||
fn main() -> Result<(), io::Error> { | ||
use cirru_parser::{format, Cirru, CirruWriterOptions}; | ||
// use std::collections::hash_map::DefaultHasher; | ||
use cirru_parser::from_json_str; | ||
|
||
let files = vec!["list-match"]; | ||
|
||
for file in files { | ||
println!("testing file: {}", file); | ||
let json_str = fs::read_to_string(format!("./tests/writer_data/{}.json", file))?; | ||
let cirru_str = fs::read_to_string(format!("./tests/writer_cirru/{}.cirru", file))?; | ||
|
||
let writer_options = CirruWriterOptions { use_inline: false }; | ||
match from_json_str(&json_str) { | ||
Ok(tree) => { | ||
if let Cirru::List(xs) = tree { | ||
assert_eq!(cirru_str, format(&xs, writer_options).unwrap()); | ||
} else { | ||
panic!("unexpected leaf here") | ||
} | ||
} | ||
Err(e) => { | ||
println!("{:?}", e); | ||
panic!("failed to load edn data from json"); | ||
} | ||
} | ||
} | ||
Ok(()) | ||
} | ||
|
||
#[cfg(not(feature = "use-serde"))] | ||
fn main() { | ||
println!("this example requires feature `use-serde`"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
list-match (a b) | ||
() $ c d | ||
(e f) | ||
g h | ||
i j k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
[ | ||
"list-match", | ||
["a", "b"], | ||
[[], ["c", "d"]], | ||
[ | ||
["e", "f"], | ||
["g", "h"], | ||
["i", "j", "k"] | ||
] | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
list-match (a b) | ||
() $ c d | ||
(e f) | ||
g h | ||
i j k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
[ | ||
"list-match", | ||
["a", "b"], | ||
[[], ["c", "d"]], | ||
[ | ||
["e", "f"], | ||
["g", "h"], | ||
["i", "j", "k"] | ||
] | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters