Struct as3_parser::Source
source · pub struct Source { /* private fields */ }
Expand description
Represents an ActionScript source file.
Implementations§
source§impl Source
impl Source
sourcepub fn new(
file_path: Option<String>,
text: String,
compiler_options: &Rc<CompilerOptions>
) -> Rc<Self>
pub fn new( file_path: Option<String>, text: String, compiler_options: &Rc<CompilerOptions> ) -> Rc<Self>
Constructs a source file in unparsed and non verified state.
sourcepub fn invalidated(&self) -> bool
pub fn invalidated(&self) -> bool
Whether the source contains any errors after parsing and/or verification.
sourcepub fn comments(&self) -> &RefCell<Vec<Comment>>
pub fn comments(&self) -> &RefCell<Vec<Comment>>
The comments present in the source file. It is allowed to dynamically modify their contents in the structure.
sourcepub fn subsources(&self) -> Vec<Rc<Source>>
pub fn subsources(&self) -> Vec<Rc<Source>>
Returns source files belonging to include directives of this source.
sourcepub fn diagnostics(&self) -> Vec<Diagnostic>
pub fn diagnostics(&self) -> Vec<Diagnostic>
Diagnostics of the source file after parsing and/or verification.
sourcepub fn recursive_diagnostics(&self) -> Vec<Diagnostic>
pub fn recursive_diagnostics(&self) -> Vec<Diagnostic>
Diagnostics of the source file and its subsource files after parsing and/or verification.
sourcepub fn sort_diagnostics(&self)
pub fn sort_diagnostics(&self)
Sort diagnostics from the source and its subsources.
pub fn add_diagnostic(&self, diagnostic: Diagnostic)
pub fn error_count(&self) -> u32
pub fn warning_count(&self) -> u32
sourcepub fn get_line_offset(&self, line: usize) -> Option<usize>
pub fn get_line_offset(&self, line: usize) -> Option<usize>
Gets offset from line number (counted from one).
pub fn get_line_indent(&self, line: usize) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Source
impl !Send for Source
impl !Sync for Source
impl Unpin for Source
impl !UnwindSafe for Source
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst>,
Approximate the subject with the default scheme.
source§fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,
Approximate the subject with a specific scheme.
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
source§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere Self: Sized + Into<Dst>,
Convert the subject to a given type.