Skip to content

Commit a687505

Browse files
committed
Remove mod _cache_information_ as it's now just a string.
1 parent 8e32c81 commit a687505

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

lrpar/src/lib/ctbuilder.rs

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -864,30 +864,19 @@ where
864864
))
865865
})
866866
.collect::<Vec<_>>();
867-
let rule_map_len = rule_map.len();
868-
let cache_info = quote! {
869-
#[allow(unused)]
870-
mod _cache_information_ {
871-
use ::lrpar::{RecoveryKind, Visibility, RustEdition};
872-
use ::cfgrammar::yacc::YaccKind;
873-
874-
const BUILD_TIME: &str = #build_time;
875-
// May differ from `MOD_NAME` by being derived from the grammar path.
876-
const DERIVED_MOD_NAME: &str = #derived_mod_name;
877-
const GRAMMAR_PATH: &str = #grammar_path;
878-
// As explicitly set by the builder.
879-
const MOD_NAME: Option<&str> = #mod_name;
880-
const RECOVERER: RecoveryKind = #recoverer;
881-
const YACC_KIND: YaccKind = #yacckind;
882-
const ERROR_ON_CONFLICTS: bool = #error_on_conflicts;
883-
const SHOW_WARNINGS: bool = #show_warnings;
884-
const WARNINGS_ARE_ERRORS: bool = #warnings_are_errors;
885-
const RUST_EDITION: RustEdition = #rust_edition;
886-
const RULE_IDS_MAP: [(usize, &str); #rule_map_len] = [#(#rule_map,)*];
887-
fn visibility() -> Visibility {
888-
#visibility
889-
}
890-
}
867+
let cache_info = quote!{
868+
BUILD_TIME = #build_time
869+
DERIVED_MOD_NAME = #derived_mod_name
870+
GRAMMAR_PATH = #grammar_path
871+
MOD_NAME = #mod_name
872+
RECOVERER = #recoverer
873+
YACC_KIND = #yacckind
874+
ERROR_ON_CONFLICTS = #error_on_conflicts
875+
SHOW_WARNINGS = #show_warnings
876+
WARNINGS_ARE_ERRORS = #warnings_are_errors
877+
RUST_EDITION = #rust_edition
878+
RULE_IDS_MAP = [#(#rule_map,)*]
879+
VISIBILITY = #visibility
891880
};
892881
let cache_info_str = cache_info.to_string();
893882
quote!(#cache_info_str)

0 commit comments

Comments
 (0)