mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
upgrade snapshot, remove #[LALR]
annotation from lrgrammar.lalrpop
This commit is contained in:
parent
714a251657
commit
d4a23b83c5
@ -90,6 +90,7 @@ fn add_range(range: Test,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
macro_rules! test {
|
||||
($($range:expr,)*) => {
|
||||
{
|
||||
|
@ -24,10 +24,10 @@ fn build_lr1_states_legacy<'grammar>(grammar: &'grammar Grammar, start: Nontermi
|
||||
|
||||
type ConstructionFunction<'grammar> = fn(&'grammar Grammar, NonterminalString) -> LR1Result<'grammar> ;
|
||||
|
||||
fn use_lane_table() -> bool {
|
||||
pub fn use_lane_table() -> bool {
|
||||
match env::var("LALRPOP_LANE_TABLE") {
|
||||
Ok(ref s) => s == "enabled",
|
||||
_ => false
|
||||
Ok(ref s) => s != "disabled",
|
||||
_ => true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,14 @@ pub fn build_lalr_states<'grammar>(grammar: &'grammar Grammar,
|
||||
// First build the LR(1) states
|
||||
let lr_states = try!(build::build_lr1_states(grammar, start));
|
||||
|
||||
// With lane table, there is no reason to do state collapse
|
||||
// for LALR. In fact, LALR is pointless!
|
||||
if build::use_lane_table() {
|
||||
println!("Warning: Now that the new lane-table algorithm is the default,");
|
||||
println!(" #[lalr] mode has no effect and can be removed.");
|
||||
return Ok(lr_states);
|
||||
}
|
||||
|
||||
profile! {
|
||||
&Tls::session(),
|
||||
"LALR(1) state collapse",
|
||||
|
@ -5,7 +5,6 @@ use std::iter::once;
|
||||
use tok::{self, Tok};
|
||||
use util::strip;
|
||||
|
||||
#[LALR]
|
||||
grammar<'input>(text: &'input str);
|
||||
|
||||
pub Grammar: Grammar =
|
||||
|
Loading…
x
Reference in New Issue
Block a user