Expand description
A library for writing Cairo procedural macros in Rust.
§Cairo procedural macro
A Cairo procedural macro is a dynamic library that can be loaded by Scarb package manager during the project build. The goal of procedural macros is to provide dynamic code generation capabilities to Cairo programmers.
The code generation should be implemented as a Rust function, that takes TokenStream
as
input and returns ProcMacroResult
as output.
The function implementing the macro should be wrapped with attribute_macro
.
Macros§
Structs§
- AuxData
- Auxiliary data returned by procedural macro code generation.
- Diagnostic
- Diagnostic returned by the procedural macro.
- Diagnostics
- A set of diagnostics that arose during the computation.
- Full
Path Marker - Full path marker.
- Post
Process Context - Input for the post-process callback.
- Proc
Macro Result - Result of procedural macro code generation.
- Token
Stream - An abstract stream of Cairo tokens.
- Token
Stream Metadata - Metadata of
TokenStream
.
Enums§
- Expansion
Func - Severity
- The severity of a diagnostic.
Attribute Macros§
- attribute_
macro - Constructs the attribute macro implementation.
- derive_
macro - Constructs the derive macro implementation.
- inline_
macro - Constructs the inline macro implementation.
- post_
process - Constructs the post-processing callback.