Skip to main content

sysml_v2_parser/ast/
structure.rs

1use super::behavior::{Allocate, InOut, InOutDecl, StateDefBody, StateUsage};
2use super::common::{CommentAnnotation, ConnectBody, DocComment, Identification, ParseErrorNode};
3use super::requirement::{EnumerationUsage, ItemUsage, RequirementUsage, Satisfy};
4use super::view::{CalcUsage, ConstraintDefBody};
5use crate::ast::core::{Expression, Node, Span};
6
7/// Part definition: `part def` Identification (`:>` specializes)? Body.
8#[derive(Debug, Clone, PartialEq, Eq)]
9pub struct PartDef {
10    /// Optional `abstract` or `variation` prefix (BNF BasicDefinitionPrefix).
11    pub definition_prefix: Option<DefinitionPrefix>,
12    /// Whether this is an `individual part def`.
13    pub is_individual: bool,
14    pub identification: Identification,
15    /// Supertype after `:>`, e.g. Some("Axle") for `part def FrontAxle :> Axle`.
16    pub specializes: Option<String>,
17    /// Span of the `:> <type>` fragment (for semantic tokens), when present.
18    pub specializes_span: Option<Span>,
19    pub body: PartDefBody,
20}
21
22/// BNF BasicDefinitionPrefix: `abstract` | `variation`.
23#[derive(Debug, Clone, PartialEq, Eq)]
24pub enum DefinitionPrefix {
25    Abstract,
26    Variation,
27}
28
29/// Body of a part definition: `;` or `{` PartDefBodyElement* `}`.
30#[derive(Debug, Clone, PartialEq, Eq)]
31pub enum PartDefBody {
32    Semicolon,
33    Brace {
34        elements: Vec<Node<PartDefBodyElement>>,
35    },
36}
37
38/// Element inside a part definition body.
39#[derive(Debug, Clone, PartialEq, Eq)]
40pub enum PartDefBodyElement {
41    Error(Node<ParseErrorNode>),
42    Doc(Node<DocComment>),
43    Comment(Node<CommentAnnotation>),
44    Annotation(Node<Annotation>),
45    MetadataKeywordUsage(Node<MetadataKeywordUsage>),
46    Other(String),
47    AttributeDef(Node<AttributeDef>),
48    AttributeUsage(Node<AttributeUsage>),
49    RequirementUsage(Node<RequirementUsage>),
50    ItemUsage(Node<ItemUsage>),
51    Ref(Node<RefDecl>),
52    PortUsage(Node<PortUsage>),
53    PartUsage(Box<Node<PartUsage>>),
54    OccurrenceUsage(Box<Node<OccurrenceUsage>>),
55    InterfaceDef(Node<InterfaceDef>),
56    InterfaceUsage(Node<InterfaceUsage>),
57    Connect(Node<Connect>),
58    /// `connection` usage member inside a part definition body.
59    Connection(Node<ConnectionUsageMember>),
60    Perform(Node<Perform>),
61    Allocate(Node<Allocate>),
62    OpaqueMember(Node<OpaqueMemberDecl>),
63    /// `exhibit state` name `:` type (`;` or body).
64    ExhibitState(Node<ExhibitState>),
65    /// Calculation usage (`calc` keyword) inside a part definition body.
66    CalcUsage(Node<CalcUsage>),
67    /// Enumeration usage (`enum` keyword) inside a part definition body.
68    EnumerationUsage(Node<EnumerationUsage>),
69}
70
71/// Library-tolerant part member preserved without forcing it into an unrelated node shape.
72#[derive(Debug, Clone, PartialEq, Eq)]
73pub struct OpaqueMemberDecl {
74    pub keyword: String,
75    pub name: String,
76    pub text: String,
77    pub body: AttributeBody,
78}
79
80/// Connection usage member inside part definitions.
81#[derive(Debug, Clone, PartialEq, Eq)]
82pub struct ConnectionUsageMember {
83    pub name: Option<String>,
84    pub type_name: Option<String>,
85    pub body: ConnectionDefBody,
86    pub subsets: Option<String>,
87    pub redefines: Option<String>,
88}
89
90/// Exhibit state usage: `exhibit state` name `:` type (`;` or body).
91#[derive(Debug, Clone, PartialEq, Eq)]
92pub struct ExhibitState {
93    pub name: String,
94    pub type_name: Option<String>,
95    pub redefines: Option<String>,
96    pub body: StateDefBody,
97}
98
99/// Attribute definition: `attribute` [`def`] name (`:>` | `:` type)? (`=` value)? body.
100#[derive(Debug, Clone, PartialEq, Eq)]
101pub struct AttributeDef {
102    pub name: String,
103    /// Type after `:>`, e.g. Some("ISQ::mass").
104    pub typing: Option<String>,
105    /// Default or binding after `=` / `:=` / `default =` before the body terminator.
106    pub value: Option<Node<Expression>>,
107    pub body: AttributeBody,
108    /// Span of the defined name (for semantic tokens).
109    pub name_span: Option<Span>,
110    /// Span of the type after `:>`, if present (for semantic tokens).
111    pub typing_span: Option<Span>,
112}
113
114/// Body of an attribute (def or usage): `;` or `{` AttributeBodyElement* `}`.
115#[derive(Debug, Clone, PartialEq, Eq)]
116pub enum AttributeBody {
117    Semicolon,
118    Brace {
119        elements: Vec<Node<AttributeBodyElement>>,
120    },
121}
122
123#[derive(Debug, Clone, PartialEq, Eq)]
124pub enum AttributeBodyElement {
125    Error(Node<ParseErrorNode>),
126    Doc(Node<DocComment>),
127    AttributeDef(Node<AttributeDef>),
128    AttributeUsage(Node<AttributeUsage>),
129    Other(String),
130}
131
132/// Item definition: `item def` Identification body (for events, etc.).
133#[derive(Debug, Clone, PartialEq, Eq)]
134pub struct ItemDef {
135    pub identification: Identification,
136    pub specializes: Option<String>,
137    pub specializes_span: Option<Span>,
138    pub body: AttributeBody,
139}
140
141/// Individual definition: `individual def` Identification `:>` type body.
142#[derive(Debug, Clone, PartialEq, Eq)]
143pub struct IndividualDef {
144    pub identification: Identification,
145    pub specializes: Option<String>,
146    pub specializes_span: Option<Span>,
147    pub body: AttributeBody,
148}
149
150/// Part usage: `part` name `:` type multiplicity? `ordered`? (`redefines`|`:>>`)? value? body.
151#[derive(Debug, Clone, PartialEq, Eq)]
152pub struct PartUsage {
153    pub is_individual: bool,
154    pub name: String,
155    /// Type after `:`, e.g. "Vehicle", "AxleAssembly".
156    pub type_name: String,
157    /// Multiplicity, e.g. Some("[2]").
158    pub multiplicity: Option<String>,
159    pub ordered: bool,
160    /// Optional `subsets` feature and value expression.
161    pub subsets: Option<(String, Option<Node<Expression>>)>,
162    /// Redefines target, e.g. Some("frontAxleAssembly") or Some("vehicle1::mass").
163    pub redefines: Option<String>,
164    /// Value expression (= expr, default = expr, := expr).
165    pub value: Option<Node<Expression>>,
166    pub body: PartUsageBody,
167    /// Span of the usage name (for semantic tokens).
168    pub name_span: Option<Span>,
169    /// Span of the type reference after `:` (for semantic tokens).
170    pub type_ref_span: Option<Span>,
171}
172
173/// Body of a part usage: `;` or `{` PartUsageBodyElement* `}`.
174#[derive(Debug, Clone, PartialEq, Eq)]
175pub enum PartUsageBody {
176    Semicolon,
177    Brace {
178        elements: Vec<Node<PartUsageBodyElement>>,
179    },
180}
181
182/// Metadata annotation on usage: `@` Name (`:` Type)? MetadataBody (e.g. `@Security;` or `@Safety{isMandatory = true;}`).
183#[derive(Debug, Clone, PartialEq, Eq)]
184pub struct MetadataAnnotation {
185    pub name: String,
186    pub type_name: Option<String>,
187    pub body: ConnectBody,
188    pub head_span: Option<Span>,
189    pub type_span: Option<Span>,
190}
191
192/// User-defined metadata keyword usage: `#keyword` (`:` Type)? body.
193#[derive(Debug, Clone, PartialEq, Eq)]
194pub struct MetadataKeywordUsage {
195    pub keyword: String,
196    pub type_name: Option<String>,
197    pub body: ConnectBody,
198    pub keyword_span: Span,
199    pub type_span: Option<Span>,
200}
201
202/// Generic annotation or metadata usage captured in body scopes.
203#[derive(Debug, Clone, PartialEq, Eq)]
204pub struct Annotation {
205    pub sigil: String,
206    pub head: String,
207    pub type_name: Option<String>,
208    pub body: ConnectBody,
209    pub head_span: Option<Span>,
210    pub type_span: Option<Span>,
211}
212
213/// Element inside a part usage body.
214#[derive(Debug, Clone, PartialEq, Eq)]
215pub enum PartUsageBodyElement {
216    Error(Node<ParseErrorNode>),
217    Doc(Node<DocComment>),
218    Annotation(Node<Annotation>),
219    AttributeUsage(Node<AttributeUsage>),
220    EnumerationUsage(Node<EnumerationUsage>),
221    PartUsage(Box<Node<PartUsage>>),
222    OccurrenceUsage(Box<Node<OccurrenceUsage>>),
223    PortUsage(Node<PortUsage>),
224    Bind(Node<Bind>),
225    /// `ref` name `:` type body (reference binding in part usage).
226    Ref(Node<RefDecl>),
227    InterfaceUsage(Node<InterfaceUsage>),
228    Connect(Node<Connect>),
229    Perform(Node<Perform>),
230    Allocate(Node<Allocate>),
231    Satisfy(Node<Satisfy>),
232    StateUsage(Node<StateUsage>),
233    MetadataAnnotation(Node<MetadataAnnotation>),
234    MetadataKeywordUsage(Node<MetadataKeywordUsage>),
235}
236
237/// Enacted performance: `perform` action_path `{` body `}` inside a part usage.
238#[derive(Debug, Clone, PartialEq, Eq)]
239pub struct Perform {
240    /// Qualified action name (e.g. "provide power" or "provide power.generate torque").
241    pub action_name: String,
242    /// Type after `:` in "perform action name : Type" form.
243    pub type_name: Option<String>,
244    pub body: PerformBody,
245}
246
247/// Body of a perform: `;` or `{` PerformBodyElement* `}`.
248#[derive(Debug, Clone, PartialEq, Eq)]
249pub enum PerformBody {
250    Semicolon,
251    Brace {
252        elements: Vec<Node<PerformBodyElement>>,
253    },
254}
255
256/// Element inside a perform body: doc comment or in/out binding.
257#[derive(Debug, Clone, PartialEq, Eq)]
258pub enum PerformBodyElement {
259    Doc(Node<DocComment>),
260    InOut(Node<PerformInOutBinding>),
261}
262
263/// In/out binding inside a perform body: `in` name `=` expr `;` or `out` name `=` expr `;`.
264#[derive(Debug, Clone, PartialEq, Eq)]
265pub struct PerformInOutBinding {
266    pub direction: InOut,
267    pub name: String,
268    pub value: Node<Expression>,
269}
270
271/// Attribute usage: `attribute` name (`:>` | `:` type)? `redefines`? value? body.
272#[derive(Debug, Clone, PartialEq, Eq)]
273pub struct AttributeUsage {
274    pub name: String,
275    /// Type after `:` or `:>`, e.g. Some("MassValue").
276    pub typing: Option<String>,
277    /// Subsets target after `:>` / `subsets`.
278    pub subsets: Option<String>,
279    /// Redefines target, e.g. Some("Vehicle::mass").
280    pub redefines: Option<String>,
281    /// References target after `::>` / `references`.
282    pub references: Option<String>,
283    /// Crosses target after `=>` / `crosses`.
284    pub crosses: Option<String>,
285    /// Value expression.
286    pub value: Option<Node<Expression>>,
287    pub body: AttributeBody,
288    /// Span of the usage name (for semantic tokens).
289    pub name_span: Option<Span>,
290    /// Span of the type after `:` / `:>`, if present (for semantic tokens).
291    pub typing_span: Option<Span>,
292    /// Span of the redefines target after `redefines`, if present (for semantic tokens).
293    pub redefines_span: Option<Span>,
294}
295
296// ---------------------------------------------------------------------------
297// Port
298// ---------------------------------------------------------------------------
299
300/// Port definition: `port def` Identification body.
301#[derive(Debug, Clone, PartialEq, Eq)]
302pub struct PortDef {
303    pub identification: Identification,
304    /// Supertype after `:>`, e.g. Some("ClutchPort") for `port def ManualClutchPort :> ClutchPort`.
305    pub specializes: Option<String>,
306    pub specializes_span: Option<Span>,
307    pub body: PortDefBody,
308}
309
310/// Body of a port definition: `;` or `{` PortDefBodyElement* `}`.
311#[derive(Debug, Clone, PartialEq, Eq)]
312pub enum PortDefBody {
313    Semicolon,
314    Brace {
315        elements: Vec<Node<PortDefBodyElement>>,
316    },
317}
318
319/// Element inside a port definition body (in/out declarations or nested port usages).
320#[derive(Debug, Clone, PartialEq, Eq)]
321pub enum PortDefBodyElement {
322    InOutDecl(Node<InOutDecl>),
323    Doc(Node<DocComment>),
324    Error(Node<ParseErrorNode>),
325    AttributeDef(Node<AttributeDef>),
326    AttributeUsage(Node<AttributeUsage>),
327    PortUsage(Node<PortUsage>),
328}
329
330/// Port usage: `port` name `:` type multiplicity? `:>` subsets? `redefines`? body.
331#[derive(Debug, Clone, PartialEq, Eq)]
332pub struct PortUsage {
333    pub name: String,
334    pub type_name: Option<String>,
335    pub multiplicity: Option<String>,
336    /// Subsets feature and optional value expression.
337    pub subsets: Option<(String, Option<Node<Expression>>)>,
338    pub redefines: Option<String>,
339    /// References target after `::>` / `references`.
340    pub references: Option<String>,
341    /// Crosses target after `=>` / `crosses`.
342    pub crosses: Option<String>,
343    pub body: PortBody,
344    /// Span of the usage name (for semantic tokens).
345    pub name_span: Option<Span>,
346    /// Span of the type reference after `:`, if present (for semantic tokens).
347    pub type_ref_span: Option<Span>,
348}
349
350/// Body of a port usage: `;` or `{` PortBodyElement* `}`.
351#[derive(Debug, Clone, PartialEq, Eq)]
352pub enum PortBody {
353    Semicolon,
354    Brace {
355        elements: Vec<Node<PortBodyElement>>,
356    },
357}
358
359/// Element inside a port usage body.
360#[derive(Debug, Clone, PartialEq, Eq)]
361#[allow(clippy::large_enum_variant)]
362pub enum PortBodyElement {
363    Error(Node<ParseErrorNode>),
364    InOutDecl(Node<InOutDecl>),
365    PortUsage(Node<PortUsage>),
366    Other(String),
367}
368
369/// Connect statement in interface def or usage: `connect` from `to` to body.
370#[derive(Debug, Clone, PartialEq, Eq)]
371pub struct ConnectStmt {
372    pub from: Node<Expression>,
373    pub to: Node<Expression>,
374    pub body: ConnectBody,
375}
376
377// ---------------------------------------------------------------------------
378// Interface
379// ---------------------------------------------------------------------------
380
381/// Interface definition: `interface def` Identification body.
382#[derive(Debug, Clone, PartialEq, Eq)]
383pub struct InterfaceDef {
384    pub identification: Identification,
385    pub specializes: Option<String>,
386    pub specializes_span: Option<Span>,
387    pub body: InterfaceDefBody,
388}
389
390/// Body of an interface definition: `;` or `{` InterfaceDefBodyElement* `}`.
391#[derive(Debug, Clone, PartialEq, Eq)]
392pub enum InterfaceDefBody {
393    Semicolon,
394    Brace {
395        elements: Vec<Node<InterfaceDefBodyElement>>,
396    },
397}
398
399/// Element inside an interface definition body.
400#[derive(Debug, Clone, PartialEq, Eq)]
401pub enum InterfaceDefBodyElement {
402    Doc(Node<DocComment>),
403    EndDecl(Node<EndDecl>),
404    RefDecl(Node<RefDecl>),
405    ConnectStmt(Node<ConnectStmt>),
406}
407
408/// End declaration in interface def: `end` name `:` type `;`.
409#[derive(Debug, Clone, PartialEq, Eq)]
410pub struct EndDecl {
411    pub name: String,
412    pub type_name: String,
413    pub uses_derived_syntax: bool,
414    /// Span of the name (for semantic tokens).
415    pub name_span: Option<Span>,
416    /// Span of the type after `:` (for semantic tokens).
417    pub type_ref_span: Option<Span>,
418}
419
420/// Ref declaration in interface def: `ref` name `:` type body.
421#[derive(Debug, Clone, PartialEq, Eq)]
422pub struct RefDecl {
423    pub name: String,
424    pub type_name: String,
425    /// Optional binding value: `= expr` (SysML shorthand binding for references).
426    pub value: Option<Node<Expression>>,
427    pub body: RefBody,
428    /// Span of the name (for semantic tokens).
429    pub name_span: Option<Span>,
430    /// Span of the type after `:` (for semantic tokens).
431    pub type_ref_span: Option<Span>,
432}
433
434/// Body of a ref declaration: `;` or `{` ... `}`.
435#[derive(Debug, Clone, PartialEq, Eq)]
436pub enum RefBody {
437    Semicolon,
438    Brace,
439}
440
441// ---------------------------------------------------------------------------
442// Connection (Phase 2)
443// ---------------------------------------------------------------------------
444
445/// Connection definition: `connection def` Identification body (BNF ConnectionDefinition).
446#[derive(Debug, Clone, PartialEq, Eq)]
447pub struct ConnectionDef {
448    pub annotation: Option<String>,
449    pub identification: Identification,
450    pub specializes: Option<String>,
451    pub specializes_span: Option<Span>,
452    pub body: ConnectionDefBody,
453}
454
455/// Body of a connection definition: `;` or `{` end/ref/connect* `}`.
456#[derive(Debug, Clone, PartialEq, Eq)]
457pub enum ConnectionDefBody {
458    Semicolon,
459    Brace {
460        elements: Vec<Node<ConnectionDefBodyElement>>,
461    },
462}
463
464#[derive(Debug, Clone, PartialEq, Eq)]
465pub enum ConnectionDefBodyElement {
466    EndDecl(Node<EndDecl>),
467    RefDecl(Node<RefDecl>),
468    ConnectStmt(Node<ConnectStmt>),
469}
470
471// ---------------------------------------------------------------------------
472// Metadata (Phase 2)
473// ---------------------------------------------------------------------------
474
475/// Metadata definition: `metadata def` Identification body (BNF MetadataDefinition).
476#[derive(Debug, Clone, PartialEq, Eq)]
477pub struct MetadataDef {
478    pub is_abstract: bool,
479    pub identification: Identification,
480    pub specializes: Option<String>,
481    pub specializes_span: Option<Span>,
482    pub body: AttributeBody,
483}
484
485/// Metadata usage: `metadata` name (`:` type)? body (BNF MetadataUsage).
486#[derive(Debug, Clone, PartialEq, Eq)]
487pub struct MetadataUsage {
488    pub name: String,
489    pub type_name: Option<String>,
490    pub body: AttributeBody,
491}
492
493// ---------------------------------------------------------------------------
494// Enumeration (Phase 2)
495// ---------------------------------------------------------------------------
496
497/// Enumeration definition: `enum def` Identification EnumerationBody (BNF EnumerationDefinition).
498#[derive(Debug, Clone, PartialEq, Eq)]
499pub struct EnumDef {
500    pub identification: Identification,
501    pub specializes: Option<String>,
502    pub specializes_span: Option<Span>,
503    pub body: EnumerationBody,
504}
505
506#[derive(Debug, Clone, PartialEq, Eq)]
507pub enum EnumerationBody {
508    Semicolon,
509    Brace { values: Vec<String> },
510}
511
512// ---------------------------------------------------------------------------
513// Occurrence (Phase 2)
514// ---------------------------------------------------------------------------
515
516/// Occurrence definition: `occurrence def` Identification body (BNF OccurrenceDefinition).
517#[derive(Debug, Clone, PartialEq, Eq)]
518pub struct OccurrenceDef {
519    pub is_abstract: bool,
520    pub identification: Identification,
521    pub specializes: Option<String>,
522    pub specializes_span: Option<Span>,
523    pub body: DefinitionBody,
524}
525
526/// Occurrence usage: `occurrence` name (`:` type)? body, with optional individual/portion modifiers.
527#[derive(Debug, Clone, PartialEq, Eq)]
528pub struct OccurrenceUsage {
529    pub is_individual: bool,
530    pub is_then: bool,
531    pub portion_kind: Option<String>,
532    pub name: String,
533    pub type_name: Option<String>,
534    pub subsets: Option<String>,
535    pub redefines: Option<String>,
536    pub references: Option<String>,
537    pub crosses: Option<String>,
538    pub body: OccurrenceUsageBody,
539}
540
541#[derive(Debug, Clone, PartialEq, Eq)]
542pub enum OccurrenceUsageBody {
543    Semicolon,
544    Brace {
545        elements: Vec<Node<OccurrenceBodyElement>>,
546    },
547}
548
549/// Occurrence-level assert member: `assert constraint` body.
550#[derive(Debug, Clone, PartialEq, Eq)]
551pub struct AssertConstraintMember {
552    pub body: ConstraintDefBody,
553}
554
555#[derive(Debug, Clone, PartialEq, Eq)]
556#[allow(clippy::large_enum_variant)]
557pub enum OccurrenceBodyElement {
558    Error(Node<ParseErrorNode>),
559    Doc(Node<DocComment>),
560    Annotation(Node<Annotation>),
561    AssertConstraint(Node<AssertConstraintMember>),
562    Other(String),
563    AttributeUsage(Node<AttributeUsage>),
564    PartUsage(Box<Node<PartUsage>>),
565    OccurrenceUsage(Box<Node<OccurrenceUsage>>),
566}
567
568// ---------------------------------------------------------------------------
569// Library Package (Phase 2)
570// ---------------------------------------------------------------------------
571
572/// Generic definition body: `;` or `{` DefinitionBodyElement* `}`.
573#[derive(Debug, Clone, PartialEq, Eq)]
574pub enum DefinitionBody {
575    Semicolon,
576    Brace {
577        elements: Vec<Node<DefinitionBodyElement>>,
578    },
579}
580
581#[derive(Debug, Clone, PartialEq, Eq)]
582#[allow(clippy::large_enum_variant)]
583pub enum DefinitionBodyElement {
584    Error(Node<ParseErrorNode>),
585    Doc(Node<DocComment>),
586    OccurrenceMember(Node<OccurrenceBodyElement>),
587    Other(String),
588}
589// ---------------------------------------------------------------------------
590// Part usage body: bind, interface usage, connect
591// ---------------------------------------------------------------------------
592
593/// Bind: `bind` left `=` right (`;` or `{ }`).
594#[derive(Debug, Clone, PartialEq, Eq)]
595pub struct Bind {
596    pub left: Node<Expression>,
597    pub right: Node<Expression>,
598    /// Optional body after the bind (semicolon or brace); 3a fixture uses `bind x = y { }`.
599    pub body: Option<ConnectBody>,
600}
601
602/// Interface usage: typed+connect or connection form.
603#[derive(Debug, Clone, PartialEq, Eq)]
604pub enum InterfaceUsage {
605    /// `interface` `:Type`? `connect` from `to` to body; optional body with ref redefs.
606    TypedConnect {
607        interface_type: Option<String>,
608        from: Node<Expression>,
609        to: Node<Expression>,
610        body: ConnectBody,
611        body_elements: Vec<Node<InterfaceUsageBodyElement>>,
612    },
613    /// `interface` from `to` to body.
614    Connection {
615        from: Node<Expression>,
616        to: Node<Expression>,
617        body_elements: Vec<Node<InterfaceUsageBodyElement>>,
618    },
619}
620
621/// Element in interface usage body (e.g. ref redefinition).
622#[derive(Debug, Clone, PartialEq, Eq)]
623pub enum InterfaceUsageBodyElement {
624    /// `ref` `:>>` name `=` value body.
625    RefRedef {
626        name: String,
627        value: Node<Expression>,
628        body: RefBody,
629    },
630}
631
632/// Connect at part usage level: `connect` from `to` to body.
633#[derive(Debug, Clone, PartialEq, Eq)]
634pub struct Connect {
635    pub from: Node<Expression>,
636    pub to: Node<Expression>,
637    pub body: ConnectBody,
638}
639
640// ---------------------------------------------------------------------------
641// Alias
642// ---------------------------------------------------------------------------
643
644/// Alias definition: `alias` Identification `for` qualified_name body.
645#[derive(Debug, Clone, PartialEq, Eq)]
646pub struct AliasDef {
647    pub identification: Identification,
648    pub target: String,
649    pub body: AliasBody,
650}
651
652/// Body of an alias definition: `;` or `{` ... `}`.
653#[derive(Debug, Clone, PartialEq, Eq)]
654pub enum AliasBody {
655    Semicolon,
656    Brace,
657}