pub struct ComposeOptions {
pub default_extensibility: Option<Extensibility>,
pub default_nested: Option<bool>,
pub defines: Vec<(String, String)>,
pub hashed_id_advances_the_counter: HashedIdCounter,
pub hashed_name_spelling: HashedNameSpelling,
pub key_on_union_discriminator: KeyOnUnionDiscriminator,
pub name_of_the_enclosing_scope: NameOfTheEnclosingScope,
pub dialect: Dialect,
}Expand description
What the caller decides that the source does not.
Fields§
§default_extensibility: Option<Extensibility>What an aggregate of unspecified extensibility is taken to be.
None leaves the facet absent, so “the source said appendable”
stays distinguishable from “the source said nothing” and
Ast::effective_extensibility applies XTypes 1.3 §7.3.1.2.1.8’s
default. Some writes it into the model, which is what that same
paragraph provides for:
Implementations may provide a mechanism to override this default behavior; for example, IDL compilers may provide configuration options to allow users to specify whether types of unspecified extensibility are to be considered final, appendable, or mutable.
What the source did say still wins. This fills silence only, which is why it is an option here and not a rewrite of the tree.
default_nested: Option<bool>The @default_nested of the top-level modules that carry none of
their own — the compiler option DDS-XTypes 1.3 §7.3.1.2.1.7
requires (“IDL compilers shall provide the means to change the
default value for non-annotated top-level modules”). None is the
specification’s FALSE. See
zerodds_idl_lower::Options::default_nested.
defines: Vec<(String, String)>Macros defined before the first line is read — a build system’s
-D. An empty body is -DNAME: defined, expanding to nothing.
hashed_id_advances_the_counter: HashedIdCounterWhether a @hashid member advances the sequential id counter.
A dialect axis and not a preference: vendors disagree, and the
answer changes the id of every member after a @hashid one.
It is here because the wire corpus varies it, and the corpus and
a build have to be able to load a file the same way — two load
paths with the same intent is how a production path came to skip
the resolve pass entirely.
hashed_name_spelling: HashedNameSpellingWhich spelling of an escaped name a member-id hash reads. The
same kind of axis as the counter above — RTI hashes _long as
written where the clause hashes long — and here for the same
reason: the corpus and a build have to load a file the same way.
key_on_union_discriminator: KeyOnUnionDiscriminatorWhether @key on a union discriminator is carried.
The same axis zerodds-xml-compose carries, and here for the
reason the two above are here: a type declared once in IDL and
once in XML has to reach the same model, and the key bit is part
of its TypeIdentifier.
name_of_the_enclosing_scope: NameOfTheEnclosingScopeWhether a declaration may carry the name of the scope it sits in.
The same kind of axis as the three above, and here for the same
reason: the corpus and a build have to load a file the same way.
The measurement behind it is the corpus case
resolve-module-named-as-type, which Cyclone DDS and OpenDDS
refuse and Fast DDS and RTI Connext take.
dialect: DialectWhich vendors’ extensions this composition admits. Spec §3.5.
Reaches two stages, because vendor constructs live in two: the
parser sees keylist as grammar, the lowering sees #pragma keylist and OpenDDS’s DCPS_* as directives that change the
model. Dialect::STRICT turns both from a warning into an error.
Not part of a derived Default: see the impl Default below.
Implementations§
Trait Implementations§
Source§impl Clone for ComposeOptions
impl Clone for ComposeOptions
Source§impl Debug for ComposeOptions
impl Debug for ComposeOptions
Source§impl Default for ComposeOptions
ComposeOptions::default() admits every vendor extension.
impl Default for ComposeOptions
ComposeOptions::default() admits every vendor extension.
Written out rather than derived, because Dialect::default() is
STRICT and the two defaults are deliberately opposite. A tool
pointed at a file somebody else wrote should read it before it judges
it; --strict is the caller who asked the other question.