Struct python_ast::preprocessor::blockscope::BlockScopePreprocessor
[−]
[src]
pub struct BlockScopePreprocessor { log: Logger, }
Preprocessor to splice BlockStart and BlockEnd tokens based on indent deltas into the slice of tokens so we do not have to keep the state in the main parser logic.
Fields
log: Logger
Methods
impl BlockScopePreprocessor
[src]
const NAME: &'static str
NAME: &'static str = "BlockScopePreprocessor"
fn new() -> Self
const fn name(&self) -> &str
fn determine_indent<'a>(&self, tokens: &TkSlice<'a>) -> usize
Determine the length of the first indent as the longest consecutive span of space tokens after a newline before a non space is reached where the the length of the span must be greater than 0.
fn balance_scopes<'b>(
&self,
span_len: usize,
indent: usize,
stack_idx_start: usize,
indent_stack: &mut [usize],
acc: &mut Vec<TkSlice<'b>>
) -> Result<usize, String>
&self,
span_len: usize,
indent: usize,
stack_idx_start: usize,
indent_stack: &mut [usize],
acc: &mut Vec<TkSlice<'b>>
) -> Result<usize, String>
Given the length of the current span of whitespace, the size of the first discovered indent, and the current index in the indent stack.
Trait Implementations
impl Debug for BlockScopePreprocessor
[src]
impl Clone for BlockScopePreprocessor
[src]
fn clone(&self) -> BlockScopePreprocessor
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more