1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// use super::*;
// use from_pest::FromPest;
// use insta::*;
// use pest::Parser;
// impl ENotation {
// // fn plist(input: &str) -> PList {
// // let mut output = ENotationParser::parse(Rule::paren_list, input).unwrap();
// // println!("{:?}", output);
// // PList::from_pest(&mut output).unwrap()
// // }
// // fn blist(input: &str) -> BList {
// // let mut output = ENotationParser::parse(Rule::bracket_list, input).unwrap();
// // println!("{:?}", output);
// // BList::from_pest(&mut output).unwrap()
// // }
// // fn list(input: &str) -> List {
// // let mut output = ENotationParser::parse(Rule::list, input).unwrap();
// // println!("{:?}", output);
// // List::from_pest(&mut output).unwrap()
// // }
// // fn set(input: &str) -> Set {
// // let mut output = ENotationParser::parse(Rule::set, input).unwrap();
// // Set::from_pest(&mut output).unwrap()
// // }
// // fn object(input: &str) -> Object {
// // let mut output = ENotationParser::parse(Rule::object, input).unwrap();
// // Object::from_pest(&mut output).unwrap()
// // }
// // fn quote(input: &str) -> Quote {
// // let mut output = ENotationParser::parse(Rule::quote, input).unwrap();
// // Quote::from_pest(&mut output).unwrap()
// // }
// // fn quasiquote(input: &str) -> QuasiQuote {
// // let mut output = ENotationParser::parse(Rule::quasiquote, input).unwrap();
// // QuasiQuote::from_pest(&mut output).unwrap()
// // }
// // fn syntax(input: &str) -> Syntax {
// // let mut output = ENotationParser::parse(Rule::syntax, input).unwrap();
// // Syntax::from_pest(&mut output).unwrap()
// // }
// }
// // #[test]
// // fn parse_plist() {
// // assert_snapshot!(ENotation::plist("(1 2 3)"), @"(1 2 3)");
// // // test nested case
// // // assert_snapshot!(ENotation::blist("(1 (2 3))"), @"(1 (2 3))");
// // }
// // #[test]
// // fn parse_list() {
// // assert_snapshot!(ENotation::list("(1 2 3)"), @"(1 2 3)");
// // // test nested case
// // assert_snapshot!(ENotation::list("(1 (2 3))"), @"(1 (2 3))");
// // }
// // #[test]
// // fn parse_quoting() {
// // // quote
// // assert_snapshot!(ENotation::quote("'(1 2 3)"), @"'(1 2 3)");
// // // quasiquote
// // assert_snapshot!(ENotation::quasiquote("`(1 2 3)"), @"`(1 2 3)");
// // // syntax
// // assert_snapshot!(ENotation::syntax("#'(1 2 3)"), @"#'(1 2 3)");
// // }
// // #[test]
// // fn parse_set() {
// // // set
// // assert_snapshot!(ENotation::set("#{1 2 3}"), @"#{1 2 3}");
// // // empty set
// // assert_snapshot!(ENotation::set("#{}"), @"#{}");
// // }
// // #[test]
// // fn parse_object() {
// // assert_snapshot!(ENotation::object("{a: 2, b: 3}"), @"{a: 2, b: 3}");
// // // unnamed object
// // assert_snapshot!(ENotation::object("{1, 2, 3}"), @"{1, 2, 3}");
// // // empty object
// // assert_snapshot!(ENotation::object("{}"), @"{}");
// // }
// #[test]
// fn parse_comment() {
// let output = ENotationParser::parse(Rule::COMMENT, "; this is a comment")
// .unwrap()
// .peek();
// assert_debug_snapshot!(output, @"None");
// let output = ENotationParser::parse(Rule::COMMENT, "#;1").unwrap().peek();
// assert_debug_snapshot!(output, @"None");
// // let output = ENotationParser::parse(Rule::COMMENT, "#;(1 2 3)")
// // .unwrap()
// // .peek();
// // assert_debug_snapshot!(output, @"None");
// }