upgrade snapshot, remove #[LALR] annotation from lrgrammar.lalrpop

This commit is contained in:
Niko Matsakis 2017-06-15 11:06:08 -04:00
parent 714a251657
commit d4a23b83c5
4 changed files with 12 additions and 4 deletions

View File

@ -90,6 +90,7 @@ fn add_range(range: Test,
}
}
#[cfg(test)]
macro_rules! test {
($($range:expr,)*) => {
{

View File

@ -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
}
}

View File

@ -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",

View File

@ -5,7 +5,6 @@ use std::iter::once;
use tok::{self, Tok};
use util::strip;
#[LALR]
grammar<'input>(text: &'input str);
pub Grammar: Grammar =