@@ -22,6 +22,8 @@ match {
r"[a-z][A-Za-z0-9_-]*",
r"[A-Z][A-Za-z0-9_-]*",
r"[0-9]+",
+ r"\s*" => {},
+ r"\(\*([^*]|\*[^)])*\*\)" => {},
}
use crate::ast::*;
@@ -1,2 +1,3 @@
+(* testing simple assignment statements *)
x := 5;
y := This;
@@ -1 +1,2 @@
+(* testing atom literals *)
puts Foo
@@ -1,2 +1,6 @@
-puts This That;
-puts This | That;
+(* catenation *)
+puts This That The-Other;
+(* choice *)
+puts This | That | The-Other;
+(* weighted choice *)
+puts 5: This | That;
@@ -16,6 +16,11 @@
"That",
),
+ Lit(
+ Atom(
+ "The-Other",
+ ),
],
},
@@ -49,6 +54,50 @@
+ Choice {
+ weight: None,
+ value: Cat(
+ [
+ ],
+ },
+ Puts(
+ Chc(
+ weight: Some(
+ 5,
+ "This",
+ "That",