Module debris_hir::hir_nodes
source · Expand description
Defines every node used in the hir representation
Structs
- Attributes are a form of metadata that can be applied to any object.
- A block of code. Usually contained withing a pair of {} parenthesis.
- An if-branch which checks a condition and runs code depending on whether the condition is true or not
- Represents a control flow statement like return or break
- A function, which contains other statements
- Any function call, can be dotted
- Marks an import statement. The id specifies the index of the matching
HirModule
- An infinite loop (Can be exited using control keywords like
break
andreturn
) - Holds an infix operator combined with its span
- A module with an associated name
- Holds a variable type declaration like
foo: String
This is used in method signatures - Holds a prefix operator combined with its span
- Declaration of a property in a struct definition
- A struct definition
- Creates a Struct Object from a struct
- Sets a variable like
let a = expression();
- Similar to
HirVariableInitialization
, however this node marks a write to an already initialized value
Enums
- Any supported comparison operator
- A constant literal, already parsed
- Any expression
- Anonymous functions don’t have an explicit identifier, So if the function is unnamed, the hir builder will try to infer it.
- Any operator that can be used as an infix
- Any Item
- Any prefix operator
- Any statement, the difference to an expression is that a statement does not return anything
- Any pattern that is allowed to specify a function parameter type