Gcode.Model.Expr.Unary (gcode v1.0.0)

Represents a unary (or prefix) expression in G-code. A unary consists of a single operand and an operator.

Link to this section Summary

Types

Valid unary operators

t()

Functions

Wrap an inner expression and operator in a unary expression.

Link to this section Types

@type operator() :: :! | :+ | :- | :"#"

Valid unary operators

@type t() :: %Gcode.Model.Expr.Unary{
  expr: Gcode.Option.t(Gcode.Model.Expr.t()),
  op: Gcode.Option.t(atom())
}

Link to this section Functions

Link to this function

init(operator, expr)

@spec init(operator(), Gcode.Model.Expr.t()) :: Gcode.Result.t(t())

Wrap an inner expression and operator in a unary expression.