Expand description
The syntax of #[leanfran::model], shared by the macro, the build script and
cargo leanfran: the attribute keys, the signature of a modelled function, its loops, and
the items of a crate with the hashes of their tokens.
Structs§
- Crate
Items - What a scan of
src/**/*.rsfinds. - Exported
- The arguments of
#[leanfran::exported(..)]: the Lean name, and for a generic function generated fromrust_instancesthe type parameters of the Lean function and its instantiations by Rust type (type_params = ["α"], instances = [("u32", "f.inst_U32")]). - Model
Attr - The keys of
#[leanfran::model(..)]. - ModelFn
- A modelled function of the crate.
- Opaque
Fn - A function of
#[leanfran::opaque], or a method of an inherent impl block with it. - Param
- Sig
- Type
Param - A type parameter of a generic function, with the traits of its bounds (the last segments of their paths).
- Uses
- A
useof a module: the local name and the path it stands for.
Enums§
- Loop
Node - A loop of a function body or a macro call (whose loops are not visible).
- Mode
- How a parameter is passed.
- Obligation
Mode - How the obligations of a generic function are stated.
- SpecRef
- A spec named by an attribute key.
Functions§
- file_
module - Module path of a file relative to the crate root:
src/a/b.rsandsrc/a/b/mod.rs→[a, b];src/lib.rs,src/main.rsandsrc/bin/*.rsare crate roots. - instance_
name - The part of a name standing for a type:
u32,Vec_u32,u32_String. - is_attr
truefor#[model],#[leanfran::model]and#[::leanfran::model].- item_
hash sha256:<hex>of the tokens ofitemwithout its doc comments.- loops
- The loops of a function body, as a tree of nesting.
- model_
attr - The keys of the
#[leanfran::model]attributes ofattrs, if there is one. - normalize_
type - A Rust type of an instance in the form both sides write: without spaces and the paths of
leanfran((rt::Nat, String)and(leanfran::Nat,String)are(Nat,String)). - parse_
exported - The arguments of an
exportedattribute. - parse_
model_ args - Parses the arguments of
#[leanfran::model(..)]. - path_
string - scan_
file - Scans the parsed file
ast(atfile, relative to the crate root, in modulemodule). - signature
- The signature of a function (a method of an impl block with the generics
outer), or an error for the signatures#[model]does not support. - trait_
unit - The unit name of a trait method:
crate::a::<Item as Trait>::f. - type_
name - The last identifier of a type path (
crate::inv::Item<T>→Item). - type_
params - The type parameters of
generics(the impl block’s, then the function’s), with the bounds of theirwhereclauses. - type_
text - The text of a type without spaces:
Vec<u32>,(u32,String).