You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[doc = concat!("Embed ", stringify!($backend)," expression inside a Rust expression. This macro takes only one argument: some raw ", stringify!($backend)," code as a string literal.")]
787
-
///
788
-
789
-
/// While it is possible to directly write raw backend code,
790
-
/// sometimes it can be inconvenient. For example, referencing
791
-
/// Rust names can be a bit cumbersome: for example, the name
792
-
/// `my_crate::my_module::CONSTANT` might be translated
793
-
/// differently in a backend (e.g. in the F* backend, it will
794
-
/// probably be `My_crate.My_module.v_CONSTANT`).
795
-
///
796
-
797
-
/// To facilitate this, you can write Rust names directly,
798
-
/// using the prefix `$`: `f $my_crate::my_module__CONSTANT + 3`
799
-
/// will be replaced with `f My_crate.My_module.v_CONSTANT + 3`
800
-
/// in the F* backend for instance.
801
-
802
-
/// If you want to refer to the Rust constructor
803
-
/// `Enum::Variant`, you should write `$$Enum::Variant` (note
804
-
/// the double dollar).
805
-
806
-
/// If the name refers to something polymorphic, you need to
807
-
/// signal it by adding _any_ type informations,
808
-
/// e.g. `${my_module::function<()>}`. The curly braces are
809
-
/// needed for such more complex expressions.
810
-
811
-
/// You can also write Rust patterns with the `$?{SYNTAX}`
812
-
/// syntax, where `SYNTAX` is a Rust pattern. The syntax
813
-
/// `${EXPR}` also allows any Rust expressions
814
-
/// `EXPR` to be embedded.
815
-
816
-
/// Types can be refered to with the syntax `$:{TYPE}`.
let ts:TokenStream = quote::expression(quote::InlineExprType::Unit, payload).into();
820
-
quote!{{
821
-
#[cfg([< hax_backend_ $backend >])]
822
-
{
823
-
#ts
824
-
}
825
-
}}.into()
826
-
}
785
+
#[doc = concat!("Embed ", stringify!($backend)," expression inside a Rust expression. This macro takes only one argument: some raw ", stringify!($backend)," code as a string literal.")]
786
+
///
827
787
828
-
#[doc = concat!("The `Prop` version of `", stringify!($backend),"_expr`.")]
0 commit comments