pub struct CompileContext {
pub variables: HashMap<String, AnyExpr>,
pub flags: FlagSet,
pub rules: RefCell<Vec<UnrolledRule>>,
/* private fields */
}
Expand description
The context of compilation process.
Fields§
§variables: HashMap<String, AnyExpr>
Variables
flags: FlagSet
Flags
rules: RefCell<Vec<UnrolledRule>>
Unrolled rules
Implementations§
source§impl CompileContext
impl CompileContext
pub fn new() -> Self
pub fn push_error(&self, err: Error)
pub fn ok<T>(&self, res: Result<T, Error>) -> Option<T>
pub fn take_errors(&mut self) -> Vec<Error>
pub fn extend_errors<I: IntoIterator<Item = Error>>(&self, iter: I)
pub fn valid(&self) -> bool
pub fn push_rule(&self, rule: UnrolledRule)
pub fn take_rules(&mut self) -> Vec<UnrolledRule>
source§impl CompileContext
impl CompileContext
Everything related to circles.
source§impl CompileContext
impl CompileContext
pub fn expr_with<T: Displayed>( &self, content: T, display: Properties, nodes: Vec<Box<dyn Node>>, ) -> Expr<T>
pub fn average_p_display( &self, points: Vec<Expr<Point>>, display: Properties, ) -> Expr<Point>
pub fn average_p(&self, points: Vec<Expr<Point>>) -> Expr<Point>
pub fn average_s_display( &self, values: Vec<Expr<Scalar>>, display: Properties, ) -> Expr<Scalar>
pub fn average_s(&self, points: Vec<Expr<Scalar>>) -> Expr<Scalar>
pub fn set_unit_display( &self, v: Expr<Scalar>, unit: ComplexUnit, display: Properties, ) -> Expr<Scalar>
pub fn set_unit(&self, v: Expr<Scalar>, unit: ComplexUnit) -> Expr<Scalar>
pub fn free_point_display(&self, display: Properties) -> Expr<Point>
pub fn free_point(&self) -> Expr<Point>
pub fn free_scalar_display(&self, display: Properties) -> Expr<Scalar>
pub fn free_scalar(&self) -> Expr<Scalar>
pub fn intersection_display( &self, k: Expr<Line>, l: Expr<Line>, display: Properties, ) -> Expr<Point>
pub fn intersection(&self, k: Expr<Line>, l: Expr<Line>) -> Expr<Point>
pub fn distance_pp_display( &self, p: Expr<Point>, q: Expr<Point>, display: Properties, ) -> Expr<Scalar>
pub fn distance_pp(&self, p: Expr<Point>, q: Expr<Point>) -> Expr<Scalar>
pub fn distance_pl_display( &self, p: Expr<Point>, k: Expr<Line>, display: Properties, ) -> Expr<Scalar>
pub fn distance_pl(&self, p: Expr<Point>, k: Expr<Line>) -> Expr<Scalar>
pub fn circle_center_display( &self, c: Expr<Circle>, display: Properties, ) -> Expr<Point>
pub fn circle_center(&self, c: Expr<Circle>) -> Expr<Point>
pub fn circle_radius_display( &self, c: Expr<Circle>, display: Properties, ) -> Expr<Scalar>
pub fn circle_radius(&self, c: Expr<Circle>) -> Expr<Scalar>
pub fn line_display( &self, a: Expr<Point>, b: Expr<Point>, display: Properties, ) -> Expr<Line>
pub fn line(&self, a: Expr<Point>, b: Expr<Point>) -> Expr<Line>
pub fn angle_ppp_display( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, display: Properties, ) -> Expr<Scalar>
pub fn angle_ppp( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, ) -> Expr<Scalar>
pub fn angle_dir_display( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, display: Properties, ) -> Expr<Scalar>
pub fn angle_dir( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, ) -> Expr<Scalar>
pub fn angle_ll_display( &self, k: Expr<Line>, l: Expr<Line>, display: Properties, ) -> Expr<Scalar>
pub fn angle_ll(&self, k: Expr<Line>, l: Expr<Line>) -> Expr<Scalar>
pub fn bisector_ppp_display( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, display: Properties, ) -> Expr<Line>
pub fn bisector_ppp( &self, a: Expr<Point>, b: Expr<Point>, c: Expr<Point>, ) -> Expr<Line>
pub fn perpendicular_through_display( &self, line: Expr<Line>, point: Expr<Point>, display: Properties, ) -> Expr<Line>
pub fn perpendicular_through( &self, line: Expr<Line>, point: Expr<Point>, ) -> Expr<Line>
pub fn parallel_through_display( &self, line: Expr<Line>, point: Expr<Point>, display: Properties, ) -> Expr<Line>
pub fn parallel_through( &self, line: Expr<Line>, point: Expr<Point>, ) -> Expr<Line>
pub fn circle_display( &self, center: Expr<Point>, radius: Expr<Scalar>, display: Properties, ) -> Expr<Circle>
pub fn circle(&self, center: Expr<Point>, radius: Expr<Scalar>) -> Expr<Circle>
pub fn add_display( &self, a: Expr<Scalar>, b: Expr<Scalar>, display: Properties, ) -> Expr<Scalar>
pub fn add(&self, a: Expr<Scalar>, b: Expr<Scalar>) -> Expr<Scalar>
pub fn sub_display( &self, a: Expr<Scalar>, b: Expr<Scalar>, display: Properties, ) -> Expr<Scalar>
pub fn sub(&self, a: Expr<Scalar>, b: Expr<Scalar>) -> Expr<Scalar>
pub fn mult_display( &self, a: Expr<Scalar>, b: Expr<Scalar>, display: Properties, ) -> Expr<Scalar>
pub fn mult(&self, a: Expr<Scalar>, b: Expr<Scalar>) -> Expr<Scalar>
pub fn div_display( &self, a: Expr<Scalar>, b: Expr<Scalar>, display: Properties, ) -> Expr<Scalar>
pub fn div(&self, a: Expr<Scalar>, b: Expr<Scalar>) -> Expr<Scalar>
source§impl CompileContext
impl CompileContext
pub fn scalar_eq_display( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, display: Properties, ) -> Box<dyn Node>
pub fn scalar_eq( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, ) -> Box<dyn Node>
pub fn point_eq_display( &mut self, lhs: Expr<Point>, rhs: Expr<Point>, inverted: bool, display: Properties, ) -> Box<dyn Node>
pub fn point_eq( &mut self, lhs: Expr<Point>, rhs: Expr<Point>, inverted: bool, ) -> Box<dyn Node>
pub fn gt_display( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, display: Properties, ) -> Box<dyn Node>
pub fn gt( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, ) -> Box<dyn Node>
pub fn lt_display( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, display: Properties, ) -> Box<dyn Node>
pub fn lt( &mut self, lhs: Expr<Scalar>, rhs: Expr<Scalar>, inverted: bool, ) -> Box<dyn Node>
Trait Implementations§
source§impl Debug for CompileContext
impl Debug for CompileContext
Auto Trait Implementations§
impl !Freeze for CompileContext
impl !RefUnwindSafe for CompileContext
impl !Send for CompileContext
impl !Sync for CompileContext
impl Unpin for CompileContext
impl !UnwindSafe for CompileContext
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
source§impl<T> Convert for T
impl<T> Convert for T
source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Errors Read more
source§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Errors Read more