pub struct LocalSymbolTable { /* private fields */ }Expand description
File-local subroutine symbol table built from a pre-pass scan.
§Forward references
Because this is a whole-file pre-pass, subroutines declared after their first call site are recognized correctly. A forward reference like:
builder /pattern/;
sub builder { ... }will be parsed as a function call with a regex argument.
Implementations§
Source§impl LocalSymbolTable
impl LocalSymbolTable
Sourcepub fn scan_subs(input: &str) -> Self
pub fn scan_subs(input: &str) -> Self
Scan Perl source for sub NAME declarations and build a symbol table.
This is a best-effort O(n) pre-pass. It skips line comments (#…) and
simple single- and double-quoted string literals so that # sub foo or
"sub foo" patterns do not produce false positives. POD sections and
heredocs are not specially handled; declarations inside them are a
known (harmless) false-positive class.
Sourcepub fn is_known_sub(&self, name: &str) -> bool
pub fn is_known_sub(&self, name: &str) -> bool
Return true if name was declared as a subroutine in this file.
Trait Implementations§
Source§impl Clone for LocalSymbolTable
impl Clone for LocalSymbolTable
Source§fn clone(&self) -> LocalSymbolTable
fn clone(&self) -> LocalSymbolTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LocalSymbolTable
impl Debug for LocalSymbolTable
Source§impl Default for LocalSymbolTable
impl Default for LocalSymbolTable
Source§fn default() -> LocalSymbolTable
fn default() -> LocalSymbolTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LocalSymbolTable
impl RefUnwindSafe for LocalSymbolTable
impl Send for LocalSymbolTable
impl Sync for LocalSymbolTable
impl Unpin for LocalSymbolTable
impl UnsafeUnpin for LocalSymbolTable
impl UnwindSafe for LocalSymbolTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more