Skip to content

Commit

Permalink
Improve parse info view
Browse files Browse the repository at this point in the history
- Add bytecode state groups
- Move state stacks and orient horizontally
- Add toggle to view pseudocode
  • Loading branch information
acweathersby committed Oct 8, 2024
1 parent b809d06 commit d06e102
Show file tree
Hide file tree
Showing 8 changed files with 623 additions and 523 deletions.
4 changes: 2 additions & 2 deletions crates/radlr-core/grammar/build_grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ fn process_rule_symbols(

let indices = set.symbols.iter().enumerate().map(|(i, _)| i).collect::<Vec<_>>();

if indices.len() > 4 && set.unordered {
todo!("Create error/warning about factorial explosions with `[]` sets greater than 4: (5+)! combinatorial explosion")
if indices.len() > 5 && set.unordered {
todo!("Create error/warning about factorial explosions with `[]` sets greater than 5: (6+)! combinatorial explosion")
}

let candidate_symbols = set.symbols.iter().enumerate().map(|(i, s)| (i + index, s)).collect::<Array<_>>();
Expand Down
3 changes: 1 addition & 2 deletions crates/radlr-rust-runtime/types/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ pub struct ParserContext {
/// not change during parsing unless the end of the input window has been
/// reached and a larger window is requested.
pub end_ptr: usize,
/// The number of characters that comprize the current
/// token. This should be 0 if the tok_id is also 0
/// The unique id of the token that is set to be produced by the scanner
pub tok_id: u32,
/// The byte length of the current token
pub tok_byte_len: u32,
Expand Down
2 changes: 1 addition & 1 deletion crates/radlr-rust-runtime/types/parse_table_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<'a> From<Instruction<'a>> for TableHeaderData<'a> {
let mut iter = i.iter();
let input_type = iter.next_u8().unwrap() as u32;
let default_delta = iter.next_u32_le().unwrap();
let scan_address = iter.next_u32_le().unwrap() as u32;
let scan_address = iter.next_u32_le().unwrap();
let table_length = iter.next_u32_le().unwrap();
let table_meta = iter.next_u32_le().unwrap();
let table_start = i.address() + 18;
Expand Down
2 changes: 1 addition & 1 deletion site/assets/js/lab/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export class NBContentField<EventObj = null, event_names = ""> extends NBField {
}

set_content_visible(is_content_visible: boolean) {
if (is_content_visible) {
if (is_content_visible) {
this.ele.classList.add("content-visible");
} else {
this.ele.classList.remove("content-visible");
Expand Down
Loading

0 comments on commit d06e102

Please sign in to comment.