From c896f64f4858239cd045fd1b0d509724d039de8b Mon Sep 17 00:00:00 2001 From: dalance Date: Fri, 19 Jul 2019 17:16:02 +0900 Subject: [PATCH] Extract Keyword from Symbol --- .../assertion_statements.rs | 14 +- .../behavioral_statements/case_statements.rs | 24 ++-- .../behavioral_statements/clocking_block.rs | 30 ++--- .../conditional_statements.rs | 16 +-- ...ous_assignment_and_net_alias_statements.rs | 6 +- .../looping_statements.rs | 16 +-- .../parallel_and_sequential_blocks.rs | 14 +- src/parser/behavioral_statements/patterns.rs | 4 +- .../procedural_blocks_and_assignments.rs | 24 ++-- .../behavioral_statements/randsequence.rs | 20 +-- .../subroutine_call_statements.rs | 2 +- .../timing_control_statements.rs | 26 ++-- .../declarations/assertion_declarations.rs | 123 ++++++++++-------- .../declarations/covergroup_declarations.rs | 70 +++++----- .../declarations/declaration_assignments.rs | 6 +- src/parser/declarations/delays.rs | 2 +- .../declarations/function_declarations.rs | 30 ++--- .../declarations/interface_declarations.rs | 8 +- src/parser/declarations/let_declarations.rs | 4 +- .../module_parameter_declarations.rs | 10 +- .../declarations/net_and_variable_types.rs | 86 ++++++------ src/parser/declarations/port_declarations.rs | 12 +- src/parser/declarations/strengths.rs | 30 ++--- src/parser/declarations/task_declarations.rs | 10 +- src/parser/declarations/type_declarations.rs | 42 +++--- src/parser/expressions/concatenations.rs | 2 +- src/parser/expressions/expressions.rs | 4 +- src/parser/expressions/primaries.rs | 28 ++-- src/parser/expressions/subroutine_calls.rs | 18 +-- src/parser/general/identifiers.rs | 6 +- .../instantiations/generated_instantiation.rs | 20 +-- .../primitive_gate_and_switch_types.rs | 62 ++++----- .../primitive_instantiation_and_instances.rs | 8 +- src/parser/source_text/checker_items.rs | 14 +- src/parser/source_text/class_items.rs | 40 +++--- .../source_text/configuration_source_text.rs | 22 ++-- src/parser/source_text/constraints.rs | 28 ++-- src/parser/source_text/interface_items.rs | 4 +- src/parser/source_text/library_source_text.rs | 6 +- src/parser/source_text/module_items.rs | 22 ++-- .../module_parameters_and_ports.rs | 12 +- src/parser/source_text/package_items.rs | 4 +- .../source_text/system_verilog_source_text.rs | 86 ++++++------ .../specify_block_declaration.rs | 6 +- .../specify_section/specify_path_delays.rs | 12 +- .../system_timing_check_commands.rs | 24 ++-- .../system_timing_check_event_definitions.rs | 12 +- .../udp_body.rs | 18 +-- .../udp_declaration.rs | 16 +-- .../udp_ports.rs | 10 +- src/parser/utils.rs | 9 +- 51 files changed, 568 insertions(+), 554 deletions(-) diff --git a/src/parser/behavioral_statements/assertion_statements.rs b/src/parser/behavioral_statements/assertion_statements.rs index 66dc306..1882c94 100644 --- a/src/parser/behavioral_statements/assertion_statements.rs +++ b/src/parser/behavioral_statements/assertion_statements.rs @@ -43,17 +43,17 @@ pub enum SimpleImmediateAssertionStatement<'a> { #[derive(Debug, Node)] pub struct SimpleImmediateAssertStatement<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), } #[derive(Debug, Node)] pub struct SimpleImmediateAssumeStatement<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), } #[derive(Debug, Node)] pub struct SimpleImmediateCoverStatement<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), } #[derive(Debug, Node)] @@ -66,7 +66,7 @@ pub enum DeferredImmediateAssertionStatement<'a> { #[derive(Debug, Node)] pub struct DeferredImmediateAssertStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, AssertTiming<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>, @@ -76,7 +76,7 @@ pub struct DeferredImmediateAssertStatement<'a> { #[derive(Debug, Node)] pub struct DeferredImmediateAssumeStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, AssertTiming<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>, @@ -86,7 +86,7 @@ pub struct DeferredImmediateAssumeStatement<'a> { #[derive(Debug, Node)] pub struct DeferredImmediateCoverStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, AssertTiming<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>, @@ -96,7 +96,7 @@ pub struct DeferredImmediateCoverStatement<'a> { #[derive(Debug, Node)] pub enum AssertTiming<'a> { Zero(Symbol<'a>), - Final(Symbol<'a>), + Final(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/case_statements.rs b/src/parser/behavioral_statements/case_statements.rs index 2c0ed17..b189e5e 100644 --- a/src/parser/behavioral_statements/case_statements.rs +++ b/src/parser/behavioral_statements/case_statements.rs @@ -23,7 +23,7 @@ pub struct CaseStatementNormal<'a> { Paren<'a, CaseExpression<'a>>, CaseItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -33,10 +33,10 @@ pub struct CaseStatementMatches<'a> { Option>, CaseKeyword<'a>, Paren<'a, CaseExpression<'a>>, - Symbol<'a>, + Keyword<'a>, CasePatternItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -44,20 +44,20 @@ pub struct CaseStatementMatches<'a> { pub struct CaseStatementInside<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, Paren<'a, CaseExpression<'a>>, - Symbol<'a>, + Keyword<'a>, CaseInsideItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } #[derive(Debug, Node)] pub enum CaseKeyword<'a> { - Case(Symbol<'a>), - Casez(Symbol<'a>), - Casex(Symbol<'a>), + Case(Keyword<'a>), + Casez(Keyword<'a>), + Casex(Keyword<'a>), } #[derive(Debug, Node)] @@ -82,7 +82,7 @@ pub struct CaseItemNondefault<'a> { #[derive(Debug, Node)] pub struct CaseItemDefault<'a> { - pub nodes: (Symbol<'a>, Option>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, Option>, StatementOrNull<'a>), } #[derive(Debug, Node)] @@ -120,10 +120,10 @@ pub struct CaseItemExpression<'a> { #[derive(Debug, Node)] pub struct RandcaseStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, RandcaseItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } diff --git a/src/parser/behavioral_statements/clocking_block.rs b/src/parser/behavioral_statements/clocking_block.rs index 0eda4f1..d7d2e9c 100644 --- a/src/parser/behavioral_statements/clocking_block.rs +++ b/src/parser/behavioral_statements/clocking_block.rs @@ -18,30 +18,30 @@ pub enum ClockingDeclaration<'a> { pub struct ClockingDeclarationLocal<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, Option>, ClockingEvent<'a>, Symbol<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ClockingIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct Default<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct ClockingDeclarationGlobal<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Option>, ClockingEvent<'a>, Symbol<'a>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ClockingIdentifier<'a>)>, ), } @@ -71,7 +71,7 @@ pub enum ClockingItem<'a> { #[derive(Debug, Node)] pub struct ClockingItemDefault<'a> { - pub nodes: (Symbol<'a>, DefaultSkew<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, DefaultSkew<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -97,17 +97,17 @@ pub enum DefaultSkew<'a> { #[derive(Debug, Node)] pub struct DefaultSkewInput<'a> { - pub nodes: (Symbol<'a>, ClockingSkew<'a>), + pub nodes: (Keyword<'a>, ClockingSkew<'a>), } #[derive(Debug, Node)] pub struct DefaultSkewOutput<'a> { - pub nodes: (Symbol<'a>, ClockingSkew<'a>), + pub nodes: (Keyword<'a>, ClockingSkew<'a>), } #[derive(Debug, Node)] pub struct DefaultSkewInputOutput<'a> { - pub nodes: (Symbol<'a>, ClockingSkew<'a>, Symbol<'a>, ClockingSkew<'a>), + pub nodes: (Keyword<'a>, ClockingSkew<'a>, Keyword<'a>, ClockingSkew<'a>), } #[derive(Debug, Node)] @@ -115,25 +115,25 @@ pub enum ClockingDirection<'a> { Input(ClockingDirectionInput<'a>), Output(ClockingDirectionOutput<'a>), InputOutput(ClockingDirectionInputOutput<'a>), - Inout(Symbol<'a>), + Inout(Keyword<'a>), } #[derive(Debug, Node)] pub struct ClockingDirectionInput<'a> { - pub nodes: (Symbol<'a>, Option>), + pub nodes: (Keyword<'a>, Option>), } #[derive(Debug, Node)] pub struct ClockingDirectionOutput<'a> { - pub nodes: (Symbol<'a>, Option>), + pub nodes: (Keyword<'a>, Option>), } #[derive(Debug, Node)] pub struct ClockingDirectionInputOutput<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, - Symbol<'a>, + Keyword<'a>, Option>, ), } diff --git a/src/parser/behavioral_statements/conditional_statements.rs b/src/parser/behavioral_statements/conditional_statements.rs index ee016e6..6264072 100644 --- a/src/parser/behavioral_statements/conditional_statements.rs +++ b/src/parser/behavioral_statements/conditional_statements.rs @@ -12,24 +12,24 @@ use nom::IResult; pub struct ConditionalStatement<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, Paren<'a, CondPredicate<'a>>, StatementOrNull<'a>, Vec<( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, CondPredicate<'a>>, StatementOrNull<'a>, )>, - Option<(Symbol<'a>, StatementOrNull<'a>)>, + Option<(Keyword<'a>, StatementOrNull<'a>)>, ), } #[derive(Debug, Node)] pub enum UniquePriority<'a> { - Unique(Symbol<'a>), - Unique0(Symbol<'a>), - Priority(Symbol<'a>), + Unique(Keyword<'a>), + Unique0(Keyword<'a>), + Priority(Keyword<'a>), } #[derive(Debug, Node)] @@ -45,7 +45,7 @@ pub enum ExpressionOrCondPattern<'a> { #[derive(Debug, Node)] pub struct CondPattern<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, Pattern<'a>), + pub nodes: (Expression<'a>, Keyword<'a>, Pattern<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs b/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs index 09d8a6a..ad4105c 100644 --- a/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs +++ b/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs @@ -15,7 +15,7 @@ pub enum ContinuousAssign<'a> { #[derive(Debug, Node)] pub struct ContinuousAssignNet<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, Option>, ListOfNetAssignments<'a>, @@ -26,7 +26,7 @@ pub struct ContinuousAssignNet<'a> { #[derive(Debug, Node)] pub struct ContinuousAssignVariable<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfVariableAssignments<'a>, Symbol<'a>, @@ -46,7 +46,7 @@ pub struct ListOfVariableAssignments<'a> { #[derive(Debug, Node)] pub struct NetAlias<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, NetLvalue<'a>, Symbol<'a>, List, NetLvalue<'a>>, diff --git a/src/parser/behavioral_statements/looping_statements.rs b/src/parser/behavioral_statements/looping_statements.rs index da11dca..3ce7493 100644 --- a/src/parser/behavioral_statements/looping_statements.rs +++ b/src/parser/behavioral_statements/looping_statements.rs @@ -19,23 +19,23 @@ pub enum LoopStatement<'a> { #[derive(Debug, Node)] pub struct LoopStatementForever<'a> { - pub nodes: (Symbol<'a>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, StatementOrNull<'a>), } #[derive(Debug, Node)] pub struct LoopStatementRepeat<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), } #[derive(Debug, Node)] pub struct LoopStatementWhile<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), } #[derive(Debug, Node)] pub struct LoopStatementFor<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -53,9 +53,9 @@ pub struct LoopStatementFor<'a> { #[derive(Debug, Node)] pub struct LoopStatementDoWhile<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, StatementOrNull<'a>, - Symbol<'a>, + Keyword<'a>, Paren<'a, Expression<'a>>, Symbol<'a>, ), @@ -64,7 +64,7 @@ pub struct LoopStatementDoWhile<'a> { #[derive(Debug, Node)] pub struct LoopStatementForeach<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -98,7 +98,7 @@ pub struct ForVariableDeclaration<'a> { #[derive(Debug, Node)] pub struct Var<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] diff --git a/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs b/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs index 450a20e..34adc0b 100644 --- a/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs +++ b/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs @@ -16,17 +16,17 @@ pub enum ActionBlock<'a> { #[derive(Debug, Node)] pub struct ActionBlockElse<'a> { - pub nodes: (Option>, Symbol<'a>, StatementOrNull<'a>), + pub nodes: (Option>, Keyword<'a>, StatementOrNull<'a>), } #[derive(Debug, Node)] pub struct SeqBlock<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, BlockIdentifier<'a>)>, Vec>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, BlockIdentifier<'a>)>, ), } @@ -34,7 +34,7 @@ pub struct SeqBlock<'a> { #[derive(Debug, Node)] pub struct ParBlock<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, BlockIdentifier<'a>)>, Vec>, Vec>, @@ -45,9 +45,9 @@ pub struct ParBlock<'a> { #[derive(Debug, Node)] pub enum JoinKeyword<'a> { - Join(Symbol<'a>), - JoinAny(Symbol<'a>), - JoinNone(Symbol<'a>), + Join(Keyword<'a>), + JoinAny(Keyword<'a>), + JoinNone(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/patterns.rs b/src/parser/behavioral_statements/patterns.rs index 67917d3..386eb31 100644 --- a/src/parser/behavioral_statements/patterns.rs +++ b/src/parser/behavioral_statements/patterns.rs @@ -24,7 +24,7 @@ pub struct PatternVariable<'a> { #[derive(Debug, Node)] pub struct PatternTagged<'a> { - pub nodes: (Symbol<'a>, MemberIdentifier<'a>, Option>), + pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option>), } #[derive(Debug, Node)] @@ -96,7 +96,7 @@ pub enum ArrayPatternKey<'a> { #[derive(Debug, Node)] pub enum AssignmentPatternKey<'a> { SimpleType(SimpleType<'a>), - Default(Symbol<'a>), + Default(Keyword<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs b/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs index 0ed73a9..507ef96 100644 --- a/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs +++ b/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs @@ -8,7 +8,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct InitialConstruct<'a> { - pub nodes: (Symbol<'a>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, StatementOrNull<'a>), } #[derive(Debug, Node)] @@ -18,15 +18,15 @@ pub struct AlwaysConstruct<'a> { #[derive(Debug, Node)] pub enum AlwaysKeyword<'a> { - Always(Symbol<'a>), - AlwaysComb(Symbol<'a>), - AlwaysLatch(Symbol<'a>), - AlwaysFf(Symbol<'a>), + Always(Keyword<'a>), + AlwaysComb(Keyword<'a>), + AlwaysLatch(Keyword<'a>), + AlwaysFf(Keyword<'a>), } #[derive(Debug, Node)] pub struct FinalConstruct<'a> { - pub nodes: (Symbol<'a>, FunctionStatement<'a>), + pub nodes: (Keyword<'a>, FunctionStatement<'a>), } #[derive(Debug, Node)] @@ -95,32 +95,32 @@ pub enum ProceduralContinuousAssignment<'a> { #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentAssign<'a> { - pub nodes: (Symbol<'a>, VariableAssignment<'a>), + pub nodes: (Keyword<'a>, VariableAssignment<'a>), } #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentDeassign<'a> { - pub nodes: (Symbol<'a>, VariableLvalue<'a>), + pub nodes: (Keyword<'a>, VariableLvalue<'a>), } #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentForceVariable<'a> { - pub nodes: (Symbol<'a>, VariableAssignment<'a>), + pub nodes: (Keyword<'a>, VariableAssignment<'a>), } #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentForceNet<'a> { - pub nodes: (Symbol<'a>, NetAssignment<'a>), + pub nodes: (Keyword<'a>, NetAssignment<'a>), } #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentReleaseVariable<'a> { - pub nodes: (Symbol<'a>, VariableLvalue<'a>), + pub nodes: (Keyword<'a>, VariableLvalue<'a>), } #[derive(Debug, Node)] pub struct ProceduralContinuousAssignmentReleaseNet<'a> { - pub nodes: (Symbol<'a>, NetLvalue<'a>), + pub nodes: (Keyword<'a>, NetLvalue<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/behavioral_statements/randsequence.rs b/src/parser/behavioral_statements/randsequence.rs index 4652e54..0fad411 100644 --- a/src/parser/behavioral_statements/randsequence.rs +++ b/src/parser/behavioral_statements/randsequence.rs @@ -11,11 +11,11 @@ use nom::IResult; #[derive(Debug, Node)] pub struct RandsequenceStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, Option>>, Production<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -53,8 +53,8 @@ pub struct RsProductionListProd<'a> { #[derive(Debug, Node)] pub struct RsProductionListJoin<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Option>>, ProductionItem<'a>, ProductionItem<'a>, @@ -99,26 +99,26 @@ pub struct ProductionItem<'a> { #[derive(Debug, Node)] pub struct RsIfElse<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>, - Option<(Symbol<'a>, ProductionItem<'a>)>, + Option<(Keyword<'a>, ProductionItem<'a>)>, ), } #[derive(Debug, Node)] pub struct RsRepeat<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>), } #[derive(Debug, Node)] pub struct RsCase<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, CaseExpression<'a>>, RsCaseItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -141,7 +141,7 @@ pub struct RsCaseItemNondefault<'a> { #[derive(Debug, Node)] pub struct RsCaseItemDefault<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ProductionItem<'a>, Symbol<'a>, diff --git a/src/parser/behavioral_statements/subroutine_call_statements.rs b/src/parser/behavioral_statements/subroutine_call_statements.rs index 9d0fc16..fa2dc46 100644 --- a/src/parser/behavioral_statements/subroutine_call_statements.rs +++ b/src/parser/behavioral_statements/subroutine_call_statements.rs @@ -16,7 +16,7 @@ pub enum SubroutineCallStatement<'a> { #[derive(Debug, Node)] pub struct SubroutineCallStatementFunction<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Symbol<'a>, Paren<'a, FunctionSubroutineCall<'a>>, Symbol<'a>, diff --git a/src/parser/behavioral_statements/timing_control_statements.rs b/src/parser/behavioral_statements/timing_control_statements.rs index 74b1f77..ccc08d3 100644 --- a/src/parser/behavioral_statements/timing_control_statements.rs +++ b/src/parser/behavioral_statements/timing_control_statements.rs @@ -21,7 +21,7 @@ pub enum DelayOrEventControl<'a> { #[derive(Debug, Node)] pub struct DelayOrEventControlRepeat<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, EventControl<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, EventControl<'a>), } #[derive(Debug, Node)] @@ -88,18 +88,18 @@ pub struct EventExpressionExpression<'a> { pub nodes: ( Option>, Expression<'a>, - Option<(Symbol<'a>, Expression<'a>)>, + Option<(Keyword<'a>, Expression<'a>)>, ), } #[derive(Debug, Node)] pub struct EventExpressionSequence<'a> { - pub nodes: (SequenceInstance<'a>, Option<(Symbol<'a>, Expression<'a>)>), + pub nodes: (SequenceInstance<'a>, Option<(Keyword<'a>, Expression<'a>)>), } #[derive(Debug, Node)] pub struct EventExpressionOr<'a> { - pub nodes: (EventExpression<'a>, Symbol<'a>, EventExpression<'a>), + pub nodes: (EventExpression<'a>, Keyword<'a>, EventExpression<'a>), } #[derive(Debug, Node)] @@ -128,17 +128,17 @@ pub enum JumpStatement<'a> { #[derive(Debug, Node)] pub struct JumpStatementReturn<'a> { - pub nodes: (Symbol<'a>, Option>, Symbol<'a>), + pub nodes: (Keyword<'a>, Option>, Symbol<'a>), } #[derive(Debug, Node)] pub struct JumpStatementBreak<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct JumpStatementContinue<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -150,18 +150,18 @@ pub enum WaitStatement<'a> { #[derive(Debug, Node)] pub struct WaitStatementWait<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), } #[derive(Debug, Node)] pub struct WaitStatementFork<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct WaitStatementOrder<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, List, HierarchicalIdentifier<'a>>>, ActionBlock<'a>, ), @@ -197,17 +197,17 @@ pub enum DisableStatement<'a> { #[derive(Debug, Node)] pub struct DisableStatementTask<'a> { - pub nodes: (Symbol<'a>, HierarchicalTaskIdentifier<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, HierarchicalTaskIdentifier<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct DisableStatementBlock<'a> { - pub nodes: (Symbol<'a>, HierarchicalBlockIdentifier<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, HierarchicalBlockIdentifier<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct DisableStatementFork<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/assertion_declarations.rs b/src/parser/declarations/assertion_declarations.rs index c89bee5..1a42a54 100644 --- a/src/parser/declarations/assertion_declarations.rs +++ b/src/parser/declarations/assertion_declarations.rs @@ -34,8 +34,8 @@ pub enum ConcurrentAssertionStatement<'a> { #[derive(Debug, Node)] pub struct AssertPropertyStatement<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, PropertySpec<'a>>, ActionBlock<'a>, ), @@ -44,8 +44,8 @@ pub struct AssertPropertyStatement<'a> { #[derive(Debug, Node)] pub struct AssumePropertyStatement<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, PropertySpec<'a>>, ActionBlock<'a>, ), @@ -54,8 +54,8 @@ pub struct AssumePropertyStatement<'a> { #[derive(Debug, Node)] pub struct CoverPropertyStatement<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, PropertySpec<'a>>, StatementOrNull<'a>, ), @@ -63,19 +63,19 @@ pub struct CoverPropertyStatement<'a> { #[derive(Debug, Node)] pub struct ExpectPropertyStatement<'a> { - pub nodes: (Symbol<'a>, Paren<'a, PropertySpec<'a>>, ActionBlock<'a>), + pub nodes: (Keyword<'a>, Paren<'a, PropertySpec<'a>>, ActionBlock<'a>), } #[derive(Debug, Node)] pub struct CoverSequenceStatement<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren< 'a, ( Option>, - Option<(Symbol<'a>, Symbol<'a>, Paren<'a, ExpressionOrDist<'a>>)>, + Option<(Keyword<'a>, Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>)>, SequenceExpr<'a>, ), >, @@ -86,8 +86,8 @@ pub struct CoverSequenceStatement<'a> { #[derive(Debug, Node)] pub struct RestrictPropertyStatement<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, PropertySpec<'a>>, Symbol<'a>, ), @@ -150,14 +150,14 @@ pub enum AssertionItemDeclaration<'a> { #[derive(Debug, Node)] pub struct PropertyDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, PropertyIdentifier<'a>, Option>>>, Symbol<'a>, Vec>, PropertySpec<'a>, Option>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, PropertyIdentifier<'a>)>, ), } @@ -181,20 +181,20 @@ pub struct PropertyPortItem<'a> { #[derive(Debug, Node)] pub enum PropertyLvarPortDirection<'a> { - Input(Symbol<'a>), + Input(Keyword<'a>), } #[derive(Debug, Node)] pub enum PropertyFormalType<'a> { SequenceFormalType(SequenceFormalType<'a>), - Property(Symbol<'a>), + Property(Keyword<'a>), } #[derive(Debug, Node)] pub struct PropertySpec<'a> { pub nodes: ( Option>, - Option<(Symbol<'a>, Symbol<'a>, Paren<'a, ExpressionOrDist<'a>>)>, + Option<(Keyword<'a>, Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>)>, PropertyExpr<'a>, ), } @@ -236,12 +236,12 @@ pub enum PropertyExpr<'a> { #[derive(Debug, Node)] pub struct PropertyExprStrong<'a> { - pub nodes: (Symbol<'a>, Paren<'a, SequenceExpr<'a>>), + pub nodes: (Keyword<'a>, Paren<'a, SequenceExpr<'a>>), } #[derive(Debug, Node)] pub struct PropertyExprWeak<'a> { - pub nodes: (Symbol<'a>, Paren<'a, SequenceExpr<'a>>), + pub nodes: (Keyword<'a>, Paren<'a, SequenceExpr<'a>>), } #[derive(Debug, Node)] @@ -251,17 +251,17 @@ pub struct PropertyExprParen<'a> { #[derive(Debug, Node)] pub struct PropertyExprNot<'a> { - pub nodes: (Symbol<'a>, PropertyExpr<'a>), + pub nodes: (Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprOr<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprAnd<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] @@ -277,21 +277,21 @@ pub struct PropertyExprImplicationNonoverlapped<'a> { #[derive(Debug, Node)] pub struct PropertyExprIf<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyExpr<'a>, - Option<(Symbol<'a>, PropertyExpr<'a>)>, + Option<(Keyword<'a>, PropertyExpr<'a>)>, ), } #[derive(Debug, Node)] pub struct PropertyExprCase<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyCaseItem<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -308,7 +308,7 @@ pub struct PropertyExprFollowedByNonoverlapped<'a> { #[derive(Debug, Node)] pub struct PropertyExprNexttime<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>, PropertyExpr<'a>, ), @@ -317,7 +317,7 @@ pub struct PropertyExprNexttime<'a> { #[derive(Debug, Node)] pub struct PropertyExprSNexttime<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>, PropertyExpr<'a>, ), @@ -326,7 +326,7 @@ pub struct PropertyExprSNexttime<'a> { #[derive(Debug, Node)] pub struct PropertyExprAlways<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>, PropertyExpr<'a>, ), @@ -335,7 +335,7 @@ pub struct PropertyExprAlways<'a> { #[derive(Debug, Node)] pub struct PropertyExprSAlways<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Bracket<'a, CycleDelayConstRangeExpression<'a>>, PropertyExpr<'a>, ), @@ -343,13 +343,17 @@ pub struct PropertyExprSAlways<'a> { #[derive(Debug, Node)] pub struct PropertyExprEventually<'a> { - pub nodes: (Symbol<'a>, Bracket<'a, ConstantRange<'a>>, PropertyExpr<'a>), + pub nodes: ( + Keyword<'a>, + Bracket<'a, ConstantRange<'a>>, + PropertyExpr<'a>, + ), } #[derive(Debug, Node)] pub struct PropertyExprSEventually<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>, PropertyExpr<'a>, ), @@ -357,38 +361,38 @@ pub struct PropertyExprSEventually<'a> { #[derive(Debug, Node)] pub struct PropertyExprUntil<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprSUntil<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprUntilWith<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprSUntilWith<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprImplies<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprIff<'a> { - pub nodes: (PropertyExpr<'a>, Symbol<'a>, PropertyExpr<'a>), + pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), } #[derive(Debug, Node)] pub struct PropertyExprAcceptOn<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyExpr<'a>, ), @@ -397,7 +401,7 @@ pub struct PropertyExprAcceptOn<'a> { #[derive(Debug, Node)] pub struct PropertyExprRejectOn<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyExpr<'a>, ), @@ -406,7 +410,7 @@ pub struct PropertyExprRejectOn<'a> { #[derive(Debug, Node)] pub struct PropertyExprSyncAcceptOn<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyExpr<'a>, ), @@ -415,7 +419,7 @@ pub struct PropertyExprSyncAcceptOn<'a> { #[derive(Debug, Node)] pub struct PropertyExprSyncRejectOn<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>, PropertyExpr<'a>, ), @@ -444,20 +448,25 @@ pub struct PropertyCaseItemNondefault<'a> { #[derive(Debug, Node)] pub struct PropertyCaseItemDefault<'a> { - pub nodes: (Symbol<'a>, Option>, PropertyExpr<'a>, Symbol<'a>), + pub nodes: ( + Keyword<'a>, + Option>, + PropertyExpr<'a>, + Symbol<'a>, + ), } #[derive(Debug, Node)] pub struct SequenceDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, SequenceIdentifier<'a>, Option>>>, Symbol<'a>, Vec>, SequenceExpr<'a>, Option>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, SequenceIdentifier<'a>)>, ), } @@ -481,16 +490,16 @@ pub struct SequencePortItem<'a> { #[derive(Debug, Node)] pub enum SequenceLvarPortDirection<'a> { - Input(Symbol<'a>), - Inout(Symbol<'a>), - Output(Symbol<'a>), + Input(Keyword<'a>), + Inout(Keyword<'a>), + Output(Keyword<'a>), } #[derive(Debug, Node)] pub enum SequenceFormalType<'a> { DataTypeOrImplicit(DataTypeOrImplicit<'a>), - Sequence(Symbol<'a>), - Untyped(Symbol<'a>), + Sequence(Keyword<'a>), + Untyped(Keyword<'a>), } #[derive(Debug, Node)] @@ -548,35 +557,35 @@ pub struct SequenceExprParen<'a> { #[derive(Debug, Node)] pub struct SequenceExprAnd<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, SequenceExpr<'a>), + pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), } #[derive(Debug, Node)] pub struct SequenceExprIntersect<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, SequenceExpr<'a>), + pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), } #[derive(Debug, Node)] pub struct SequenceExprOr<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, SequenceExpr<'a>), + pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), } #[derive(Debug, Node)] pub struct SequenceExprFirstMatch<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, (SequenceExpr<'a>, Vec<(Symbol<'a>, SequenceMatchItem<'a>)>)>, ), } #[derive(Debug, Node)] pub struct SequenceExprThroughout<'a> { - pub nodes: (ExpressionOrDist<'a>, Symbol<'a>, SequenceExpr<'a>), + pub nodes: (ExpressionOrDist<'a>, Keyword<'a>, SequenceExpr<'a>), } #[derive(Debug, Node)] pub struct SequenceExprWithin<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, SequenceExpr<'a>), + pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), } #[derive(Debug, Node)] @@ -741,7 +750,7 @@ pub struct CycleDelayConstRangeExpressionDollar<'a> { pub struct ExpressionOrDist<'a> { pub nodes: ( Expression<'a>, - Option<(Symbol<'a>, Brace<'a, DistList<'a>>)>, + Option<(Keyword<'a>, Brace<'a, DistList<'a>>)>, ), } diff --git a/src/parser/declarations/covergroup_declarations.rs b/src/parser/declarations/covergroup_declarations.rs index 19c57c3..c38d9fc 100644 --- a/src/parser/declarations/covergroup_declarations.rs +++ b/src/parser/declarations/covergroup_declarations.rs @@ -11,13 +11,13 @@ use nom::IResult; #[derive(Debug, Node)] pub struct CovergroupDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, CovergroupIdentifier<'a>, Option>>>, Option>, Symbol<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, CovergroupIdentifier<'a>)>, ), } @@ -47,7 +47,7 @@ pub enum CoverageOption<'a> { #[derive(Debug, Node)] pub struct CoverageOptionOption<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Symbol<'a>, MemberIdentifier<'a>, Symbol<'a>, @@ -58,7 +58,7 @@ pub struct CoverageOptionOption<'a> { #[derive(Debug, Node)] pub struct CoverageOptionTypeOption<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Symbol<'a>, MemberIdentifier<'a>, Symbol<'a>, @@ -82,9 +82,9 @@ pub enum CoverageEvent<'a> { #[derive(Debug, Node)] pub struct CoverageEventSample<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, + Keyword<'a>, Paren<'a, Option>>, ), } @@ -105,19 +105,19 @@ pub enum BlockEventExpression<'a> { pub struct BlockEventExpressionOr<'a> { pub nodes: ( BlockEventExpression<'a>, - Symbol<'a>, + Keyword<'a>, BlockEventExpression<'a>, ), } #[derive(Debug, Node)] pub struct BlockEventExpressionBegin<'a> { - pub nodes: (Symbol<'a>, HierarchicalBtfIdentifier<'a>), + pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>), } #[derive(Debug, Node)] pub struct BlockEventExpressionEnd<'a> { - pub nodes: (Symbol<'a>, HierarchicalBtfIdentifier<'a>), + pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>), } #[derive(Debug, Node)] @@ -149,9 +149,9 @@ pub struct CoverPoint<'a> { CoverPointIdentifier<'a>, Symbol<'a>, )>, - Symbol<'a>, + Keyword<'a>, Expression<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, BinsOrEmpty<'a>, ), } @@ -195,14 +195,14 @@ pub struct BinsOrOptionsCovergroup<'a> { Option>>>, Symbol<'a>, Brace<'a, CovergroupRangeList<'a>>, - Option<(Symbol<'a>, Paren<'a, WithCovergroupExpression<'a>>)>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, WithCovergroupExpression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } #[derive(Debug, Node)] pub struct Wildcard<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -214,9 +214,9 @@ pub struct BinsOrOptionsCoverPoint<'a> { Option>>>, Symbol<'a>, CoverPointIdentifier<'a>, - Symbol<'a>, + Keyword<'a>, Paren<'a, WithCovergroupExpression<'a>>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } @@ -229,7 +229,7 @@ pub struct BinsOrOptionsSetCovergroup<'a> { Option>>>, Symbol<'a>, SetCovergroupExpression<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } @@ -242,7 +242,7 @@ pub struct BinsOrOptionsTransList<'a> { Option<(Symbol<'a>, Symbol<'a>)>, Symbol<'a>, TransList<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } @@ -253,8 +253,8 @@ pub struct BinsOrOptionsDefault<'a> { BinIdentifier<'a>, Option>>>, Symbol<'a>, - Symbol<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Keyword<'a>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } @@ -264,17 +264,17 @@ pub struct BinsOrOptionsDefaultSequence<'a> { BinsKeyword<'a>, BinIdentifier<'a>, Symbol<'a>, - Symbol<'a>, - Symbol<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Keyword<'a>, + Keyword<'a>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } #[derive(Debug, Node)] pub enum BinsKeyword<'a> { - Bins(Symbol<'a>), - IllegalBins(Symbol<'a>), - IgnoreBins(Symbol<'a>), + Bins(Keyword<'a>), + IllegalBins(Keyword<'a>), + IgnoreBins(Keyword<'a>), } #[derive(Debug, Node)] @@ -334,9 +334,9 @@ pub struct RepeatRangeBinary<'a> { pub struct CoverCross<'a> { pub nodes: ( Option<(CrossIdentifier<'a>, Symbol<'a>)>, - Symbol<'a>, + Keyword<'a>, ListOfCrossItems<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, CrossBody<'a>, ), } @@ -392,7 +392,7 @@ pub struct BinsSelection<'a> { BinIdentifier<'a>, Symbol<'a>, SelectExpression<'a>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } @@ -432,9 +432,9 @@ pub struct SelectExpressionParen<'a> { pub struct SelectExpressionWith<'a> { pub nodes: ( SelectExpression<'a>, - Symbol<'a>, + Keyword<'a>, Paren<'a, WithCovergroupExpression<'a>>, - Option<(Symbol<'a>, IntegerCovergroupExpression<'a>)>, + Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>, ), } @@ -442,16 +442,16 @@ pub struct SelectExpressionWith<'a> { pub struct SelectExpressionCrossSet<'a> { pub nodes: ( CrossSetExpression<'a>, - Option<(Symbol<'a>, IntegerCovergroupExpression<'a>)>, + Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>, ), } #[derive(Debug, Node)] pub struct SelectCondition<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, BinsExpression<'a>>, - Option<(Symbol<'a>, Brace<'a, CovergroupRangeList<'a>>)>, + Option<(Keyword<'a>, Brace<'a, CovergroupRangeList<'a>>)>, ), } diff --git a/src/parser/declarations/declaration_assignments.rs b/src/parser/declarations/declaration_assignments.rs index 1e1f8d2..62d0811 100644 --- a/src/parser/declarations/declaration_assignments.rs +++ b/src/parser/declarations/declaration_assignments.rs @@ -153,20 +153,20 @@ pub enum ClassNew<'a> { pub struct ClassNewArgument<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, Option>>, ), } #[derive(Debug, Node)] pub struct ClassNewExpression<'a> { - pub nodes: (Symbol<'a>, Expression<'a>), + pub nodes: (Keyword<'a>, Expression<'a>), } #[derive(Debug, Node)] pub struct DynamicArrayNew<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Bracket<'a, Expression<'a>>, Option>>, ), diff --git a/src/parser/declarations/delays.rs b/src/parser/declarations/delays.rs index 7ea717d..d819027 100644 --- a/src/parser/declarations/delays.rs +++ b/src/parser/declarations/delays.rs @@ -67,7 +67,7 @@ pub enum DelayValue<'a> { RealNumber(RealNumber<'a>), PsIdentifier(PsIdentifier<'a>), TimeLiteral(TimeLiteral<'a>), - Step1(Symbol<'a>), + Step1(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/function_declarations.rs b/src/parser/declarations/function_declarations.rs index a5dc58f..f4db4c6 100644 --- a/src/parser/declarations/function_declarations.rs +++ b/src/parser/declarations/function_declarations.rs @@ -17,7 +17,7 @@ pub enum FunctionDataTypeOrImplicit<'a> { #[derive(Debug, Node)] pub struct FunctionDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, FunctionBodyDeclaration<'a>, ), @@ -38,7 +38,7 @@ pub struct FunctionBodyDeclarationWithoutPort<'a> { Symbol<'a>, Vec>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, FunctionIdentifier<'a>)>, ), } @@ -53,7 +53,7 @@ pub struct FunctionBodyDeclarationWithPort<'a> { Symbol<'a>, Vec>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, FunctionIdentifier<'a>)>, ), } @@ -67,7 +67,7 @@ pub enum InterfaceIdentifierOrClassScope<'a> { #[derive(Debug, Node)] pub struct FunctionPrototype<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DataTypeOrVoid<'a>, FunctionIdentifier<'a>, Option>>>, @@ -85,7 +85,7 @@ pub enum DpiImportExport<'a> { #[derive(Debug, Node)] pub struct DpiImportExportImportFunction<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DpiSpecString<'a>, Option>, Option<(CIdentifier<'a>, Symbol<'a>)>, @@ -97,7 +97,7 @@ pub struct DpiImportExportImportFunction<'a> { #[derive(Debug, Node)] pub struct DpiImportExportImportTask<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DpiSpecString<'a>, Option>, Option<(CIdentifier<'a>, Symbol<'a>)>, @@ -109,10 +109,10 @@ pub struct DpiImportExportImportTask<'a> { #[derive(Debug, Node)] pub struct DpiImportExportExportFunction<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DpiSpecString<'a>, Option<(CIdentifier<'a>, Symbol<'a>)>, - Symbol<'a>, + Keyword<'a>, FunctionIdentifier<'a>, Symbol<'a>, ), @@ -121,10 +121,10 @@ pub struct DpiImportExportExportFunction<'a> { #[derive(Debug, Node)] pub struct DpiImportExportExportTask<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DpiSpecString<'a>, Option<(CIdentifier<'a>, Symbol<'a>)>, - Symbol<'a>, + Keyword<'a>, TaskIdentifier<'a>, Symbol<'a>, ), @@ -132,19 +132,19 @@ pub struct DpiImportExportExportTask<'a> { #[derive(Debug, Node)] pub enum DpiSpecString<'a> { - DpiC(Symbol<'a>), - Dpi(Symbol<'a>), + DpiC(Keyword<'a>), + Dpi(Keyword<'a>), } #[derive(Debug, Node)] pub enum DpiFunctionImportProperty<'a> { - Context(Symbol<'a>), - Pure(Symbol<'a>), + Context(Keyword<'a>), + Pure(Keyword<'a>), } #[derive(Debug, Node)] pub enum DpiTaskImportProperty<'a> { - Context(Symbol<'a>), + Context(Keyword<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/declarations/interface_declarations.rs b/src/parser/declarations/interface_declarations.rs index bcca747..59560b2 100644 --- a/src/parser/declarations/interface_declarations.rs +++ b/src/parser/declarations/interface_declarations.rs @@ -9,7 +9,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct ModportDeclaration<'a> { - pub nodes: (Symbol<'a>, List, ModportItem<'a>>, Symbol<'a>), + pub nodes: (Keyword<'a>, List, ModportItem<'a>>, Symbol<'a>), } #[derive(Debug, Node)] @@ -47,7 +47,7 @@ pub struct ModportPortsDeclaratonClocking<'a> { #[derive(Debug, Node)] pub struct ModportClockingDeclaration<'a> { - pub nodes: (Symbol<'a>, ClockingIdentifier<'a>), + pub nodes: (Keyword<'a>, ClockingIdentifier<'a>), } #[derive(Debug, Node)] @@ -88,8 +88,8 @@ pub enum ModportTfPort<'a> { #[derive(Debug, Node)] pub enum ImportExport<'a> { - Import(Symbol<'a>), - Export(Symbol<'a>), + Import(Keyword<'a>), + Export(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/let_declarations.rs b/src/parser/declarations/let_declarations.rs index 267c761..0ae9c01 100644 --- a/src/parser/declarations/let_declarations.rs +++ b/src/parser/declarations/let_declarations.rs @@ -11,7 +11,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct LetDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, LetIdentifier<'a>, Option>>>, Symbol<'a>, @@ -44,7 +44,7 @@ pub struct LetPortItem<'a> { #[derive(Debug, Node)] pub enum LetFormalType<'a> { DataTypeOrImplicit(DataTypeOrImplicit<'a>), - Untyped(Symbol<'a>), + Untyped(Keyword<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/declarations/module_parameter_declarations.rs b/src/parser/declarations/module_parameter_declarations.rs index 10e9f3b..ac61b13 100644 --- a/src/parser/declarations/module_parameter_declarations.rs +++ b/src/parser/declarations/module_parameter_declarations.rs @@ -15,7 +15,7 @@ pub enum LocalParameterDeclaration<'a> { #[derive(Debug, Node)] pub struct LocalParameterDeclarationParam<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfParamAssignments<'a>, ), @@ -23,7 +23,7 @@ pub struct LocalParameterDeclarationParam<'a> { #[derive(Debug, Node)] pub struct LocalParameterDeclarationType<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, ListOfTypeAssignments<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>), } #[derive(Debug, Node)] @@ -35,7 +35,7 @@ pub enum ParameterDeclaration<'a> { #[derive(Debug, Node)] pub struct ParameterDeclarationParam<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfParamAssignments<'a>, ), @@ -43,13 +43,13 @@ pub struct ParameterDeclarationParam<'a> { #[derive(Debug, Node)] pub struct ParameterDeclarationType<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, ListOfTypeAssignments<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>), } #[derive(Debug, Node)] pub struct SpecparamDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfSpecparamAssignments<'a>, Symbol<'a>, diff --git a/src/parser/declarations/net_and_variable_types.rs b/src/parser/declarations/net_and_variable_types.rs index 89c93fd..db2b4b9 100644 --- a/src/parser/declarations/net_and_variable_types.rs +++ b/src/parser/declarations/net_and_variable_types.rs @@ -13,8 +13,8 @@ pub enum CastingType<'a> { SimpleType(Box>), ConstantPrimary(Box>), Signing(Box>), - String(Symbol<'a>), - Const(Symbol<'a>), + String(Keyword<'a>), + Const(Keyword<'a>), } #[derive(Debug, Node)] @@ -24,12 +24,12 @@ pub enum DataType<'a> { NonIntegerType(NonIntegerType<'a>), Union(Box>), Enum(DataTypeEnum<'a>), - String(Symbol<'a>), - Chandle(Symbol<'a>), + String(Keyword<'a>), + Chandle(Keyword<'a>), Virtual(DataTypeVirtual<'a>), Type(DataTypeType<'a>), ClassType(ClassType<'a>), - Event(Symbol<'a>), + Event(Keyword<'a>), PsCovergroupIdentifier(PsCovergroupIdentifier<'a>), TypeReference(Box>), } @@ -60,13 +60,13 @@ pub struct DataTypeUnion<'a> { #[derive(Debug, Node)] pub struct Packed<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct DataTypeEnum<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, Brace<'a, List, EnumNameDeclaration<'a>>>, Vec>, @@ -76,7 +76,7 @@ pub struct DataTypeEnum<'a> { #[derive(Debug, Node)] pub struct DataTypeVirtual<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, InterfaceIdentifier<'a>, Option>, @@ -86,7 +86,7 @@ pub struct DataTypeVirtual<'a> { #[derive(Debug, Node)] pub struct Interface<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -170,42 +170,42 @@ pub enum IntegerType<'a> { #[derive(Debug, Node)] pub enum IntegerAtomType<'a> { - Byte(Symbol<'a>), - Shortint(Symbol<'a>), - Int(Symbol<'a>), - Longint(Symbol<'a>), - Integer(Symbol<'a>), - Time(Symbol<'a>), + Byte(Keyword<'a>), + Shortint(Keyword<'a>), + Int(Keyword<'a>), + Longint(Keyword<'a>), + Integer(Keyword<'a>), + Time(Keyword<'a>), } #[derive(Debug, Node)] pub enum IntegerVectorType<'a> { - Bit(Symbol<'a>), - Logic(Symbol<'a>), - Reg(Symbol<'a>), + Bit(Keyword<'a>), + Logic(Keyword<'a>), + Reg(Keyword<'a>), } #[derive(Debug, Node)] pub enum NonIntegerType<'a> { - Shortreal(Symbol<'a>), - Real(Symbol<'a>), - Realtime(Symbol<'a>), + Shortreal(Keyword<'a>), + Real(Keyword<'a>), + Realtime(Keyword<'a>), } #[derive(Debug, Node)] pub enum NetType<'a> { - Supply0(Symbol<'a>), - Supply1(Symbol<'a>), - Tri(Symbol<'a>), - Triand(Symbol<'a>), - Trior(Symbol<'a>), - Trireg(Symbol<'a>), - Tri0(Symbol<'a>), - Tri1(Symbol<'a>), - Uwire(Symbol<'a>), - Wire(Symbol<'a>), - Wand(Symbol<'a>), - Wor(Symbol<'a>), + Supply0(Keyword<'a>), + Supply1(Keyword<'a>), + Tri(Keyword<'a>), + Triand(Keyword<'a>), + Trior(Keyword<'a>), + Trireg(Keyword<'a>), + Tri0(Keyword<'a>), + Tri1(Keyword<'a>), + Uwire(Keyword<'a>), + Wire(Keyword<'a>), + Wand(Keyword<'a>), + Wor(Keyword<'a>), } #[derive(Debug, Node)] @@ -222,7 +222,7 @@ pub struct NetPortTypeDataType<'a> { #[derive(Debug, Node)] pub struct NetPortTypeInterconnect<'a> { - pub nodes: (Symbol<'a>, ImplicitDataType<'a>), + pub nodes: (Keyword<'a>, ImplicitDataType<'a>), } #[derive(Debug, Node)] @@ -238,13 +238,13 @@ pub enum VarDataType<'a> { #[derive(Debug, Node)] pub struct VarDataTypeVar<'a> { - pub nodes: (Symbol<'a>, DataTypeOrImplicit<'a>), + pub nodes: (Keyword<'a>, DataTypeOrImplicit<'a>), } #[derive(Debug, Node)] pub enum Signing<'a> { - Signed(Symbol<'a>), - Unsigned(Symbol<'a>), + Signed(Keyword<'a>), + Unsigned(Keyword<'a>), } #[derive(Debug, Node)] @@ -269,14 +269,14 @@ pub struct StructUnionMember<'a> { #[derive(Debug, Node)] pub enum DataTypeOrVoid<'a> { DataType(DataType<'a>), - Void(Symbol<'a>), + Void(Keyword<'a>), } #[derive(Debug, Node)] pub enum StructUnion<'a> { - Struct(Symbol<'a>), - Union(Symbol<'a>), - UnionTagged((Symbol<'a>, Symbol<'a>)), + Struct(Keyword<'a>), + Union(Keyword<'a>), + UnionTagged((Keyword<'a>, Keyword<'a>)), } #[derive(Debug, Node)] @@ -287,12 +287,12 @@ pub enum TypeReference<'a> { #[derive(Debug, Node)] pub struct TypeReferenceExpression<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>), + pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>), } #[derive(Debug, Node)] pub struct TypeReferenceDataType<'a> { - pub nodes: (Symbol<'a>, Paren<'a, DataType<'a>>), + pub nodes: (Keyword<'a>, Paren<'a, DataType<'a>>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/port_declarations.rs b/src/parser/declarations/port_declarations.rs index 9bb46aa..3a08425 100644 --- a/src/parser/declarations/port_declarations.rs +++ b/src/parser/declarations/port_declarations.rs @@ -10,7 +10,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct InoutDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfPortIdentifiers<'a>, ), @@ -25,7 +25,7 @@ pub enum InputDeclaration<'a> { #[derive(Debug, Node)] pub struct InputDeclarationNet<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfPortIdentifiers<'a>, ), @@ -34,7 +34,7 @@ pub struct InputDeclarationNet<'a> { #[derive(Debug, Node)] pub struct InputDeclarationVariable<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, VariablePortType<'a>, ListOfVariableIdentifiers<'a>, ), @@ -49,7 +49,7 @@ pub enum OutputDeclaration<'a> { #[derive(Debug, Node)] pub struct OutputDeclarationNet<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, ListOfPortIdentifiers<'a>, ), @@ -58,7 +58,7 @@ pub struct OutputDeclarationNet<'a> { #[derive(Debug, Node)] pub struct OutputDeclarationVariable<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, VariablePortType<'a>, ListOfVariableIdentifiers<'a>, ), @@ -76,7 +76,7 @@ pub struct InterfacePortDeclaration<'a> { #[derive(Debug, Node)] pub struct RefDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, VariablePortType<'a>, ListOfVariableIdentifiers<'a>, ), diff --git a/src/parser/declarations/strengths.rs b/src/parser/declarations/strengths.rs index 9303a34..0239268 100644 --- a/src/parser/declarations/strengths.rs +++ b/src/parser/declarations/strengths.rs @@ -28,38 +28,38 @@ pub struct DriveStrength10<'a> { #[derive(Debug, Node)] pub struct DriveStrength0z<'a> { - pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Symbol<'a>)>,), + pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Keyword<'a>)>,), } #[derive(Debug, Node)] pub struct DriveStrength1z<'a> { - pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Symbol<'a>)>,), + pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Keyword<'a>)>,), } #[derive(Debug, Node)] pub struct DriveStrengthz1<'a> { - pub nodes: (Paren<'a, (Symbol<'a>, Symbol<'a>, Strength1<'a>)>,), + pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength1<'a>)>,), } #[derive(Debug, Node)] pub struct DriveStrengthz0<'a> { - pub nodes: (Paren<'a, (Symbol<'a>, Symbol<'a>, Strength0<'a>)>,), + pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength0<'a>)>,), } #[derive(Debug, Node)] pub enum Strength0<'a> { - Supply0(Symbol<'a>), - Strong0(Symbol<'a>), - Pull0(Symbol<'a>), - Weak0(Symbol<'a>), + Supply0(Keyword<'a>), + Strong0(Keyword<'a>), + Pull0(Keyword<'a>), + Weak0(Keyword<'a>), } #[derive(Debug, Node)] pub enum Strength1<'a> { - Supply1(Symbol<'a>), - Strong1(Symbol<'a>), - Pull1(Symbol<'a>), - Weak1(Symbol<'a>), + Supply1(Keyword<'a>), + Strong1(Keyword<'a>), + Pull1(Keyword<'a>), + Weak1(Keyword<'a>), } #[derive(Debug, Node)] @@ -71,17 +71,17 @@ pub enum ChargeStrength<'a> { #[derive(Debug, Node)] pub struct ChargeStrengthSmall<'a> { - pub nodes: (Paren<'a, Symbol<'a>>,), + pub nodes: (Paren<'a, Keyword<'a>>,), } #[derive(Debug, Node)] pub struct ChargeStrengthMedium<'a> { - pub nodes: (Paren<'a, Symbol<'a>>,), + pub nodes: (Paren<'a, Keyword<'a>>,), } #[derive(Debug, Node)] pub struct ChargeStrengthLarge<'a> { - pub nodes: (Paren<'a, Symbol<'a>>,), + pub nodes: (Paren<'a, Keyword<'a>>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/task_declarations.rs b/src/parser/declarations/task_declarations.rs index 5fa3e7c..bdace00 100644 --- a/src/parser/declarations/task_declarations.rs +++ b/src/parser/declarations/task_declarations.rs @@ -10,7 +10,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct TaskDeclaration<'a> { - pub nodes: (Symbol<'a>, Option>, TaskBodyDeclaration<'a>), + pub nodes: (Keyword<'a>, Option>, TaskBodyDeclaration<'a>), } #[derive(Debug, Node)] @@ -27,7 +27,7 @@ pub struct TaskBodyDeclarationWithoutPort<'a> { Symbol<'a>, Vec>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, TaskIdentifier<'a>)>, ), } @@ -41,7 +41,7 @@ pub struct TaskBodyDeclarationWithPort<'a> { Symbol<'a>, Vec>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, TaskIdentifier<'a>)>, ), } @@ -75,7 +75,7 @@ pub struct TfPortItem<'a> { #[derive(Debug, Node)] pub enum TfPortDirection<'a> { PortDirection(PortDirection<'a>), - ConstRef((Symbol<'a>, Symbol<'a>)), + ConstRef((Keyword<'a>, Keyword<'a>)), } #[derive(Debug, Node)] @@ -93,7 +93,7 @@ pub struct TfPortDeclaration<'a> { #[derive(Debug, Node)] pub struct TaskPrototype<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, TaskIdentifier<'a>, Option>>>, ), diff --git a/src/parser/declarations/type_declarations.rs b/src/parser/declarations/type_declarations.rs index 14ba663..7c09a71 100644 --- a/src/parser/declarations/type_declarations.rs +++ b/src/parser/declarations/type_declarations.rs @@ -30,13 +30,13 @@ pub struct DataDeclarationVariable<'a> { #[derive(Debug, Node)] pub struct Const<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct PackageImportDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, List, PackageImportItem<'a>>, Symbol<'a>, ), @@ -66,13 +66,13 @@ pub enum PackageExportDeclaration<'a> { #[derive(Debug, Node)] pub struct PackageExportDeclarationAsterisk<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct PackageExportDeclarationItem<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, List, PackageImportItem<'a>>, Symbol<'a>, ), @@ -80,7 +80,7 @@ pub struct PackageExportDeclarationItem<'a> { #[derive(Debug, Node)] pub struct GenvarDeclaration<'a> { - pub nodes: (Symbol<'a>, ListOfGenvarIdentifiers<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, ListOfGenvarIdentifiers<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -111,8 +111,8 @@ pub enum Strength<'a> { #[derive(Debug, Node)] pub enum VectorScalar<'a> { - Vectored(Symbol<'a>), - Scalared(Symbol<'a>), + Vectored(Keyword<'a>), + Scalared(Keyword<'a>), } #[derive(Debug, Node)] @@ -128,7 +128,7 @@ pub struct NetDeclarationNetTypeIdentifier<'a> { #[derive(Debug, Node)] pub struct NetDeclarationInterconnect<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, ImplicitDataType<'a>, Option<(Symbol<'a>, DelayValue<'a>)>, NetIdentifier<'a>, @@ -148,7 +148,7 @@ pub enum TypeDeclaration<'a> { #[derive(Debug, Node)] pub struct TypeDeclarationDataType<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DataType<'a>, TypeIdentifier<'a>, Vec>, @@ -159,7 +159,7 @@ pub struct TypeDeclarationDataType<'a> { #[derive(Debug, Node)] pub struct TypeDeclarationInterface<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, InterfaceInstanceIdentifier<'a>, ConstantBitSelect<'a>, Symbol<'a>, @@ -172,7 +172,7 @@ pub struct TypeDeclarationInterface<'a> { #[derive(Debug, Node)] pub struct TypeDeclarationReserved<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, TypeIdentifier<'a>, Symbol<'a>, @@ -181,11 +181,11 @@ pub struct TypeDeclarationReserved<'a> { #[derive(Debug, Node)] pub enum TypeDeclarationKeyword<'a> { - Enum(Symbol<'a>), - Struct(Symbol<'a>), - Union(Symbol<'a>), - Class(Symbol<'a>), - InterfaceClass((Symbol<'a>, Symbol<'a>)), + Enum(Keyword<'a>), + Struct(Keyword<'a>), + Union(Keyword<'a>), + Class(Keyword<'a>), + InterfaceClass((Keyword<'a>, Keyword<'a>)), } #[derive(Debug, Node)] @@ -197,11 +197,11 @@ pub enum NetTypeDeclaration<'a> { #[derive(Debug, Node)] pub struct NetTypeDeclarationDataType<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, DataType<'a>, NetTypeIdentifier<'a>, Option<( - Symbol<'a>, + Keyword<'a>, Option>, TfIdentifier<'a>, )>, @@ -212,7 +212,7 @@ pub struct NetTypeDeclarationDataType<'a> { #[derive(Debug, Node)] pub struct NetTypeDeclarationNetType<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, NetTypeIdentifier<'a>, NetTypeIdentifier<'a>, @@ -222,8 +222,8 @@ pub struct NetTypeDeclarationNetType<'a> { #[derive(Debug, Node)] pub enum Lifetime<'a> { - Static(Symbol<'a>), - Automatic(Symbol<'a>), + Static(Keyword<'a>), + Automatic(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/concatenations.rs b/src/parser/expressions/concatenations.rs index 085e56f..31d5764 100644 --- a/src/parser/expressions/concatenations.rs +++ b/src/parser/expressions/concatenations.rs @@ -71,7 +71,7 @@ pub struct StreamConcatenation<'a> { pub struct StreamExpression<'a> { pub nodes: ( Expression<'a>, - Option<(Symbol<'a>, Bracket<'a, ArrayRangeExpression<'a>>)>, + Option<(Keyword<'a>, Bracket<'a, ArrayRangeExpression<'a>>)>, ), } diff --git a/src/parser/expressions/expressions.rs b/src/parser/expressions/expressions.rs index 84345e9..e73ea28 100644 --- a/src/parser/expressions/expressions.rs +++ b/src/parser/expressions/expressions.rs @@ -169,12 +169,12 @@ pub struct ExpressionBinary<'a> { #[derive(Debug, Node)] pub struct TaggedUnionExpression<'a> { - pub nodes: (Symbol<'a>, MemberIdentifier<'a>, Option>), + pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option>), } #[derive(Debug, Node)] pub struct InsideExpression<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, Brace<'a, OpenRangeList<'a>>), + pub nodes: (Expression<'a>, Keyword<'a>, Brace<'a, OpenRangeList<'a>>), } #[derive(Debug, Node)] diff --git a/src/parser/expressions/primaries.rs b/src/parser/expressions/primaries.rs index 8adb60f..4206913 100644 --- a/src/parser/expressions/primaries.rs +++ b/src/parser/expressions/primaries.rs @@ -23,7 +23,7 @@ pub enum ConstantPrimary<'a> { ConstantCast(ConstantCast<'a>), ConstantAssignmentPatternExpression(ConstantAssignmentPatternExpression<'a>), TypeReference(TypeReference<'a>), - Null(Symbol<'a>), + Null(Keyword<'a>), } #[derive(Debug, Node)] @@ -99,9 +99,9 @@ pub enum Primary<'a> { AssignmentPatternExpression(AssignmentPatternExpression<'a>), StreamingConcatenation(StreamingConcatenation<'a>), SequenceMethodCall(SequenceMethodCall<'a>), - This(Symbol<'a>), + This(Keyword<'a>), Dollar(Symbol<'a>), - Null(Symbol<'a>), + Null(Keyword<'a>), } #[derive(Debug, Node)] @@ -177,19 +177,19 @@ pub struct TimeLiteralFixedPoint<'a> { #[derive(Debug, Node)] pub enum TimeUnit<'a> { - S(Symbol<'a>), - MS(Symbol<'a>), - US(Symbol<'a>), - NS(Symbol<'a>), - PS(Symbol<'a>), - FS(Symbol<'a>), + S(Keyword<'a>), + MS(Keyword<'a>), + US(Keyword<'a>), + NS(Keyword<'a>), + PS(Keyword<'a>), + FS(Keyword<'a>), } #[derive(Debug, Node)] pub enum ImplicitClassHandle<'a> { - This(Symbol<'a>), - Super(Symbol<'a>), - ThisSuper((Symbol<'a>, Symbol<'a>, Symbol<'a>)), + This(Keyword<'a>), + Super(Keyword<'a>), + ThisSuper((Keyword<'a>, Symbol<'a>, Keyword<'a>)), } #[derive(Debug, Node)] @@ -621,12 +621,12 @@ mod tests { fn test_primary() { parser_test!( primary, - "2.1ns", + "2.1ns ", Ok((_, Primary::PrimaryLiteral(PrimaryLiteral::TimeLiteral(_)))) ); parser_test!( primary, - "40 ps", + "40 ps ", Ok((_, Primary::PrimaryLiteral(PrimaryLiteral::TimeLiteral(_)))) ); parser_test!( diff --git a/src/parser/expressions/subroutine_calls.rs b/src/parser/expressions/subroutine_calls.rs index be3446b..6777e59 100644 --- a/src/parser/expressions/subroutine_calls.rs +++ b/src/parser/expressions/subroutine_calls.rs @@ -69,7 +69,7 @@ pub enum SubroutineCall<'a> { #[derive(Debug, Node)] pub struct SubroutineCallRandomize<'a> { - pub nodes: (Option<(Symbol<'a>, Symbol<'a>)>, RandomizeCall<'a>), + pub nodes: (Option<(Keyword<'a>, Symbol<'a>)>, RandomizeCall<'a>), } #[derive(Debug, Node)] @@ -143,18 +143,18 @@ pub struct ArrayManipulationCall<'a> { ArrayMethodName<'a>, Vec>, Option>>, - Option<(Symbol<'a>, Paren<'a, Expression<'a>>)>, + Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, ), } #[derive(Debug, Node)] pub struct RandomizeCall<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Vec>, Option>>>, Option<( - Symbol<'a>, + Keyword<'a>, Option>>>, ConstraintBlock<'a>, )>, @@ -164,7 +164,7 @@ pub struct RandomizeCall<'a> { #[derive(Debug, Node)] pub enum VariableIdentifierListOrNull<'a> { VariableIdentifierList(VariableIdentifierList<'a>), - Null(Symbol<'a>), + Null(Keyword<'a>), } #[derive(Debug, Node)] @@ -176,10 +176,10 @@ pub enum MethodCallRoot<'a> { #[derive(Debug, Node)] pub enum ArrayMethodName<'a> { MethodIdentifier(MethodIdentifier<'a>), - Unique(Symbol<'a>), - And(Symbol<'a>), - Or(Symbol<'a>), - Xor(Symbol<'a>), + Unique(Keyword<'a>), + And(Keyword<'a>), + Or(Keyword<'a>), + Xor(Keyword<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/general/identifiers.rs b/src/parser/general/identifiers.rs index bfc5254..3adb100 100644 --- a/src/parser/general/identifiers.rs +++ b/src/parser/general/identifiers.rs @@ -160,7 +160,7 @@ pub struct HierarchicalIdentifier<'a> { #[derive(Debug, Node)] pub struct Root<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -292,7 +292,7 @@ pub struct PackageScopePackage<'a> { #[derive(Debug, Node)] pub struct Unit<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -455,7 +455,7 @@ pub enum LocalOrPackageScopeOrClassScope<'a> { #[derive(Debug, Node)] pub struct Local<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Symbol<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/instantiations/generated_instantiation.rs b/src/parser/instantiations/generated_instantiation.rs index d628300..88d07a8 100644 --- a/src/parser/instantiations/generated_instantiation.rs +++ b/src/parser/instantiations/generated_instantiation.rs @@ -10,13 +10,13 @@ use nom::IResult; #[derive(Debug, Node)] pub struct GenerateRegion<'a> { - pub nodes: (Symbol<'a>, Vec>, Symbol<'a>), + pub nodes: (Keyword<'a>, Vec>, Keyword<'a>), } #[derive(Debug, Node)] pub struct LoopGenerateConstruct<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -43,7 +43,7 @@ pub struct GenvarInitialization<'a> { #[derive(Debug, Node)] pub struct Genvar<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -81,20 +81,20 @@ pub enum ConditionalGenerateConstruct<'a> { #[derive(Debug, Node)] pub struct IfGenerateConstruct<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ConstantExpression<'a>>, GenerateBlock<'a>, - Option<(Symbol<'a>, GenerateBlock<'a>)>, + Option<(Keyword<'a>, GenerateBlock<'a>)>, ), } #[derive(Debug, Node)] pub struct CaseGenerateConstruct<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ConstantExpression<'a>>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -115,7 +115,7 @@ pub struct CaseGenerateItemNondefault<'a> { #[derive(Debug, Node)] pub struct CaseGenerateItemDefault<'a> { - pub nodes: (Symbol<'a>, Option>, GenerateBlock<'a>), + pub nodes: (Keyword<'a>, Option>, GenerateBlock<'a>), } #[derive(Debug, Node)] @@ -128,10 +128,10 @@ pub enum GenerateBlock<'a> { pub struct GenerateBlockMultiple<'a> { pub nodes: ( Option<(GenerateBlockIdentifier<'a>, Symbol<'a>)>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>, ), } diff --git a/src/parser/primitive_instances/primitive_gate_and_switch_types.rs b/src/parser/primitive_instances/primitive_gate_and_switch_types.rs index 2529d32..9a0ceb0 100644 --- a/src/parser/primitive_instances/primitive_gate_and_switch_types.rs +++ b/src/parser/primitive_instances/primitive_gate_and_switch_types.rs @@ -7,37 +7,37 @@ use nom::IResult; #[derive(Debug, Node)] pub struct CmosSwitchtype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct EnableGatetype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct MosSwitchtype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct NInputGatetype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct NOutputGatetype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct PassEnSwitchtype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct PassSwitchtype<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } // ----------------------------------------------------------------------------- @@ -115,53 +115,53 @@ mod tests { #[test] fn test_cmos_switchtype() { - parser_test!(cmos_switchtype, "cmos", Ok((_, _))); - parser_test!(cmos_switchtype, "rcmos", Ok((_, _))); + parser_test!(cmos_switchtype, "cmos ", Ok((_, _))); + parser_test!(cmos_switchtype, "rcmos ", Ok((_, _))); } #[test] fn test_enable_gatetype() { - parser_test!(enable_gatetype, "bufif0", Ok((_, _))); - parser_test!(enable_gatetype, "bufif1", Ok((_, _))); - parser_test!(enable_gatetype, "notif0", Ok((_, _))); - parser_test!(enable_gatetype, "notif1", Ok((_, _))); + parser_test!(enable_gatetype, "bufif0 ", Ok((_, _))); + parser_test!(enable_gatetype, "bufif1 ", Ok((_, _))); + parser_test!(enable_gatetype, "notif0 ", Ok((_, _))); + parser_test!(enable_gatetype, "notif1 ", Ok((_, _))); } #[test] fn test_mos_switchtype() { - parser_test!(mos_switchtype, "nmos", Ok((_, _))); - parser_test!(mos_switchtype, "pmos", Ok((_, _))); - parser_test!(mos_switchtype, "rnmos", Ok((_, _))); - parser_test!(mos_switchtype, "rpmos", Ok((_, _))); + parser_test!(mos_switchtype, "nmos ", Ok((_, _))); + parser_test!(mos_switchtype, "pmos ", Ok((_, _))); + parser_test!(mos_switchtype, "rnmos ", Ok((_, _))); + parser_test!(mos_switchtype, "rpmos ", Ok((_, _))); } #[test] fn test_n_input_gatetype() { - parser_test!(n_input_gatetype, "and", Ok((_, _))); - parser_test!(n_input_gatetype, "nand", Ok((_, _))); - parser_test!(n_input_gatetype, "or", Ok((_, _))); - parser_test!(n_input_gatetype, "nor", Ok((_, _))); - parser_test!(n_input_gatetype, "xor", Ok((_, _))); - parser_test!(n_input_gatetype, "xnor", Ok((_, _))); + parser_test!(n_input_gatetype, "and ", Ok((_, _))); + parser_test!(n_input_gatetype, "nand ", Ok((_, _))); + parser_test!(n_input_gatetype, "or ", Ok((_, _))); + parser_test!(n_input_gatetype, "nor ", Ok((_, _))); + parser_test!(n_input_gatetype, "xor ", Ok((_, _))); + parser_test!(n_input_gatetype, "xnor ", Ok((_, _))); } #[test] fn test_n_output_gatetype() { - parser_test!(n_output_gatetype, "buf", Ok((_, _))); - parser_test!(n_output_gatetype, "not", Ok((_, _))); + parser_test!(n_output_gatetype, "buf ", Ok((_, _))); + parser_test!(n_output_gatetype, "not ", Ok((_, _))); } #[test] fn test_pass_en_switchtype() { - parser_test!(pass_en_switchtype, "tranif0", Ok((_, _))); - parser_test!(pass_en_switchtype, "tranif1", Ok((_, _))); - parser_test!(pass_en_switchtype, "rtranif0", Ok((_, _))); - parser_test!(pass_en_switchtype, "rtranif1", Ok((_, _))); + parser_test!(pass_en_switchtype, "tranif0 ", Ok((_, _))); + parser_test!(pass_en_switchtype, "tranif1 ", Ok((_, _))); + parser_test!(pass_en_switchtype, "rtranif0 ", Ok((_, _))); + parser_test!(pass_en_switchtype, "rtranif1 ", Ok((_, _))); } #[test] fn test_pass_switchtype() { - parser_test!(pass_switchtype, "tran", Ok((_, _))); - parser_test!(pass_switchtype, "rtran", Ok((_, _))); + parser_test!(pass_switchtype, "tran ", Ok((_, _))); + parser_test!(pass_switchtype, "rtran ", Ok((_, _))); } } diff --git a/src/parser/primitive_instances/primitive_instantiation_and_instances.rs b/src/parser/primitive_instances/primitive_instantiation_and_instances.rs index e42c6d2..9c484e9 100644 --- a/src/parser/primitive_instances/primitive_instantiation_and_instances.rs +++ b/src/parser/primitive_instances/primitive_instantiation_and_instances.rs @@ -95,7 +95,7 @@ pub struct GateInstantiationPass<'a> { #[derive(Debug, Node)] pub struct GateInstantiationPulldown<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, List, PullGateInstance<'a>>, Symbol<'a>, @@ -105,7 +105,7 @@ pub struct GateInstantiationPulldown<'a> { #[derive(Debug, Node)] pub struct GateInstantiationPullup<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, List, PullGateInstance<'a>>, Symbol<'a>, @@ -342,7 +342,7 @@ pub fn gate_instantiation_pass(s: Span) -> IResult { #[parser] pub fn gate_instantiation_pulldown(s: Span) -> IResult { - let (s, a) = symbol("pulldown")(s)?; + let (s, a) = keyword("pulldown")(s)?; let (s, b) = opt(pulldown_strength)(s)?; let (s, c) = list(symbol(","), pull_gate_instance)(s)?; let (s, d) = symbol(";")(s)?; @@ -356,7 +356,7 @@ pub fn gate_instantiation_pulldown(s: Span) -> IResult #[parser] pub fn gate_instantiation_pullup(s: Span) -> IResult { - let (s, a) = symbol("pullup")(s)?; + let (s, a) = keyword("pullup")(s)?; let (s, b) = opt(pullup_strength)(s)?; let (s, c) = list(symbol(","), pull_gate_instance)(s)?; let (s, d) = symbol(";")(s)?; diff --git a/src/parser/source_text/checker_items.rs b/src/parser/source_text/checker_items.rs index bae819c..3987673 100644 --- a/src/parser/source_text/checker_items.rs +++ b/src/parser/source_text/checker_items.rs @@ -27,8 +27,8 @@ pub struct CheckerPortItem<'a> { #[derive(Debug, Node)] pub enum CheckerPortDirection<'a> { - Input(Symbol<'a>), - Output(Symbol<'a>), + Input(Keyword<'a>), + Output(Keyword<'a>), } #[derive(Debug, Node)] @@ -63,20 +63,20 @@ pub struct CheckerOrGenerateItemDeclarationData<'a> { #[derive(Debug, Node)] pub struct Rand<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct CheckerOrGenerateItemDeclarationClocking<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, ClockingIdentifier<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct CheckerOrGenerateItemDeclarationDisable<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, + Keyword<'a>, ExpressionOrDist<'a>, Symbol<'a>, ), diff --git a/src/parser/source_text/class_items.rs b/src/parser/source_text/class_items.rs index 750b2c2..f19e8e5 100644 --- a/src/parser/source_text/class_items.rs +++ b/src/parser/source_text/class_items.rs @@ -59,7 +59,7 @@ pub struct ClassPropertyNonConst<'a> { #[derive(Debug, Node)] pub struct ClassPropertyConst<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Vec>, DataType<'a>, ConstIdentifier<'a>, @@ -91,8 +91,8 @@ pub struct ClassMethodFunction<'a> { #[derive(Debug, Node)] pub struct ClassMethodPureVirtual<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Vec>, MethodPrototype<'a>, Symbol<'a>, @@ -102,7 +102,7 @@ pub struct ClassMethodPureVirtual<'a> { #[derive(Debug, Node)] pub struct ClassMethodExternMethod<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Vec>, MethodPrototype<'a>, Symbol<'a>, @@ -117,7 +117,7 @@ pub struct ClassMethodConstructor<'a> { #[derive(Debug, Node)] pub struct ClassMethodExternConstructor<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Vec>, ClassConstructorPrototype<'a>, ), @@ -126,8 +126,8 @@ pub struct ClassMethodExternConstructor<'a> { #[derive(Debug, Node)] pub struct ClassConstructorPrototype<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, Option>>>, Symbol<'a>, ), @@ -141,9 +141,9 @@ pub enum ClassConstraint<'a> { #[derive(Debug, Node)] pub enum ClassItemQualifier<'a> { - Static(Symbol<'a>), - Protected(Symbol<'a>), - Local(Symbol<'a>), + Static(Keyword<'a>), + Protected(Keyword<'a>), + Local(Keyword<'a>), } #[derive(Debug, Node)] @@ -154,14 +154,14 @@ pub enum PropertyQualifier<'a> { #[derive(Debug, Node)] pub enum RandomQualifier<'a> { - Rand(Symbol<'a>), - Randc(Symbol<'a>), + Rand(Keyword<'a>), + Randc(Keyword<'a>), } #[derive(Debug, Node)] pub enum MethodQualifier<'a> { - Virtual(Symbol<'a>), - PureVirtual((Symbol<'a>, Symbol<'a>)), + Virtual(Keyword<'a>), + PureVirtual((Keyword<'a>, Keyword<'a>)), ClassItemQualifier(ClassItemQualifier<'a>), } @@ -174,28 +174,28 @@ pub enum MethodPrototype<'a> { #[derive(Debug, Node)] pub struct ClassConstructorDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>, - Symbol<'a>, + Keyword<'a>, Option>>>, Symbol<'a>, Vec>, Option<( + Keyword<'a>, Symbol<'a>, - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, Option>>, Symbol<'a>, )>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, New<'a>)>, ), } #[derive(Debug, Node)] pub struct New<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/configuration_source_text.rs b/src/parser/source_text/configuration_source_text.rs index c5cab53..7847f92 100644 --- a/src/parser/source_text/configuration_source_text.rs +++ b/src/parser/source_text/configuration_source_text.rs @@ -11,13 +11,13 @@ use nom::IResult; #[derive(Debug, Node)] pub struct ConfigDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, ConfigIdentifier<'a>, Symbol<'a>, Vec<(LocalParameterDeclaration<'a>, Symbol<'a>)>, DesignStatement<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ConfigIdentifier<'a>)>, ), } @@ -25,7 +25,7 @@ pub struct ConfigDeclaration<'a> { #[derive(Debug, Node)] pub struct DesignStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Vec<( Option<(LibraryIdentifier<'a>, Symbol<'a>)>, CellIdentifier<'a>, @@ -70,12 +70,12 @@ pub struct ConfigRuleStatementCellUse<'a> { #[derive(Debug, Node)] pub struct DefaultClause<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct InstClause<'a> { - pub nodes: (Symbol<'a>, InstName<'a>), + pub nodes: (Keyword<'a>, InstName<'a>), } #[derive(Debug, Node)] @@ -89,7 +89,7 @@ pub struct InstName<'a> { #[derive(Debug, Node)] pub struct CellClause<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option<(LibraryIdentifier<'a>, Symbol<'a>)>, CellIdentifier<'a>, ), @@ -97,7 +97,7 @@ pub struct CellClause<'a> { #[derive(Debug, Node)] pub struct LiblistClause<'a> { - pub nodes: (Symbol<'a>, Vec>), + pub nodes: (Keyword<'a>, Vec>), } #[derive(Debug, Node)] @@ -110,7 +110,7 @@ pub enum UseClause<'a> { #[derive(Debug, Node)] pub struct UseClauseCell<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option<(LibraryIdentifier<'a>, Symbol<'a>)>, CellIdentifier<'a>, Option<(Symbol<'a>, Config<'a>)>, @@ -120,7 +120,7 @@ pub struct UseClauseCell<'a> { #[derive(Debug, Node)] pub struct UseClauseNamed<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, List, NamedParameterAssignment<'a>>, Option<(Symbol<'a>, Config<'a>)>, ), @@ -129,7 +129,7 @@ pub struct UseClauseNamed<'a> { #[derive(Debug, Node)] pub struct UseClauseCellNamed<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option<(LibraryIdentifier<'a>, Symbol<'a>)>, CellIdentifier<'a>, List, NamedParameterAssignment<'a>>, @@ -139,7 +139,7 @@ pub struct UseClauseCellNamed<'a> { #[derive(Debug, Node)] pub struct Config<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/constraints.rs b/src/parser/source_text/constraints.rs index 9dcdd46..b8c621d 100644 --- a/src/parser/source_text/constraints.rs +++ b/src/parser/source_text/constraints.rs @@ -12,7 +12,7 @@ use nom::IResult; pub struct ConstraintDeclaration<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, ConstraintIdentifier<'a>, ConstraintBlock<'a>, ), @@ -20,7 +20,7 @@ pub struct ConstraintDeclaration<'a> { #[derive(Debug, Node)] pub struct Static<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -37,9 +37,9 @@ pub enum ConstraintBlockItem<'a> { #[derive(Debug, Node)] pub struct ConstraintBlockItemSolve<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, SolveBeforeList<'a>, - Symbol<'a>, + Keyword<'a>, SolveBeforeList<'a>, Symbol<'a>, ), @@ -76,7 +76,7 @@ pub struct ConstraintExpressionExpression<'a> { #[derive(Debug, Node)] pub struct Soft<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -87,17 +87,17 @@ pub struct ConstraintExpressionArrow<'a> { #[derive(Debug, Node)] pub struct ConstraintExpressionIf<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, Expression<'a>>, ConstraintSet<'a>, - Option<(Symbol<'a>, ConstraintSet<'a>)>, + Option<(Keyword<'a>, ConstraintSet<'a>)>, ), } #[derive(Debug, Node)] pub struct ConstraintExpressionForeach<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -111,12 +111,12 @@ pub struct ConstraintExpressionForeach<'a> { #[derive(Debug, Node)] pub struct ConstraintExpressionDisable<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, ConstraintPrimary<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, ConstraintPrimary<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct UniquenessConstraint<'a> { - pub nodes: (Symbol<'a>, Brace<'a, OpenRangeList<'a>>), + pub nodes: (Keyword<'a>, Brace<'a, OpenRangeList<'a>>), } #[derive(Debug, Node)] @@ -161,7 +161,7 @@ pub struct ConstraintPrototype<'a> { pub nodes: ( Option>, Option>, - Symbol<'a>, + Keyword<'a>, ConstraintIdentifier<'a>, Symbol<'a>, ), @@ -169,15 +169,15 @@ pub struct ConstraintPrototype<'a> { #[derive(Debug, Node)] pub enum ConstraintPrototypeQualifier<'a> { - Extern(Symbol<'a>), - Pure(Symbol<'a>), + Extern(Keyword<'a>), + Pure(Keyword<'a>), } #[derive(Debug, Node)] pub struct ExternConstraintDeclaration<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, ClassScope<'a>, ConstraintIdentifier<'a>, ConstraintBlock<'a>, diff --git a/src/parser/source_text/interface_items.rs b/src/parser/source_text/interface_items.rs index 6504446..8e8a475 100644 --- a/src/parser/source_text/interface_items.rs +++ b/src/parser/source_text/interface_items.rs @@ -32,12 +32,12 @@ pub enum ExternTfDeclaration<'a> { #[derive(Debug, Node)] pub struct ExternTfDeclarationMethod<'a> { - pub nodes: (Symbol<'a>, MethodPrototype<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, MethodPrototype<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct ExternTfDeclarationTask<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, TaskPrototype<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, TaskPrototype<'a>, Symbol<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/source_text/library_source_text.rs b/src/parser/source_text/library_source_text.rs index 4eaa727..932bbd9 100644 --- a/src/parser/source_text/library_source_text.rs +++ b/src/parser/source_text/library_source_text.rs @@ -24,17 +24,17 @@ pub enum LibraryDescription<'a> { #[derive(Debug, Node)] pub struct LibraryDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, LibraryIdentifier<'a>, List, FilePathSpec<'a>>, - Option<(Symbol<'a>, List, FilePathSpec<'a>>)>, + Option<(Keyword<'a>, List, FilePathSpec<'a>>)>, Symbol<'a>, ), } #[derive(Debug, Node)] pub struct IncludeStatement<'a> { - pub nodes: (Symbol<'a>, FilePathSpec<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, FilePathSpec<'a>, Symbol<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/source_text/module_items.rs b/src/parser/source_text/module_items.rs index 83019c4..2ed6316 100644 --- a/src/parser/source_text/module_items.rs +++ b/src/parser/source_text/module_items.rs @@ -19,7 +19,7 @@ pub enum ElaborationSystemTask<'a> { #[derive(Debug, Node)] pub struct ElaborationSystemTaskFatal<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option, Option<(Symbol<'a>, ListOfArguments<'a>)>)>>, Symbol<'a>, ), @@ -28,7 +28,7 @@ pub struct ElaborationSystemTaskFatal<'a> { #[derive(Debug, Node)] pub struct ElaborationSystemTaskError<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>>, Symbol<'a>, ), @@ -37,7 +37,7 @@ pub struct ElaborationSystemTaskError<'a> { #[derive(Debug, Node)] pub struct ElaborationSystemTaskWarning<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>>, Symbol<'a>, ), @@ -46,7 +46,7 @@ pub struct ElaborationSystemTaskWarning<'a> { #[derive(Debug, Node)] pub struct ElaborationSystemTaskInfo<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Option>>>, Symbol<'a>, ), @@ -127,15 +127,15 @@ pub enum ModuleOrGenerateItemDeclaration<'a> { #[derive(Debug, Node)] pub struct ModuleOrGenerateItemDeclarationClocking<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, ClockingIdentifier<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct ModuleOrGenerateItemDeclarationDisable<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, + Keyword<'a>, ExpressionOrDist<'a>, Symbol<'a>, ), @@ -160,7 +160,7 @@ pub struct NonPortModuleItemSpecparam<'a> { #[derive(Debug, Node)] pub struct ParameterOverride<'a> { - pub nodes: (Symbol<'a>, ListOfDefparamAssignments<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, ListOfDefparamAssignments<'a>, Symbol<'a>), } #[derive(Debug, Node)] @@ -172,7 +172,7 @@ pub enum BindDirective<'a> { #[derive(Debug, Node)] pub struct BindDirectiveScope<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, BindTargetScope<'a>, Option<(Symbol<'a>, BindTargetInstanceList<'a>)>, BindInstantiation<'a>, @@ -183,7 +183,7 @@ pub struct BindDirectiveScope<'a> { #[derive(Debug, Node)] pub struct BindDirectiveInstance<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, BindTargetInstance<'a>, BindInstantiation<'a>, Symbol<'a>, diff --git a/src/parser/source_text/module_parameters_and_ports.rs b/src/parser/source_text/module_parameters_and_ports.rs index 7210c8b..e7cf275 100644 --- a/src/parser/source_text/module_parameters_and_ports.rs +++ b/src/parser/source_text/module_parameters_and_ports.rs @@ -52,7 +52,7 @@ pub struct ParameterPortDeclarationParamList<'a> { #[derive(Debug, Node)] pub struct ParameterPortDeclarationTypeList<'a> { - pub nodes: (Symbol<'a>, ListOfTypeAssignments<'a>), + pub nodes: (Keyword<'a>, ListOfTypeAssignments<'a>), } #[derive(Debug, Node)] @@ -139,10 +139,10 @@ pub struct PortReference<'a> { #[derive(Debug, Node)] pub enum PortDirection<'a> { - Input(Symbol<'a>), - Output(Symbol<'a>), - Inout(Symbol<'a>), - Ref(Symbol<'a>), + Input(Keyword<'a>), + Output(Keyword<'a>), + Inout(Keyword<'a>), + Ref(Keyword<'a>), } #[derive(Debug, Node)] @@ -171,7 +171,7 @@ pub struct InterfacePortHeaderIdentifier<'a> { #[derive(Debug, Node)] pub struct InterfacePortHeaderInterface<'a> { - pub nodes: (Symbol<'a>, Option<(Symbol<'a>, ModportIdentifier<'a>)>), + pub nodes: (Keyword<'a>, Option<(Symbol<'a>, ModportIdentifier<'a>)>), } #[derive(Debug, Node)] diff --git a/src/parser/source_text/package_items.rs b/src/parser/source_text/package_items.rs index be30f1d..7c81fe2 100644 --- a/src/parser/source_text/package_items.rs +++ b/src/parser/source_text/package_items.rs @@ -37,10 +37,10 @@ pub enum PackageOrGenerateItemDeclaration<'a> { #[derive(Debug, Node)] pub struct AnonymousProgram<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Symbol<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } diff --git a/src/parser/source_text/system_verilog_source_text.rs b/src/parser/source_text/system_verilog_source_text.rs index fee7368..a91f51a 100644 --- a/src/parser/source_text/system_verilog_source_text.rs +++ b/src/parser/source_text/system_verilog_source_text.rs @@ -78,7 +78,7 @@ pub struct ModuleDeclarationNonansi<'a> { ModuleNonansiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ModuleIdentifier<'a>)>, ), } @@ -89,7 +89,7 @@ pub struct ModuleDeclarationAnsi<'a> { ModuleAnsiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ModuleIdentifier<'a>)>, ), } @@ -105,25 +105,25 @@ pub struct ModuleDeclarationWildcard<'a> { Symbol<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ModuleIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct ModuleDeclarationExternNonansi<'a> { - pub nodes: (Symbol<'a>, ModuleNonansiHeader<'a>), + pub nodes: (Keyword<'a>, ModuleNonansiHeader<'a>), } #[derive(Debug, Node)] pub struct ModuleDeclarationExternAnsi<'a> { - pub nodes: (Symbol<'a>, ModuleAnsiHeader<'a>), + pub nodes: (Keyword<'a>, ModuleAnsiHeader<'a>), } #[derive(Debug, Node)] pub enum ModuleKeyword<'a> { - Module(Symbol<'a>), - Macromodule(Symbol<'a>), + Module(Keyword<'a>), + Macromodule(Keyword<'a>), } #[derive(Debug, Node)] @@ -141,7 +141,7 @@ pub struct InterfaceDeclarationNonansi<'a> { InterfaceNonansiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, ), } @@ -152,7 +152,7 @@ pub struct InterfaceDeclarationAnsi<'a> { InterfaceAnsiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, ), } @@ -161,33 +161,33 @@ pub struct InterfaceDeclarationAnsi<'a> { pub struct InterfaceDeclarationWildcard<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, InterfaceIdentifier<'a>, Paren<'a, Symbol<'a>>, Symbol<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct InterfaceDeclarationExternNonansi<'a> { - pub nodes: (Symbol<'a>, InterfaceNonansiHeader<'a>), + pub nodes: (Keyword<'a>, InterfaceNonansiHeader<'a>), } #[derive(Debug, Node)] pub struct InterfaceDeclarationExternAnsi<'a> { - pub nodes: (Symbol<'a>, InterfaceAnsiHeader<'a>), + pub nodes: (Keyword<'a>, InterfaceAnsiHeader<'a>), } #[derive(Debug, Node)] pub struct InterfaceNonansiHeader<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, InterfaceIdentifier<'a>, Vec>, @@ -201,7 +201,7 @@ pub struct InterfaceNonansiHeader<'a> { pub struct InterfaceAnsiHeader<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, InterfaceIdentifier<'a>, Vec>, @@ -226,7 +226,7 @@ pub struct ProgramDeclarationNonansi<'a> { ProgramNonansiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ProgramIdentifier<'a>)>, ), } @@ -237,7 +237,7 @@ pub struct ProgramDeclarationAnsi<'a> { ProgramAnsiHeader<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ProgramIdentifier<'a>)>, ), } @@ -246,32 +246,32 @@ pub struct ProgramDeclarationAnsi<'a> { pub struct ProgramDeclarationWildcard<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, ProgramIdentifier<'a>, Paren<'a, Symbol<'a>>, Symbol<'a>, Option>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ProgramIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct ProgramDeclarationExternNonansi<'a> { - pub nodes: (Symbol<'a>, ProgramNonansiHeader<'a>), + pub nodes: (Keyword<'a>, ProgramNonansiHeader<'a>), } #[derive(Debug, Node)] pub struct ProgramDeclarationExternAnsi<'a> { - pub nodes: (Symbol<'a>, ProgramAnsiHeader<'a>), + pub nodes: (Keyword<'a>, ProgramAnsiHeader<'a>), } #[derive(Debug, Node)] pub struct ProgramNonansiHeader<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, ProgramIdentifier<'a>, Vec>, @@ -285,7 +285,7 @@ pub struct ProgramNonansiHeader<'a> { pub struct ProgramAnsiHeader<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, ProgramIdentifier<'a>, Vec>, @@ -298,12 +298,12 @@ pub struct ProgramAnsiHeader<'a> { #[derive(Debug, Node)] pub struct CheckerDeclaration<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, CheckerIdentifier<'a>, Option>>>, Symbol<'a>, Vec<(Vec>, CheckerOrGenerateItem<'a>)>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, CheckerIdentifier<'a>)>, ), } @@ -312,26 +312,26 @@ pub struct CheckerDeclaration<'a> { pub struct ClassDeclaration<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, Option>, ClassIdentifier<'a>, Option>, Option<( - Symbol<'a>, + Keyword<'a>, ClassType<'a>, Option>>, )>, - Option<(Symbol<'a>, List, InterfaceClassType<'a>>)>, + Option<(Keyword<'a>, List, InterfaceClassType<'a>>)>, Symbol<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ClassIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct Virtual<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -342,14 +342,14 @@ pub struct InterfaceClassType<'a> { #[derive(Debug, Node)] pub struct InterfaceClassDeclaration<'a> { pub nodes: ( - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, ClassIdentifier<'a>, Option>, - Option<(Symbol<'a>, List, InterfaceClassType<'a>>)>, + Option<(Keyword<'a>, List, InterfaceClassType<'a>>)>, Symbol<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, ClassIdentifier<'a>)>, ), } @@ -370,20 +370,20 @@ pub struct InterfaceClassItemMethod<'a> { #[derive(Debug, Node)] pub struct InterfaceClassMethod<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>, MethodPrototype<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, Keyword<'a>, MethodPrototype<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct PackageDeclaration<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, Option>, PackageIdentifier<'a>, Symbol<'a>, Option>, Vec<(Vec>, PackageItem<'a>)>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, PackageIdentifier<'a>)>, ), } @@ -399,7 +399,7 @@ pub enum TimeunitsDeclaration<'a> { #[derive(Debug, Node)] pub struct TimeunitsDeclarationTimeunit<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, TimeLiteral<'a>, Option<(Symbol<'a>, TimeLiteral<'a>)>, Symbol<'a>, @@ -408,16 +408,16 @@ pub struct TimeunitsDeclarationTimeunit<'a> { #[derive(Debug, Node)] pub struct TimeunitsDeclarationTimeprecision<'a> { - pub nodes: (Symbol<'a>, TimeLiteral<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, TimeLiteral<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, TimeLiteral<'a>, Symbol<'a>, - Symbol<'a>, + Keyword<'a>, TimeLiteral<'a>, Symbol<'a>, ), @@ -426,10 +426,10 @@ pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> { #[derive(Debug, Node)] pub struct TimeunitsDeclarationTimeprecisionTimeunit<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, TimeLiteral<'a>, Symbol<'a>, - Symbol<'a>, + Keyword<'a>, TimeLiteral<'a>, Symbol<'a>, ), diff --git a/src/parser/specify_section/specify_block_declaration.rs b/src/parser/specify_section/specify_block_declaration.rs index 1055c39..7c2cab1 100644 --- a/src/parser/specify_section/specify_block_declaration.rs +++ b/src/parser/specify_section/specify_block_declaration.rs @@ -9,7 +9,7 @@ use nom::IResult; #[derive(Debug, Node)] pub struct SpecifyBlock<'a> { - pub nodes: (Symbol<'a>, Vec>, Symbol<'a>), + pub nodes: (Keyword<'a>, Vec>, Keyword<'a>), } #[derive(Debug, Node)] @@ -23,12 +23,12 @@ pub enum SpecifyItem<'a> { #[derive(Debug, Node)] pub struct PulsestyleDeclaration<'a> { - pub nodes: (Symbol<'a>, ListOfPathOutputs<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>), } #[derive(Debug, Node)] pub struct ShowcancelledDeclaration<'a> { - pub nodes: (Symbol<'a>, ListOfPathOutputs<'a>, Symbol<'a>), + pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/specify_path_delays.rs b/src/parser/specify_section/specify_path_delays.rs index 6f36755..53cd322 100644 --- a/src/parser/specify_section/specify_path_delays.rs +++ b/src/parser/specify_section/specify_path_delays.rs @@ -111,9 +111,9 @@ pub struct DataSourceExpression<'a> { #[derive(Debug, Node)] pub enum EdgeIdentifier<'a> { - Posedge(Symbol<'a>), - Negedge(Symbol<'a>), - Edge(Symbol<'a>), + Posedge(Keyword<'a>), + Negedge(Keyword<'a>), + Edge(Keyword<'a>), } #[derive(Debug, Node)] @@ -126,7 +126,7 @@ pub enum StateDependentPathDeclaration<'a> { #[derive(Debug, Node)] pub struct StateDependentPathDeclarationIfSimple<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ModulePathExpression<'a>>, SimplePathDeclaration<'a>, ), @@ -135,7 +135,7 @@ pub struct StateDependentPathDeclarationIfSimple<'a> { #[derive(Debug, Node)] pub struct StateDependentPathDeclarationIfEdgeSensitive<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren<'a, ModulePathExpression<'a>>, EdgeSensitivePathDeclaration<'a>, ), @@ -143,7 +143,7 @@ pub struct StateDependentPathDeclarationIfEdgeSensitive<'a> { #[derive(Debug, Node)] pub struct StateDependentPathDeclarationIfNone<'a> { - pub nodes: (Symbol<'a>, SimplePathDeclaration<'a>), + pub nodes: (Keyword<'a>, SimplePathDeclaration<'a>), } #[derive(Debug, Node)] diff --git a/src/parser/specify_section/system_timing_check_commands.rs b/src/parser/specify_section/system_timing_check_commands.rs index 648fa5a..cd7024f 100644 --- a/src/parser/specify_section/system_timing_check_commands.rs +++ b/src/parser/specify_section/system_timing_check_commands.rs @@ -26,7 +26,7 @@ pub enum SystemTimingCheck<'a> { #[derive(Debug, Node)] pub struct SetupTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -45,7 +45,7 @@ pub struct SetupTimingCheck<'a> { #[derive(Debug, Node)] pub struct HoldTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -64,7 +64,7 @@ pub struct HoldTimingCheck<'a> { #[derive(Debug, Node)] pub struct SetupholdTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -101,7 +101,7 @@ pub struct SetupholdTimingCheck<'a> { #[derive(Debug, Node)] pub struct RecoveryTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -120,7 +120,7 @@ pub struct RecoveryTimingCheck<'a> { #[derive(Debug, Node)] pub struct RemovalTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -139,7 +139,7 @@ pub struct RemovalTimingCheck<'a> { #[derive(Debug, Node)] pub struct RecremTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -176,7 +176,7 @@ pub struct RecremTimingCheck<'a> { #[derive(Debug, Node)] pub struct SkewTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -195,7 +195,7 @@ pub struct SkewTimingCheck<'a> { #[derive(Debug, Node)] pub struct TimeskewTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -222,7 +222,7 @@ pub struct TimeskewTimingCheck<'a> { #[derive(Debug, Node)] pub struct FullskewTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -251,7 +251,7 @@ pub struct FullskewTimingCheck<'a> { #[derive(Debug, Node)] pub struct PeriodTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -268,7 +268,7 @@ pub struct PeriodTimingCheck<'a> { #[derive(Debug, Node)] pub struct WidthTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( @@ -287,7 +287,7 @@ pub struct WidthTimingCheck<'a> { #[derive(Debug, Node)] pub struct NochargeTimingCheck<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Paren< 'a, ( diff --git a/src/parser/specify_section/system_timing_check_event_definitions.rs b/src/parser/specify_section/system_timing_check_event_definitions.rs index 6a7286c..0ca5169 100644 --- a/src/parser/specify_section/system_timing_check_event_definitions.rs +++ b/src/parser/specify_section/system_timing_check_event_definitions.rs @@ -27,9 +27,9 @@ pub struct ControlledTimingCheckEvent<'a> { #[derive(Debug, Node)] pub enum TimingCheckEventControl<'a> { - Posedge(Symbol<'a>), - Negedge(Symbol<'a>), - Edge(Symbol<'a>), + Posedge(Keyword<'a>), + Negedge(Keyword<'a>), + Edge(Keyword<'a>), EdgeControlSpecifier(EdgeControlSpecifier<'a>), } @@ -42,14 +42,14 @@ pub enum SpecifyTerminalDescriptor<'a> { #[derive(Debug, Node)] pub struct EdgeControlSpecifier<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, Bracket<'a, List, EdgeDescriptor<'a>>>, ), } #[derive(Debug, Node)] pub struct EdgeDescriptor<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -82,7 +82,7 @@ pub struct ScalarTimingCheckConditionBinary<'a> { #[derive(Debug, Node)] pub struct ScalarConstant<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/udp_declaration_and_instantiation/udp_body.rs b/src/parser/udp_declaration_and_instantiation/udp_body.rs index a48a50c..cd3a763 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_body.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_body.rs @@ -17,10 +17,10 @@ pub enum UdpBody<'a> { #[derive(Debug, Node)] pub struct CombinationalBody<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, CombinationalEntry<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } @@ -33,17 +33,17 @@ pub struct CombinationalEntry<'a> { pub struct SequentialBody<'a> { pub nodes: ( Option>, - Symbol<'a>, + Keyword<'a>, SequentialEntry<'a>, Vec>, - Symbol<'a>, + Keyword<'a>, ), } #[derive(Debug, Node)] pub struct UdpInitialStatement<'a> { pub nodes: ( - Symbol<'a>, + Keyword<'a>, OutputPortIdentifier<'a>, Symbol<'a>, InitVal<'a>, @@ -53,7 +53,7 @@ pub struct UdpInitialStatement<'a> { #[derive(Debug, Node)] pub struct InitVal<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] @@ -112,17 +112,17 @@ pub enum NextState<'a> { #[derive(Debug, Node)] pub struct OutputSymbol<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct LevelSymbol<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } #[derive(Debug, Node)] pub struct EdgeSymbol<'a> { - pub nodes: (Symbol<'a>,), + pub nodes: (Keyword<'a>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/udp_declaration_and_instantiation/udp_declaration.rs b/src/parser/udp_declaration_and_instantiation/udp_declaration.rs index 4e831ab..3538fda 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_declaration.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_declaration.rs @@ -12,7 +12,7 @@ use nom::IResult; pub struct UdpNonansiDeclaration<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, UdpIdentifier<'a>, Paren<'a, UdpPortList<'a>>, Symbol<'a>, @@ -23,7 +23,7 @@ pub struct UdpNonansiDeclaration<'a> { pub struct UdpAnsiDeclaration<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, UdpIdentifier<'a>, Paren<'a, UdpDeclarationPortList<'a>>, Symbol<'a>, @@ -46,7 +46,7 @@ pub struct UdpDeclarationNonansi<'a> { UdpPortDeclaration<'a>, Vec>, UdpBody<'a>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, UdpIdentifier<'a>)>, ), } @@ -56,32 +56,32 @@ pub struct UdpDeclarationAnsi<'a> { pub nodes: ( UdpAnsiDeclaration<'a>, UdpBody<'a>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, UdpIdentifier<'a>)>, ), } #[derive(Debug, Node)] pub struct UdpDeclarationExternNonansi<'a> { - pub nodes: (Symbol<'a>, UdpNonansiDeclaration<'a>), + pub nodes: (Keyword<'a>, UdpNonansiDeclaration<'a>), } #[derive(Debug, Node)] pub struct UdpDeclarationExternAnsi<'a> { - pub nodes: (Symbol<'a>, UdpAnsiDeclaration<'a>), + pub nodes: (Keyword<'a>, UdpAnsiDeclaration<'a>), } #[derive(Debug, Node)] pub struct UdpDeclarationWildcard<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, UdpIdentifier<'a>, Paren<'a, Symbol<'a>>, Symbol<'a>, Vec>, UdpBody<'a>, - Symbol<'a>, + Keyword<'a>, Option<(Symbol<'a>, UdpIdentifier<'a>)>, ), } diff --git a/src/parser/udp_declaration_and_instantiation/udp_ports.rs b/src/parser/udp_declaration_and_instantiation/udp_ports.rs index a37c6d1..fdb466c 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_ports.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_ports.rs @@ -41,15 +41,15 @@ pub enum UdpOutputDeclaration<'a> { #[derive(Debug, Node)] pub struct UdpOutputDeclarationNonreg<'a> { - pub nodes: (Vec>, Symbol<'a>, PortIdentifier<'a>), + pub nodes: (Vec>, Keyword<'a>, PortIdentifier<'a>), } #[derive(Debug, Node)] pub struct UdpOutputDeclarationReg<'a> { pub nodes: ( Vec>, - Symbol<'a>, - Symbol<'a>, + Keyword<'a>, + Keyword<'a>, PortIdentifier<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>, ), @@ -59,7 +59,7 @@ pub struct UdpOutputDeclarationReg<'a> { pub struct UdpInputDeclaration<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, ListOfUdpPortIdentifiers<'a>, ), } @@ -68,7 +68,7 @@ pub struct UdpInputDeclaration<'a> { pub struct UdpRegDeclaration<'a> { pub nodes: ( Vec>, - Symbol<'a>, + Keyword<'a>, VariableIdentifier<'a>, ), } diff --git a/src/parser/utils.rs b/src/parser/utils.rs index ccffa1c..0f259ce 100644 --- a/src/parser/utils.rs +++ b/src/parser/utils.rs @@ -266,6 +266,11 @@ pub struct Symbol<'a> { pub nodes: (Span<'a>, Vec>), } +#[derive(Debug, Node)] +pub struct Keyword<'a> { + pub nodes: (Span<'a>, Vec>), +} + #[derive(Debug, Node)] pub enum WhiteSpace<'a> { Space(Span<'a>), @@ -326,7 +331,7 @@ pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol<' } } -pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol<'a>> { +pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Keyword<'a>> { move |s: Span<'a>| { if cfg!(feature = "trace") { println!( @@ -338,7 +343,7 @@ pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol< ); } let (s, x) = map(ws(terminated(tag(t.clone()), peek(none_of(AZ09_)))), |x| { - Symbol { nodes: x } + Keyword { nodes: x } })(s)?; Ok((clear_recursive_flags(s), x)) }