pub struct Program {
pub declarations: Vec<Decl>,
}Expand description
Top-level program: a sequence of declarations.
Fields§
§declarations: Vec<Decl>Implementations§
Source§impl Program
impl Program
Sourcepub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Return the number of function declarations in the program.
Counts top-level fn declarations plus methods inside impl blocks.
Does not count lambdas or closures.
Sourcepub fn struct_count(&self) -> usize
pub fn struct_count(&self) -> usize
Return the number of struct declarations in the program.
Sourcepub fn has_main_function(&self) -> bool
pub fn has_main_function(&self) -> bool
Return true if there is a top-level function named "main".
The CJC runtime uses the presence of a main function to determine
the program entry point.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnsafeUnpin for Program
impl UnwindSafe for Program
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