Module meta

Module meta 

Source
Expand description

#[deftly(...)] meta attributes

§Used meta checking

Most of this file is concerned with generating accurate and useful messages when a driver is decorated with #[deftly(...)] attributes which are not used by any template.

We distinguish “used” metas from “recognised” ones.

“Used” ones are those actually tested, and used, during the dynamic expansion of the template. They are recorded in the PreprocessedMetas, which contains a Cell for each supplied node.

“Recognised” ones are those which appear anywhere in the template. These are represented in a data structure [``Recognised]. This is calculated by scanning the template, using the FindRecogMetas` trait.

Both of these sets are threaded through the ACCUM data in successive template expansions; in the final call (EngineFinalInput), they are combined together, and the driver’s metas are checked against them.

Re-exports§

pub use FoundNearbyNodeKind as FNNK;
pub use FoundNodeKind as FNK;

Macros§

impL_find_recog_metas_via_deref 🔒
impL_find_recog_metas_via_iter 🔒

Structs§

Accum
Information for meta checking, found in accumulation
BorrowedDesig 🔒
Desig
Meta designator eg fmeta(foo(bar))
DisplayAsIfSpecified 🔒
Displays as a #[deftly(...)] as the user might write it
FoundNearbyNode
Information about a nearby meta node we found
FoundNode
Node in tree structure found in driver #[deftly(some(thing))]
IsUsed
Label
(foo(bar)) in eg fmeta(foo(bar))
MetaUnsupported
newtype to avoid coherence - it doesn’t impl Parse + ToTokens
PreprocessedTree
An #[deftly()] attribute, or a sub-tree within one
PreprocessedValueList
A part like (foo,bar(baz),zonk="value")
Recognised
ScopeIter
An iterator over the variants of Scope
SubstAsSupported
SubstMeta
SuppliedScopeIter
An iterator over the variants of SuppliedScope
UsageInfo
UsageModeIter
An iterator over the variants of UsageMode
UsedChecker 🔒
UsedGroup
One lot of used metas in accumulation - argument to a _meta_used accum

Enums§

CheckUsed
Something representing possibly checking that meta attributes are used
FoundNearbyNodeKind
How the nearby node relates to the one we were looking for
FoundNodeKind
Node in tree structure found in driver #[deftly(some(thing))]
PreprocessedValue
Content of a meta attribute
Scope
Indicates one of fmeta, vmeta or tmeta
SubstAs
SuppliedScope
Scope of a supplied meta (#[deftly(...)]) attribute
UsageMode

Traits§

FindRecogMetas
SubstAsSupportStatus
Implemented for syn types supported in this build, and MetaUnsupported

Functions§

metavalue_lit_as
Convert a literal found in a meta item into T
metavalue_litstr 🔒
Obtain the LiStr from a meta node value (ie, a Lit)
metavalue_spans 🔒
unrecognised_error 🔒

Type Aliases§

PreprocessedMetas
#[deftly(...)] helper attributes
Usage
ValueExpr
ValueItems