diff options
author | Greg Brown <gmb60@cam.ac.uk> | 2021-01-09 14:31:02 +0000 |
---|---|---|
committer | Greg Brown <gmb60@cam.ac.uk> | 2021-01-09 14:31:02 +0000 |
commit | 0d01692c97ea8ca6fc4b229e5b9678cb252bceda (patch) | |
tree | 6c5ed07740b814f50dddbc6afaefc21c11dc3440 /src/lower | |
parent | 487ce4fe0fa081f58d790d7d6417bf7d2659197c (diff) |
Introduce chomp as a procedural macro.
Add a bunch of tests.
Fix chomp and chewed so autochomp compiles.
Diffstat (limited to 'src/lower')
-rw-r--r-- | src/lower/rust.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lower/rust.rs b/src/lower/rust.rs index 74deb73..7931306 100644 --- a/src/lower/rust.rs +++ b/src/lower/rust.rs @@ -75,7 +75,7 @@ impl Backend for RustBackend { impl Parse for #name { fn take<P: Parser + ?Sized>(input: &mut P) -> Result<Self, TakeError> { - input.take_str(#lit).map(|()| #name) + input.consume_str(#lit).map(|()| #name) } } }; @@ -206,8 +206,11 @@ impl Backend for RustBackend { TokenStream::new(), BTreeSet::new(), )); + self.context.push(id); let inner = inner.gen(self); + self.context.pop(); + let inner_ty = self.data[inner].0.clone(); let tokens = quote! { #[derive(Clone, Debug, Eq, Hash, PartialEq)] |