pub struct Makefile(/* private fields */);Expand description
An AST node for $ast
Implementations§
source§impl Makefile
impl Makefile
sourcepub fn read_relaxed<R: Read>(r: R) -> Result<Makefile, Error>
pub fn read_relaxed<R: Read>(r: R) -> Result<Makefile, Error>
Read makefile from a reader, but allow syntax errors
sourcepub fn rules(&self) -> impl Iterator<Item = Rule>
pub fn rules(&self) -> impl Iterator<Item = Rule>
Retrieve the rules in the makefile
§Example
use makefile_lossless::Makefile;
let makefile: Makefile = "rule: dependency\n\tcommand\n".parse().unwrap();
assert_eq!(makefile.rules().count(), 1);sourcepub fn rules_by_target<'a>(
&'a self,
target: &'a str,
) -> impl Iterator<Item = Rule> + 'a
pub fn rules_by_target<'a>( &'a self, target: &'a str, ) -> impl Iterator<Item = Rule> + 'a
Get all rules that have a specific target
sourcepub fn variable_definitions(&self) -> impl Iterator<Item = VariableDefinition>
pub fn variable_definitions(&self) -> impl Iterator<Item = VariableDefinition>
Get all variable definitions in the makefile
Trait Implementations§
source§impl AstNode for Makefile
impl AstNode for Makefile
type Language = Lang
fn can_cast(kind: SyntaxKind) -> bool
fn cast(syntax: SyntaxNode<Lang>) -> Option<Self>
fn syntax(&self) -> &SyntaxNode<Lang>
fn clone_for_update(&self) -> Selfwhere
Self: Sized,
fn clone_subtree(&self) -> Selfwhere
Self: Sized,
impl Eq for Makefile
impl StructuralPartialEq for Makefile
Auto Trait Implementations§
impl Freeze for Makefile
impl !RefUnwindSafe for Makefile
impl !Send for Makefile
impl !Sync for Makefile
impl Unpin for Makefile
impl !UnwindSafe for Makefile
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