cairo_lang_plugins/
lib.rs

1//! Cairo core plugin implementations.
2use std::sync::Arc;
3
4use cairo_lang_defs::plugin::MacroPlugin;
5use plugins::ExternalAttributesValidationPlugin;
6
7use crate::plugins::{
8    CompileErrorPlugin, ConfigPlugin, DerivePlugin, GenerateTraitPlugin, PanicablePlugin,
9};
10
11pub mod plugins;
12#[cfg(any(feature = "testing", test))]
13pub mod test_utils;
14
15#[cfg(test)]
16mod test;
17
18/// Gets the base macro plugins to load into the Cairo compiler.
19pub fn get_base_plugins() -> Vec<Arc<dyn MacroPlugin>> {
20    // Config plugin should be first, as it removes items from the AST, and other plugins may
21    // add items prior to the removal of the original.
22    vec![
23        Arc::new(ConfigPlugin::default()),
24        Arc::new(DerivePlugin::default()),
25        Arc::new(GenerateTraitPlugin::default()),
26        Arc::new(PanicablePlugin::default()),
27        Arc::new(CompileErrorPlugin::default()),
28        Arc::new(ExternalAttributesValidationPlugin::default()),
29    ]
30}