Skip to main content

Module ast

Module ast 

Source
Expand description

Abstract syntax tree for µcad files

Structs§

ArgumentList
A list of arguments to a function call
ArrayItem
An item that can be part of an array expression
ArrayListExpression
An array specified as a list of items
ArrayRangeExpression
An array range, containing all values from the start value (inclusive) till then end value (exclusive)
ArrayType
An array type
Attribute
An attribute that can be attached to a statement
BinaryOperation
A binary operation
BinaryOperator
An operator for binary operators, together with a span
Body
BoolLiteral
A boolean literal, either true or false
Call
A function call
Comment
A single- or multi-line comment
ConstAssignment
A const assignment: const A = 42 / pub A = 32
DocBlock
Lines of inner or outer doc block including prefix //////!.
Element
ElementAccess
An expression that access an element from another expression.
ExpressionStatement
A statement containing of a bare expression
FileModule
A definition of a module
FloatLiteral
An float literal without type
FormatString
A string containing a format expression
FunctionDefinition
A definition of a function
Identifier
A µcad identifier
If
An if expression, can be used as either a statement or expression
InitDefinition
An init definition for a workbench
InlineModule
A definition of a module
InnerDocComment
An inner doc block
IntegerLiteral
An integer literal without type
ItemExtras
Non-syntactic extras that can be attached to many ast nodes
LeadingExtras
Extras that occur after a syntax element.
Literal
A literal value
LiteralError
An error that can be encountered while parsing literal tokens
LocalAssignment
A local assignment: a = 42
NamedArgument
An argument with a specified name
Parameter
A parameter for a workbench definition or function definition
ParameterList
A parameter list of a workbench definition or function definition
Program
A µcad program
PropertyAssignment
A property assignment: prop a = 42
QualifiedName
A qualified name, containing one or more [Identifier]s separated by ::
QuantityLiteral
A float literal with type
Return
A return statement
SingleType
A type for a single numeric value
Source
A µcad source with a parse syntax tree with a line offset and the hashed original source code.
StatementList
A list of statements, with optional trailing whitespace kept and an optional “tail” expression
StringCharacter
A single character that is part of a FormatString
StringExpression
A format expression that is part of a FormatString
StringFormatSpecification
The format specification for a StringExpression, specifying the width and precision for number formatting
StringLiteral
A string literal, without format expressions
TrailingExtras
Extras that occur before a syntax element.
TupleExpression
A tuple expression, a fixed size set of items that don’t need to be the same type
TupleItem
An item that is part of a tuple expression
TupleType
A tuple type
UnaryOperation
A unary operation
UnaryOperator
An operator for unary operators, together with a span
Unit
A µcad unit: mm, m³, %.
UnnamedArgument
An argument without specified name
UseName
The name of the item being imported
UseStatement
A use statement that imports an item from an external library
WorkbenchDefinition
A definition of a workbench

Enums§

Argument
A function argument that is part of an ArgumentList
AttributeCommand
The contents an an Attribute
BinaryOperatorType
The type of the operator for binary operations
CommentInner
ElementInner
The possible element access types
Expression
Any expression.
ItemExtra
LiteralErrorKind
LiteralKind
The various types of literal values a Literal can contain
Statement
A µcad statement.
StringPart
A part of a FormatString
Type
The possible types
UnaryOperatorType
The type of the operator for unary operations
UseStatementPart
The parts a UseName consists of, separated by ::
Visibility
An optional visibility modifier
WorkbenchKind
The possible type of workbenches