Reimplement label parser using grammar! macro

This commit is contained in:
2025-06-07 12:41:19 -07:00
parent c3917a62b7
commit c5df4e1ce0
2 changed files with 140 additions and 2 deletions
+2 -2
View File
@@ -367,7 +367,7 @@ pub fn grammar(ts: TokenStream) -> TokenStream {
.collect();
let enum_tag = quote! {
#[derive(Copy, Clone, Debug)]
enum Tag {
pub enum Tag {
#(#tag_idents),*
}
};
@@ -379,7 +379,7 @@ pub fn grammar(ts: TokenStream) -> TokenStream {
let fn_name = &r.name;
let generated = r.definition.generate_code();
quote! {
fn #fn_name(p: &mut crate::peg::ParseState<Tag>) -> bool {
pub fn #fn_name(p: &mut crate::peg::ParseState<Tag>) -> bool {
use crate::peg::backend::LowLevel;
#generated
}