Skip to content

Commit

Permalink
Distinguish between "alpha" and "beta" artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
acweathersby committed Feb 7, 2024
1 parent 21b7f8c commit bba3420
Show file tree
Hide file tree
Showing 9 changed files with 445 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/radlr-core/test/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
ReportType,
TestPackage,
};
use std::path::PathBuf;
use std::{path::PathBuf, str::FromStr};

/// Simple single thread compilation of a grammar source string.
/// `test_fn` is called after a successful compilation of parse states.
Expand Down
16 changes: 14 additions & 2 deletions crates/radlr-core/types/parser_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ pub struct ParserConfig {
/// The maximum number of lookead symbols allowed before parser construction
/// is aborted or a different disambiguating strategy is employed.
pub max_k: usize,

__BETA__: bool,
}

/// Configuration for the creation of a grammar from grammar sources.
Expand Down Expand Up @@ -90,6 +92,7 @@ impl Default for ParserConfig {
ALLOW_ANONYMOUS_NONTERM_INLINING: true,
ALLOW_BYTE_SEQUENCES: false,
max_k: usize::MAX,
__BETA__: false,
}
}
}
Expand All @@ -110,6 +113,15 @@ impl ParserConfig {
}
}

pub fn is_beta(&self) -> bool {
self.__BETA__
}

pub fn beta(mut self) -> Self {
self.__BETA__ = true;
self
}

pub fn hybrid(self) -> Self {
Self::new()
}
Expand Down Expand Up @@ -284,13 +296,13 @@ impl ParserClassification {
/// `RAD(2)` - Recursive Ascent & Descent with 2 levels of look ahead.
pub fn to_string(&self) -> String {
let base = if self.calls_present {
if self.bottom_up {
if self.bottom_up || self.gotos_present {
"RAD"
} else {
"RD"
}
} else {
if self.gotos_present {
if self.gotos_present || self.bottom_up {
"LR"
} else {
"LL"
Expand Down
1 change: 1 addition & 0 deletions crates/radlr-test/bootstrap/test_bytecode_bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fn test_full_grammar() -> RadlrResult<()> {
..Default::default()
},
pkg.address_to_state_name.clone(),
false,
));

let entry = pkg.get_entry_data_from_name("grammar").expect("Grammar export should be enterable");
Expand Down
Loading

0 comments on commit bba3420

Please sign in to comment.