Crate cairo_lang_macro

Source
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§

executable_attribute

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.
FullPathMarker
Full path marker.
PostProcessContext
Input for the post-process callback.
ProcMacroResult
Result of procedural macro code generation.
TokenStream
An abstract stream of Cairo tokens.
TokenStreamMetadata
Metadata of TokenStream.

Enums§

ExpansionFunc
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.