pub enum HeaderV1 {
UsePackage {
use_kw: KwUse,
package_kw: KwPackage,
open_kw: Option<KwOpen>,
path: ModChainV1,
},
UseOf {
use_kw: KwUse,
open_kw: Option<KwOpen>,
path: ModChainV1,
of_kw: KwOf,
relpath: LiteralTok,
},
Use {
use_kw: KwUse,
open_kw: Option<KwOpen>,
path: ModChainV1,
},
Legacy(Header),
}Expand description
A 0.1 header element — the UNION of BOTH packaging generations’ header
forms (Axis B). Legacy is dev-0-1-0’s @require:/@import:
(byte-identical to 0.0.6’s, reusing Header); the three Use*
forms are saphe-split’s headerelem (parser.mly:371-380 @ b836d512).
Which family is legal is a LoadMode question the loader answers
(rustyfi_loader), not a grammar question — this ONE V0_1 grammar
accepts both so the mode error can be raised at load time with a better
message than a lex error would give.
Variant order is parse priority (syan ordered-alternatives, most-specific
first): UsePackage (the package keyword disambiguates) precedes the
of-suffixed UseOf, which precedes bare Use (longest-match: use M of … must claim its of before a bare use M matches), which precedes the
token-disjoint Legacy (@-headers lex to distinct tokens).
Variants§
UsePackage
USE PACKAGE optional_open mod_chain — depend on an installed package
by its consumer-chosen alias (used_as). Header attributes
(#[test-only] etc., upstream list(attribute)) are DEFERRED.
UseOf
USE optional_open mod_chain OF STRING — load a local file by
backtick-quoted relative path (the @import: analog).
Use
USE optional_open mod_chain — sibling module inside the same package
(closed resolution; only legal inside envelope source trees, enforced
by the loader).
Legacy(Header)
@require:/@import: — Legacy packaging, unchanged shape.
Implementations§
Trait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for HeaderV1
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for HeaderV1
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.