From 4b2430ceef329fe36491c6e5559fe42d15703cad Mon Sep 17 00:00:00 2001 From: dalance Date: Fri, 26 Jul 2019 20:13:57 +0900 Subject: [PATCH] Apply tracable_parser --- sv-parser-macros/Cargo.toml | 2 +- sv-parser-parser/Cargo.toml | 6 +- .../assertion_statements.rs | 26 +-- .../behavioral_statements/case_statements.rs | 36 ++-- .../behavioral_statements/clocking_block.rs | 62 +++--- .../conditional_statements.rs | 10 +- ...ous_assignment_and_net_alias_statements.rs | 14 +- .../looping_statements.rs | 28 +-- .../parallel_and_sequential_blocks.rs | 10 +- .../src/behavioral_statements/patterns.rs | 36 ++-- .../procedural_blocks_and_assignments.rs | 38 ++-- .../src/behavioral_statements/randsequence.rs | 34 +-- .../src/behavioral_statements/statements.rs | 16 +- .../subroutine_call_statements.rs | 4 +- .../timing_control_statements.rs | 68 +++--- .../declarations/assertion_declarations.rs | 194 ++++++++--------- .../declarations/block_item_declarations.rs | 10 +- .../declarations/covergroup_declarations.rs | 133 ++++++------ .../declarations/declaration_assignments.rs | 40 ++-- .../src/declarations/declaration_lists.rs | 26 +-- .../src/declarations/declaration_ranges.rs | 22 +- sv-parser-parser/src/declarations/delays.rs | 14 +- .../src/declarations/function_declarations.rs | 32 +-- .../declarations/interface_declarations.rs | 28 +-- .../src/declarations/let_declarations.rs | 19 +- .../module_parameter_declarations.rs | 12 +- .../declarations/net_and_variable_types.rs | 76 +++---- .../src/declarations/port_declarations.rs | 14 +- .../src/declarations/strengths.rs | 26 +-- .../src/declarations/task_declarations.rs | 18 +- .../src/declarations/type_declarations.rs | 50 ++--- .../src/expressions/concatenations.rs | 32 +-- .../expressions/expression_leftside_values.rs | 18 +- .../src/expressions/expressions.rs | 70 +++---- sv-parser-parser/src/expressions/numbers.rs | 76 +++---- sv-parser-parser/src/expressions/operators.rs | 10 +- sv-parser-parser/src/expressions/primaries.rs | 64 +++--- sv-parser-parser/src/expressions/strings.rs | 4 +- .../src/expressions/subroutine_calls.rs | 42 ++-- sv-parser-parser/src/general/attributes.rs | 4 +- sv-parser-parser/src/general/comments.rs | 6 +- sv-parser-parser/src/general/identifiers.rs | 198 +++++++++--------- .../instantiations/checker_instantiation.rs | 16 +- .../instantiations/generated_instantiation.rs | 32 +-- .../instantiations/interface_instantiation.rs | 2 +- .../instantiations/module_instantiation.rs | 32 +-- .../instantiations/program_instantiation.rs | 2 +- sv-parser-parser/src/lib.rs | 19 +- .../primitive_gate_and_switch_types.rs | 14 +- .../primitive_instantiation_and_instances.rs | 36 ++-- .../primitive_strengths.rs | 16 +- .../primitive_terminals.rs | 12 +- .../src/source_text/checker_items.rs | 20 +- .../src/source_text/class_items.rs | 50 ++--- .../source_text/configuration_source_text.rs | 36 ++-- .../src/source_text/constraints.rs | 52 ++--- .../src/source_text/interface_items.rs | 16 +- .../src/source_text/library_source_text.rs | 10 +- .../src/source_text/module_items.rs | 54 ++--- .../module_parameters_and_ports.rs | 64 +++--- .../src/source_text/package_items.rs | 8 +- .../src/source_text/program_items.rs | 16 +- .../source_text/system_verilog_source_text.rs | 84 ++++---- .../specify_block_declaration.rs | 8 +- .../specify_block_terminals.rs | 12 +- .../specify_path_declarations.rs | 16 +- .../specify_section/specify_path_delays.rs | 34 +-- .../system_timing_check_command_arguments.rs | 32 +-- .../system_timing_check_commands.rs | 26 +-- .../system_timing_check_event_definitions.rs | 24 +-- .../udp_body.rs | 34 +-- .../udp_declaration.rs | 16 +- .../udp_instantiation.rs | 4 +- .../udp_ports.rs | 16 +- sv-parser-parser/src/utils.rs | 191 +++++++++++++++-- sv-parser-syntaxtree/Cargo.toml | 2 +- sv-parser/Cargo.toml | 5 +- 77 files changed, 1410 insertions(+), 1229 deletions(-) diff --git a/sv-parser-macros/Cargo.toml b/sv-parser-macros/Cargo.toml index da87fdb..d83b0ff 100644 --- a/sv-parser-macros/Cargo.toml +++ b/sv-parser-macros/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" proc-macro = true [dependencies] -syn = { version = "0.15.18", features = ["full", "fold", "parsing", "extra-traits"] } quote = "0.6.9" +syn = { version = "0.15.18", features = ["full", "fold", "parsing", "extra-traits"] } diff --git a/sv-parser-parser/Cargo.toml b/sv-parser-parser/Cargo.toml index ce3453e..5129c29 100644 --- a/sv-parser-parser/Cargo.toml +++ b/sv-parser-parser/Cargo.toml @@ -5,14 +5,16 @@ authors = ["dalance "] edition = "2018" [features] -default = [] -trace = [] +default = [] +forward_trace = ["nom-tracable/forward_trace"] +backward_trace = ["nom-tracable/backward_trace"] [dependencies] nom = "5.0.0" nom_locate = { path = "../../nom_locate" } nom-packrat = "0.1.17" nom-recursive = { path = "../../nom-recursive/nom-recursive" } +nom-tracable = { path = "../../nom-tracable/nom-tracable" } str-concat = "*" sv-parser-macros = { path = "../sv-parser-macros" } sv-parser-syntaxtree = { path = "../sv-parser-syntaxtree" } diff --git a/sv-parser-parser/src/behavioral_statements/assertion_statements.rs b/sv-parser-parser/src/behavioral_statements/assertion_statements.rs index 7f4e6b2..f8e19b5 100644 --- a/sv-parser-parser/src/behavioral_statements/assertion_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/assertion_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn assertion_item(s: Span) -> IResult { alt(( map(concurrent_assertion_item, |x| { @@ -14,7 +14,7 @@ pub(crate) fn assertion_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn deferred_immediate_assertion_item( s: Span, ) -> IResult { @@ -23,7 +23,7 @@ pub(crate) fn deferred_immediate_assertion_item( Ok((s, DeferredImmediateAssetionItem { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_assertion_statement( s: Span, ) -> IResult { @@ -40,7 +40,7 @@ pub(crate) fn procedural_assertion_statement( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn immediate_assertion_statement(s: Span) -> IResult { alt(( map(simple_immediate_assertion_statement, |x| { @@ -52,7 +52,7 @@ pub(crate) fn immediate_assertion_statement(s: Span) -> IResult IResult { @@ -69,7 +69,7 @@ pub(crate) fn simple_immediate_assertion_statement( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn simple_immediate_assert_statement( s: Span, ) -> IResult { @@ -79,7 +79,7 @@ pub(crate) fn simple_immediate_assert_statement( Ok((s, SimpleImmediateAssertStatement { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn simple_immediate_assume_statement( s: Span, ) -> IResult { @@ -89,7 +89,7 @@ pub(crate) fn simple_immediate_assume_statement( Ok((s, SimpleImmediateAssumeStatement { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn simple_immediate_cover_statement( s: Span, ) -> IResult { @@ -99,7 +99,7 @@ pub(crate) fn simple_immediate_cover_statement( Ok((s, SimpleImmediateCoverStatement { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn deferred_immediate_assertion_statement( s: Span, ) -> IResult { @@ -116,7 +116,7 @@ pub(crate) fn deferred_immediate_assertion_statement( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn deferred_immediate_assert_statement( s: Span, ) -> IResult { @@ -132,7 +132,7 @@ pub(crate) fn deferred_immediate_assert_statement( )) } -#[parser] +#[tracable_parser] pub(crate) fn deferred_immediate_assume_statement( s: Span, ) -> IResult { @@ -148,7 +148,7 @@ pub(crate) fn deferred_immediate_assume_statement( )) } -#[parser] +#[tracable_parser] pub(crate) fn deferred_immediate_cover_statement( s: Span, ) -> IResult { @@ -164,7 +164,7 @@ pub(crate) fn deferred_immediate_cover_statement( )) } -#[parser] +#[tracable_parser] pub(crate) fn assert_timing(s: Span) -> IResult { alt(( map(symbol("#0"), |x| AssertTiming::Zero(Box::new(x))), diff --git a/sv-parser-parser/src/behavioral_statements/case_statements.rs b/sv-parser-parser/src/behavioral_statements/case_statements.rs index 0575d2c..84e0708 100644 --- a/sv-parser-parser/src/behavioral_statements/case_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/case_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn case_statement(s: Span) -> IResult { alt(( case_statement_normal, @@ -11,7 +11,7 @@ pub(crate) fn case_statement(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn case_statement_normal(s: Span) -> IResult { let (s, a) = opt(unique_priority)(s)?; let (s, b) = case_keyword(s)?; @@ -27,7 +27,7 @@ pub(crate) fn case_statement_normal(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn case_statement_matches(s: Span) -> IResult { let (s, a) = opt(unique_priority)(s)?; let (s, b) = case_keyword(s)?; @@ -44,7 +44,7 @@ pub(crate) fn case_statement_matches(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn case_statement_inside(s: Span) -> IResult { let (s, a) = opt(unique_priority)(s)?; let (s, b) = keyword("case")(s)?; @@ -61,7 +61,7 @@ pub(crate) fn case_statement_inside(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn case_keyword(s: Span) -> IResult { alt(( map(keyword("casez"), |x| CaseKeyword::Casez(Box::new(x))), @@ -70,13 +70,13 @@ pub(crate) fn case_keyword(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn case_expression(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, CaseExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn case_item(s: Span) -> IResult { alt(( case_item_nondefault, @@ -85,7 +85,7 @@ pub(crate) fn case_item(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn case_item_nondefault(s: Span) -> IResult { let (s, a) = list(symbol(","), case_item_expression)(s)?; let (s, b) = symbol(":")(s)?; @@ -96,7 +96,7 @@ pub(crate) fn case_item_nondefault(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn case_item_default(s: Span) -> IResult { let (s, a) = keyword("default")(s)?; let (s, b) = opt(symbol(":"))(s)?; @@ -104,7 +104,7 @@ pub(crate) fn case_item_default(s: Span) -> IResult { Ok((s, CaseItemDefault { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn case_pattern_item(s: Span) -> IResult { alt(( case_pattern_item_nondefault, @@ -113,7 +113,7 @@ pub(crate) fn case_pattern_item(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult { let (s, a) = pattern(s)?; let (s, b) = opt(pair(symbol("&&&"), expression))(s)?; @@ -127,7 +127,7 @@ pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult IResult { alt(( case_inside_item_nondefault, @@ -136,7 +136,7 @@ pub(crate) fn case_inside_item(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult { let (s, a) = open_range_list(s)?; let (s, b) = symbol(":")(s)?; @@ -147,13 +147,13 @@ pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult IResult { let (s, a) = expression(s)?; Ok((s, CaseItemExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn randcase_statement(s: Span) -> IResult { let (s, a) = keyword("randcase")(s)?; let (s, b) = randcase_item(s)?; @@ -168,7 +168,7 @@ pub(crate) fn randcase_statement(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn randcase_item(s: Span) -> IResult { let (s, a) = expression(s)?; let (s, b) = symbol(":")(s)?; @@ -177,13 +177,13 @@ pub(crate) fn randcase_item(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn open_range_list(s: Span) -> IResult { let (s, a) = list(symbol(","), open_value_range)(s)?; Ok((s, OpenRangeList { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn open_value_range(s: Span) -> IResult { let (s, a) = value_range(s)?; Ok((s, OpenValueRange { nodes: (a,) })) diff --git a/sv-parser-parser/src/behavioral_statements/clocking_block.rs b/sv-parser-parser/src/behavioral_statements/clocking_block.rs index 599671b..598449c 100644 --- a/sv-parser-parser/src/behavioral_statements/clocking_block.rs +++ b/sv-parser-parser/src/behavioral_statements/clocking_block.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn clocking_declaration(s: Span) -> IResult { alt((clocking_declaration_local, clocking_declaration_global))(s) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_declaration_local(s: Span) -> IResult { let (s, a) = opt(default)(s)?; let (s, b) = keyword("clocking")(s)?; @@ -25,13 +25,13 @@ pub(crate) fn clocking_declaration_local(s: Span) -> IResult IResult { let (s, a) = keyword("default")(s)?; Ok((s, Default { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_declaration_global(s: Span) -> IResult { let (s, a) = keyword("global")(s)?; let (s, b) = keyword("clocking")(s)?; @@ -48,12 +48,12 @@ pub(crate) fn clocking_declaration_global(s: Span) -> IResult IResult { alt((clocking_event_identifier, clocking_event_expression))(s) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_event_identifier(s: Span) -> IResult { let (s, a) = symbol("@")(s)?; let (s, b) = identifier(s)?; @@ -63,7 +63,7 @@ pub(crate) fn clocking_event_identifier(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_event_expression(s: Span) -> IResult { let (s, a) = symbol("@")(s)?; let (s, b) = paren(event_expression)(s)?; @@ -73,7 +73,7 @@ pub(crate) fn clocking_event_expression(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_item(s: Span) -> IResult { alt(( clocking_item_default, @@ -82,7 +82,7 @@ pub(crate) fn clocking_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_item_default(s: Span) -> IResult { let (s, a) = keyword("default")(s)?; let (s, b) = default_skew(s)?; @@ -93,7 +93,7 @@ pub(crate) fn clocking_item_default(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_item_direction(s: Span) -> IResult { let (s, a) = clocking_direction(s)?; let (s, b) = list_of_clocking_decl_assign(s)?; @@ -104,7 +104,7 @@ pub(crate) fn clocking_item_direction(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_item_assertion(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = assertion_item_declaration(s)?; @@ -114,7 +114,7 @@ pub(crate) fn clocking_item_assertion(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn default_skew(s: Span) -> IResult { alt(( default_skew_input, @@ -123,7 +123,7 @@ pub(crate) fn default_skew(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn default_skew_input(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; let (s, b) = clocking_skew(s)?; @@ -133,7 +133,7 @@ pub(crate) fn default_skew_input(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn default_skew_output(s: Span) -> IResult { let (s, a) = keyword("output")(s)?; let (s, b) = clocking_skew(s)?; @@ -143,7 +143,7 @@ pub(crate) fn default_skew_output(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn default_skew_input_output(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; let (s, b) = clocking_skew(s)?; @@ -157,7 +157,7 @@ pub(crate) fn default_skew_input_output(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_direction(s: Span) -> IResult { alt(( clocking_direction_input, @@ -167,7 +167,7 @@ pub(crate) fn clocking_direction(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_direction_input(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; let (s, b) = opt(clocking_skew)(s)?; @@ -177,7 +177,7 @@ pub(crate) fn clocking_direction_input(s: Span) -> IResult IResult { let (s, a) = keyword("output")(s)?; let (s, b) = opt(clocking_skew)(s)?; @@ -187,7 +187,7 @@ pub(crate) fn clocking_direction_output(s: Span) -> IResult IResult { let (s, a) = keyword("input")(s)?; let (s, b) = opt(clocking_skew)(s)?; @@ -201,26 +201,26 @@ pub(crate) fn clocking_direction_input_output(s: Span) -> IResult IResult { let (s, a) = keyword("inout")(s)?; Ok((s, ClockingDirection::Inout(Box::new(a)))) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_clocking_decl_assign(s: Span) -> IResult { let (s, a) = list(symbol(","), clocking_decl_assign)(s)?; Ok((s, ListOfClockingDeclAssign { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_decl_assign(s: Span) -> IResult { let (s, a) = signal_identifier(s)?; let (s, b) = opt(pair(symbol("="), expression))(s)?; Ok((s, ClockingDeclAssign { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_skew(s: Span) -> IResult { alt(( clocking_skew_edge, @@ -228,7 +228,7 @@ pub(crate) fn clocking_skew(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_skew_edge(s: Span) -> IResult { let (s, a) = edge_identifier(s)?; let (s, b) = opt(delay_control)(s)?; @@ -238,7 +238,7 @@ pub(crate) fn clocking_skew_edge(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_drive(s: Span) -> IResult { let (s, a) = clockvar_expression(s)?; let (s, b) = symbol("<=")(s)?; @@ -252,7 +252,7 @@ pub(crate) fn clocking_drive(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay(s: Span) -> IResult { alt(( cycle_delay_integral, @@ -261,7 +261,7 @@ pub(crate) fn cycle_delay(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_integral(s: Span) -> IResult { let (s, a) = symbol("##")(s)?; let (s, b) = integral_number(s)?; @@ -271,7 +271,7 @@ pub(crate) fn cycle_delay_integral(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_identifier(s: Span) -> IResult { let (s, a) = symbol("##")(s)?; let (s, b) = identifier(s)?; @@ -281,7 +281,7 @@ pub(crate) fn cycle_delay_identifier(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_expression(s: Span) -> IResult { let (s, a) = symbol("##")(s)?; let (s, b) = paren(expression)(s)?; @@ -291,13 +291,13 @@ pub(crate) fn cycle_delay_expression(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn clockvar(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, Clockvar { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn clockvar_expression(s: Span) -> IResult { let (s, a) = clockvar(s)?; let (s, b) = select(s)?; diff --git a/sv-parser-parser/src/behavioral_statements/conditional_statements.rs b/sv-parser-parser/src/behavioral_statements/conditional_statements.rs index a7d03b7..ba693fa 100644 --- a/sv-parser-parser/src/behavioral_statements/conditional_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/conditional_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn conditional_statement(s: Span) -> IResult { let (s, a) = opt(unique_priority)(s)?; let (s, b) = keyword("if")(s)?; @@ -24,7 +24,7 @@ pub(crate) fn conditional_statement(s: Span) -> IResult IResult { alt(( map(keyword("unique0"), |x| UniquePriority::Unique0(Box::new(x))), @@ -36,13 +36,13 @@ pub(crate) fn unique_priority(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn cond_predicate(s: Span) -> IResult { let (s, a) = list(symbol("&&&"), expression_or_cond_pattern)(s)?; Ok((s, CondPredicate { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult { alt(( map(expression, |x| { @@ -55,7 +55,7 @@ pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = keyword("matches")(s)?; diff --git a/sv-parser-parser/src/behavioral_statements/continuous_assignment_and_net_alias_statements.rs b/sv-parser-parser/src/behavioral_statements/continuous_assignment_and_net_alias_statements.rs index 5a5f19b..e218524 100644 --- a/sv-parser-parser/src/behavioral_statements/continuous_assignment_and_net_alias_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/continuous_assignment_and_net_alias_statements.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn continuous_assign(s: Span) -> IResult { alt((continuous_assign_net, continuous_assign_variable))(s) } -#[parser] +#[tracable_parser] pub(crate) fn continuous_assign_net(s: Span) -> IResult { let (s, a) = keyword("assign")(s)?; let (s, b) = opt(drive_strength)(s)?; @@ -23,7 +23,7 @@ pub(crate) fn continuous_assign_net(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn continuous_assign_variable(s: Span) -> IResult { let (s, a) = keyword("assign")(s)?; let (s, b) = opt(delay_control)(s)?; @@ -39,20 +39,20 @@ pub(crate) fn continuous_assign_variable(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), net_assignment)(s)?; Ok((s, ListOfNetAssignments { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn list_of_variable_assignments(s: Span) -> IResult { let (s, a) = list(symbol(","), variable_assignment)(s)?; Ok((s, ListOfVariableAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn net_alias(s: Span) -> IResult { let (s, a) = keyword("alias")(s)?; let (s, b) = net_lvalue(s)?; @@ -69,7 +69,7 @@ pub(crate) fn net_alias(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn net_assignment(s: Span) -> IResult { let (s, a) = net_lvalue(s)?; let (s, b) = symbol("=")(s)?; diff --git a/sv-parser-parser/src/behavioral_statements/looping_statements.rs b/sv-parser-parser/src/behavioral_statements/looping_statements.rs index bcdd733..69c1598 100644 --- a/sv-parser-parser/src/behavioral_statements/looping_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/looping_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn loop_statement(s: Span) -> IResult { alt(( loop_statement_forever, @@ -14,7 +14,7 @@ pub(crate) fn loop_statement(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_forever(s: Span) -> IResult { let (s, a) = keyword("forever")(s)?; let (s, b) = statement_or_null(s)?; @@ -24,7 +24,7 @@ pub(crate) fn loop_statement_forever(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_repeat(s: Span) -> IResult { let (s, a) = keyword("repeat")(s)?; let (s, b) = paren(expression)(s)?; @@ -35,7 +35,7 @@ pub(crate) fn loop_statement_repeat(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_while(s: Span) -> IResult { let (s, a) = keyword("while")(s)?; let (s, b) = paren(expression)(s)?; @@ -46,7 +46,7 @@ pub(crate) fn loop_statement_while(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_for(s: Span) -> IResult { let (s, a) = keyword("for")(s)?; let (s, b) = paren(tuple(( @@ -63,7 +63,7 @@ pub(crate) fn loop_statement_for(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_do_while(s: Span) -> IResult { let (s, a) = keyword("do")(s)?; let (s, b) = statement_or_null(s)?; @@ -78,7 +78,7 @@ pub(crate) fn loop_statement_do_while(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn loop_statement_foreach(s: Span) -> IResult { let (s, a) = keyword("foreach")(s)?; let (s, b) = paren(pair( @@ -92,7 +92,7 @@ pub(crate) fn loop_statement_foreach(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn for_initialization(s: Span) -> IResult { alt(( map(list_of_variable_assignments, |x| { @@ -103,7 +103,7 @@ pub(crate) fn for_initialization(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn for_initialization_declaration(s: Span) -> IResult { let (s, a) = list(symbol(","), for_variable_declaration)(s)?; Ok(( @@ -112,7 +112,7 @@ pub(crate) fn for_initialization_declaration(s: Span) -> IResult IResult { let (s, a) = opt(var)(s)?; let (s, b) = data_type(s)?; @@ -123,20 +123,20 @@ pub(crate) fn for_variable_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("var")(s)?; Ok((s, Var { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn for_step(s: Span) -> IResult { let (s, a) = list(symbol(","), for_step_assignment)(s)?; Ok((s, ForStep { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn for_step_assignment(s: Span) -> IResult { alt(( map(operator_assignment, |x| { @@ -151,7 +151,7 @@ pub(crate) fn for_step_assignment(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn loop_variables(s: Span) -> IResult { let (s, a) = list(symbol(","), opt(index_variable_identifier))(s)?; Ok((s, LoopVariables { nodes: (a,) })) diff --git a/sv-parser-parser/src/behavioral_statements/parallel_and_sequential_blocks.rs b/sv-parser-parser/src/behavioral_statements/parallel_and_sequential_blocks.rs index 13d8ce9..5ef6ba9 100644 --- a/sv-parser-parser/src/behavioral_statements/parallel_and_sequential_blocks.rs +++ b/sv-parser-parser/src/behavioral_statements/parallel_and_sequential_blocks.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn action_block(s: Span) -> IResult { alt(( map(statement_or_null, |x| { @@ -12,7 +12,7 @@ pub(crate) fn action_block(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn action_block_else(s: Span) -> IResult { let (s, a) = opt(statement)(s)?; let (s, b) = keyword("else")(s)?; @@ -23,7 +23,7 @@ pub(crate) fn action_block_else(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn seq_block(s: Span) -> IResult { let (s, a) = keyword("begin")(s)?; let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?; @@ -39,7 +39,7 @@ pub(crate) fn seq_block(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn par_block(s: Span) -> IResult { let (s, a) = keyword("fork")(s)?; let (s, b) = opt(pair(symbol(":"), block_identifier))(s)?; @@ -55,7 +55,7 @@ pub(crate) fn par_block(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn join_keyword(s: Span) -> IResult { alt(( map(keyword("join_any"), |x| JoinKeyword::JoinAny(Box::new(x))), diff --git a/sv-parser-parser/src/behavioral_statements/patterns.rs b/sv-parser-parser/src/behavioral_statements/patterns.rs index 6924ea7..374ba05 100644 --- a/sv-parser-parser/src/behavioral_statements/patterns.rs +++ b/sv-parser-parser/src/behavioral_statements/patterns.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn pattern(s: Span) -> IResult { alt(( pattern_variable, @@ -16,7 +16,7 @@ pub(crate) fn pattern(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn pattern_variable(s: Span) -> IResult { let (s, a) = symbol(".")(s)?; let (s, b) = variable_identifier(s)?; @@ -26,7 +26,7 @@ pub(crate) fn pattern_variable(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pattern_tagged(s: Span) -> IResult { let (s, a) = keyword("tagged")(s)?; let (s, b) = member_identifier(s)?; @@ -37,13 +37,13 @@ pub(crate) fn pattern_tagged(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pattern_list(s: Span) -> IResult { let (s, a) = apostrophe_brace(list(symbol(","), pattern))(s)?; Ok((s, Pattern::List(Box::new(PatternList { nodes: (a,) })))) } -#[parser] +#[tracable_parser] pub(crate) fn pattern_identifier_list(s: Span) -> IResult { let (s, a) = apostrophe_brace(list( symbol(","), @@ -55,7 +55,7 @@ pub(crate) fn pattern_identifier_list(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern(s: Span) -> IResult { alt(( assignment_pattern_list, @@ -65,7 +65,7 @@ pub(crate) fn assignment_pattern(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern_list(s: Span) -> IResult { let (s, a) = apostrophe_brace(list(symbol(","), expression))(s)?; Ok(( @@ -74,7 +74,7 @@ pub(crate) fn assignment_pattern_list(s: Span) -> IResult IResult { let (s, a) = apostrophe_brace(list( symbol(","), @@ -86,7 +86,7 @@ pub(crate) fn assignment_pattern_structure(s: Span) -> IResult IResult { let (s, a) = apostrophe_brace(list( symbol(","), @@ -98,7 +98,7 @@ pub(crate) fn assignment_pattern_array(s: Span) -> IResult IResult { let (s, a) = apostrophe_brace(pair( constant_expression, @@ -110,7 +110,7 @@ pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult IResult { alt(( map(member_identifier, |x| { @@ -122,7 +122,7 @@ pub(crate) fn structure_pattern_key(s: Span) -> IResult IResult { alt(( map(constant_expression, |x| { @@ -134,7 +134,7 @@ pub(crate) fn array_pattern_key(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern_key(s: Span) -> IResult { alt(( map(simple_type, |x| { @@ -147,14 +147,14 @@ pub(crate) fn assignment_pattern_key(s: Span) -> IResult IResult { let (s, a) = opt(assignment_pattern_expression_type)(s)?; let (s, b) = assignment_pattern(s)?; Ok((s, AssignmentPatternExpression { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern_expression_type( s: Span, ) -> IResult { @@ -174,7 +174,7 @@ pub(crate) fn assignment_pattern_expression_type( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn constant_assignment_pattern_expression( s: Span, ) -> IResult { @@ -182,13 +182,13 @@ pub(crate) fn constant_assignment_pattern_expression( Ok((s, ConstantAssignmentPatternExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern_net_lvalue(s: Span) -> IResult { let (s, a) = apostrophe_brace(list(symbol(","), net_lvalue))(s)?; Ok((s, AssignmentPatternNetLvalue { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_pattern_variable_lvalue( s: Span, ) -> IResult { diff --git a/sv-parser-parser/src/behavioral_statements/procedural_blocks_and_assignments.rs b/sv-parser-parser/src/behavioral_statements/procedural_blocks_and_assignments.rs index 9066439..8b9ed2d 100644 --- a/sv-parser-parser/src/behavioral_statements/procedural_blocks_and_assignments.rs +++ b/sv-parser-parser/src/behavioral_statements/procedural_blocks_and_assignments.rs @@ -2,21 +2,21 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn initial_construct(s: Span) -> IResult { let (s, a) = keyword("initial")(s)?; let (s, b) = statement_or_null(s)?; Ok((s, InitialConstruct { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn always_construct(s: Span) -> IResult { let (s, a) = always_keyword(s)?; let (s, b) = statement(s)?; Ok((s, AlwaysConstruct { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn always_keyword(s: Span) -> IResult { alt(( map(keyword("always_comb"), |x| { @@ -32,14 +32,14 @@ pub(crate) fn always_keyword(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn final_construct(s: Span) -> IResult { let (s, a) = keyword("final")(s)?; let (s, b) = function_statement(s)?; Ok((s, FinalConstruct { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn blocking_assignment(s: Span) -> IResult { alt(( blocking_assignment_variable, @@ -52,7 +52,7 @@ pub(crate) fn blocking_assignment(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn blocking_assignment_variable(s: Span) -> IResult { let (s, a) = variable_lvalue(s)?; let (s, b) = symbol("=")(s)?; @@ -67,7 +67,7 @@ pub(crate) fn blocking_assignment_variable(s: Span) -> IResult IResult { let (s, a) = nonrange_variable_lvalue(s)?; let (s, b) = symbol("=")(s)?; @@ -80,7 +80,7 @@ pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult IResult { @@ -100,7 +100,7 @@ pub(crate) fn blocking_assignment_hierarchical_variable( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn operator_assignment(s: Span) -> IResult { let (s, a) = variable_lvalue(s)?; let (s, b) = assignment_operator(s)?; @@ -108,7 +108,7 @@ pub(crate) fn operator_assignment(s: Span) -> IResult Ok((s, OperatorAssignment { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn assignment_operator(s: Span) -> IResult { alt(( map(symbol("="), |x| AssignmentOperator { nodes: (x,) }), @@ -128,7 +128,7 @@ pub(crate) fn assignment_operator(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn nonblocking_assignment(s: Span) -> IResult { let (s, a) = variable_lvalue(s)?; let (s, b) = symbol("<=")(s)?; @@ -142,7 +142,7 @@ pub(crate) fn nonblocking_assignment(s: Span) -> IResult IResult { @@ -156,7 +156,7 @@ pub(crate) fn procedural_continuous_assignment( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_assign( s: Span, ) -> IResult { @@ -170,7 +170,7 @@ pub(crate) fn procedural_continuous_assignment_assign( )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_deassign( s: Span, ) -> IResult { @@ -184,7 +184,7 @@ pub(crate) fn procedural_continuous_assignment_deassign( )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_force_variable( s: Span, ) -> IResult { @@ -198,7 +198,7 @@ pub(crate) fn procedural_continuous_assignment_force_variable( )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_force_net( s: Span, ) -> IResult { @@ -212,7 +212,7 @@ pub(crate) fn procedural_continuous_assignment_force_net( )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_release_variable( s: Span, ) -> IResult { @@ -226,7 +226,7 @@ pub(crate) fn procedural_continuous_assignment_release_variable( )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_continuous_assignment_release_net( s: Span, ) -> IResult { @@ -241,7 +241,7 @@ pub(crate) fn procedural_continuous_assignment_release_net( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn variable_assignment(s: Span) -> IResult { let (s, a) = variable_lvalue(s)?; let (s, b) = symbol("=")(s)?; diff --git a/sv-parser-parser/src/behavioral_statements/randsequence.rs b/sv-parser-parser/src/behavioral_statements/randsequence.rs index ad2f718..b7ebcdb 100644 --- a/sv-parser-parser/src/behavioral_statements/randsequence.rs +++ b/sv-parser-parser/src/behavioral_statements/randsequence.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn randsequence_statement(s: Span) -> IResult { let (s, a) = keyword("randsequence")(s)?; let (s, b) = paren(opt(production_identifier))(s)?; @@ -17,7 +17,7 @@ pub(crate) fn randsequence_statement(s: Span) -> IResult IResult { let (s, a) = opt(data_type_or_void)(s)?; let (s, b) = production_identifier(s)?; @@ -33,7 +33,7 @@ pub(crate) fn production(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn rs_rule(s: Span) -> IResult { let (s, a) = rs_production_list(s)?; let (s, b) = opt(triple( @@ -44,12 +44,12 @@ pub(crate) fn rs_rule(s: Span) -> IResult { Ok((s, RsRule { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn rs_production_list(s: Span) -> IResult { alt((rs_production_list_prod, rs_production_list_join))(s) } -#[parser] +#[tracable_parser] pub(crate) fn rs_production_list_prod(s: Span) -> IResult { let (s, a) = rs_prod(s)?; let (s, b) = many0(rs_prod)(s)?; @@ -59,7 +59,7 @@ pub(crate) fn rs_production_list_prod(s: Span) -> IResult IResult { let (s, a) = keyword("rand")(s)?; let (s, b) = keyword("join")(s)?; @@ -75,7 +75,7 @@ pub(crate) fn rs_production_list_join(s: Span) -> IResult IResult { alt(( map(integral_number, |x| { @@ -88,7 +88,7 @@ pub(crate) fn weight_specification(s: Span) -> IResult IResult { let (s, a) = paren(expression)(s)?; Ok(( @@ -97,13 +97,13 @@ pub(crate) fn weight_specification_expression(s: Span) -> IResult IResult { let (s, a) = brace(pair(many0(data_declaration), many0(statement_or_null)))(s)?; Ok((s, RsCodeBlock { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn rs_prod(s: Span) -> IResult { alt(( map(production_item, |x| RsProd::ProductionItem(Box::new(x))), @@ -114,14 +114,14 @@ pub(crate) fn rs_prod(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn production_item(s: Span) -> IResult { let (s, a) = production_identifier(s)?; let (s, b) = opt(paren(list_of_arguments))(s)?; Ok((s, ProductionItem { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn rs_if_else(s: Span) -> IResult { let (s, a) = keyword("if")(s)?; let (s, b) = paren(expression)(s)?; @@ -135,7 +135,7 @@ pub(crate) fn rs_if_else(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn rs_repeat(s: Span) -> IResult { let (s, a) = keyword("repeat")(s)?; let (s, b) = paren(expression)(s)?; @@ -143,7 +143,7 @@ pub(crate) fn rs_repeat(s: Span) -> IResult { Ok((s, RsRepeat { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn rs_case(s: Span) -> IResult { let (s, a) = keyword("case")(s)?; let (s, b) = paren(case_expression)(s)?; @@ -158,13 +158,13 @@ pub(crate) fn rs_case(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn rs_case_item(s: Span) -> IResult { alt((rs_case_item_nondefault, rs_case_item_default))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn rs_case_item_nondefault(s: Span) -> IResult { let (s, a) = list(symbol(","), case_item_expression)(s)?; let (s, b) = symbol(":")(s)?; @@ -178,7 +178,7 @@ pub(crate) fn rs_case_item_nondefault(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn rs_case_item_default(s: Span) -> IResult { let (s, a) = keyword("default")(s)?; let (s, b) = opt(symbol(":"))(s)?; diff --git a/sv-parser-parser/src/behavioral_statements/statements.rs b/sv-parser-parser/src/behavioral_statements/statements.rs index fe85fe4..34e188d 100644 --- a/sv-parser-parser/src/behavioral_statements/statements.rs +++ b/sv-parser-parser/src/behavioral_statements/statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn statement_or_null(s: Span) -> IResult { alt(( map(statement, |x| StatementOrNull::Statement(Box::new(x))), @@ -10,7 +10,7 @@ pub(crate) fn statement_or_null(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn statement_or_null_attribute(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = symbol(";")(s)?; @@ -21,7 +21,7 @@ pub(crate) fn statement_or_null_attribute(s: Span) -> IResult IResult { let (s, a) = opt(pair(block_identifier, symbol(":")))(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -29,7 +29,7 @@ pub(crate) fn statement(s: Span) -> IResult { Ok((s, Statement { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn statement_item(s: Span) -> IResult { alt(( map(pair(blocking_assignment, symbol(";")), |x| { @@ -89,13 +89,13 @@ pub(crate) fn statement_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn function_statement(s: Span) -> IResult { let (s, a) = statement(s)?; Ok((s, FunctionStatement { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn function_statement_or_null(s: Span) -> IResult { alt(( map(function_statement, |x| { @@ -105,7 +105,7 @@ pub(crate) fn function_statement_or_null(s: Span) -> IResult IResult { @@ -119,7 +119,7 @@ pub(crate) fn function_statement_or_null_attribute( )) } -#[parser] +#[tracable_parser] pub(crate) fn variable_identifier_list(s: Span) -> IResult { let (s, a) = list(symbol(","), variable_identifier)(s)?; Ok((s, VariableIdentifierList { nodes: (a,) })) diff --git a/sv-parser-parser/src/behavioral_statements/subroutine_call_statements.rs b/sv-parser-parser/src/behavioral_statements/subroutine_call_statements.rs index 003618b..0f13bfb 100644 --- a/sv-parser-parser/src/behavioral_statements/subroutine_call_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/subroutine_call_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn subroutine_call_statement(s: Span) -> IResult { alt(( map(pair(subroutine_call, symbol(";")), |x| { @@ -12,7 +12,7 @@ pub(crate) fn subroutine_call_statement(s: Span) -> IResult IResult { diff --git a/sv-parser-parser/src/behavioral_statements/timing_control_statements.rs b/sv-parser-parser/src/behavioral_statements/timing_control_statements.rs index cd25c3e..b1477f4 100644 --- a/sv-parser-parser/src/behavioral_statements/timing_control_statements.rs +++ b/sv-parser-parser/src/behavioral_statements/timing_control_statements.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn procedural_timing_control_statement( s: Span, ) -> IResult { @@ -11,7 +11,7 @@ pub(crate) fn procedural_timing_control_statement( Ok((s, ProceduralTimingControlStatement { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn delay_or_event_control(s: Span) -> IResult { alt(( map(delay_control, |x| DelayOrEventControl::Delay(Box::new(x))), @@ -20,7 +20,7 @@ pub(crate) fn delay_or_event_control(s: Span) -> IResult IResult { let (s, a) = keyword("repeat")(s)?; let (s, b) = paren(expression)(s)?; @@ -31,12 +31,12 @@ pub(crate) fn delay_or_event_control_repeat(s: Span) -> IResult IResult { alt((delay_control_delay, delay_control_mintypmax))(s) } -#[parser] +#[tracable_parser] pub(crate) fn delay_control_delay(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = delay_value(s)?; @@ -46,7 +46,7 @@ pub(crate) fn delay_control_delay(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn delay_control_mintypmax(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(mintypmax_expression)(s)?; @@ -56,7 +56,7 @@ pub(crate) fn delay_control_mintypmax(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn event_control(s: Span) -> IResult { alt(( event_control_event_identifier, @@ -67,7 +67,7 @@ pub(crate) fn event_control(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn event_control_event_identifier(s: Span) -> IResult { let (s, a) = symbol("@")(s)?; let (s, b) = hierarchical_event_identifier(s)?; @@ -77,7 +77,7 @@ pub(crate) fn event_control_event_identifier(s: Span) -> IResult IResult { let (s, a) = symbol("@")(s)?; let (s, b) = paren(event_expression)(s)?; @@ -87,7 +87,7 @@ pub(crate) fn event_control_event_expression(s: Span) -> IResult IResult { let (s, a) = symbol("@*")(s)?; Ok(( @@ -96,7 +96,7 @@ pub(crate) fn event_control_asterisk(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult { let (s, a) = symbol("@")(s)?; let (s, b) = paren(symbol("*"))(s)?; @@ -106,7 +106,7 @@ pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult IResult { let (s, a) = symbol("@")(s)?; let (s, b) = ps_or_hierarchical_sequence_identifier(s)?; @@ -118,7 +118,7 @@ pub(crate) fn event_control_sequence_identifier(s: Span) -> IResult IResult { alt(( event_expression_expression, @@ -130,7 +130,7 @@ pub(crate) fn event_expression(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn event_expression_expression(s: Span) -> IResult { let (s, a) = opt(edge_identifier)(s)?; let (s, b) = expression(s)?; @@ -141,7 +141,7 @@ pub(crate) fn event_expression_expression(s: Span) -> IResult IResult { let (s, a) = sequence_instance(s)?; let (s, b) = opt(pair(keyword("iff"), expression))(s)?; @@ -152,7 +152,7 @@ pub(crate) fn event_expression_sequence(s: Span) -> IResult IResult { let (s, a) = event_expression(s)?; let (s, b) = keyword("or")(s)?; @@ -164,7 +164,7 @@ pub(crate) fn event_expression_or(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn event_expression_comma(s: Span) -> IResult { let (s, a) = event_expression(s)?; let (s, b) = symbol(",")(s)?; @@ -175,7 +175,7 @@ pub(crate) fn event_expression_comma(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn event_expression_paren(s: Span) -> IResult { let (s, a) = paren(event_expression)(s)?; Ok(( @@ -184,7 +184,7 @@ pub(crate) fn event_expression_paren(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn procedural_timing_control(s: Span) -> IResult { alt(( map(delay_control, |x| { @@ -199,7 +199,7 @@ pub(crate) fn procedural_timing_control(s: Span) -> IResult IResult { alt(( jump_statement_return, @@ -208,7 +208,7 @@ pub(crate) fn jump_statement(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn jump_statement_return(s: Span) -> IResult { let (s, a) = keyword("return")(s)?; let (s, b) = opt(expression)(s)?; @@ -219,7 +219,7 @@ pub(crate) fn jump_statement_return(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn jump_statement_break(s: Span) -> IResult { let (s, a) = keyword("break")(s)?; let (s, b) = symbol(";")(s)?; @@ -229,7 +229,7 @@ pub(crate) fn jump_statement_break(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn jump_statement_continue(s: Span) -> IResult { let (s, a) = keyword("continue")(s)?; let (s, b) = symbol(";")(s)?; @@ -239,7 +239,7 @@ pub(crate) fn jump_statement_continue(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn wait_statement(s: Span) -> IResult { alt(( wait_statement_wait, @@ -248,7 +248,7 @@ pub(crate) fn wait_statement(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn wait_statement_wait(s: Span) -> IResult { let (s, a) = keyword("wait")(s)?; let (s, b) = paren(expression)(s)?; @@ -259,7 +259,7 @@ pub(crate) fn wait_statement_wait(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn wait_statement_fork(s: Span) -> IResult { let (s, a) = keyword("wait")(s)?; let (s, b) = keyword("fork")(s)?; @@ -270,7 +270,7 @@ pub(crate) fn wait_statement_fork(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn wait_statement_order(s: Span) -> IResult { let (s, a) = keyword("wait_order")(s)?; let (s, b) = paren(list(symbol(","), hierarchical_identifier))(s)?; @@ -281,12 +281,12 @@ pub(crate) fn wait_statement_order(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn event_trigger(s: Span) -> IResult { alt((event_trigger_named, event_trigger_nonblocking))(s) } -#[parser] +#[tracable_parser] pub(crate) fn event_trigger_named(s: Span) -> IResult { let (s, a) = symbol("->")(s)?; let (s, b) = hierarchical_event_identifier(s)?; @@ -297,7 +297,7 @@ pub(crate) fn event_trigger_named(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult { let (s, a) = symbol("->>")(s)?; let (s, b) = opt(delay_or_event_control)(s)?; @@ -311,7 +311,7 @@ pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn disable_statement(s: Span) -> IResult { alt(( disable_statement_task, @@ -320,7 +320,7 @@ pub(crate) fn disable_statement(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn disable_statement_task(s: Span) -> IResult { let (s, a) = keyword("disable")(s)?; let (s, b) = hierarchical_task_identifier(s)?; @@ -331,7 +331,7 @@ pub(crate) fn disable_statement_task(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn disable_statement_block(s: Span) -> IResult { let (s, a) = keyword("disable")(s)?; let (s, b) = hierarchical_block_identifier(s)?; @@ -342,7 +342,7 @@ pub(crate) fn disable_statement_block(s: Span) -> IResult IResult { let (s, a) = keyword("disable")(s)?; let (s, b) = keyword("fork")(s)?; diff --git a/sv-parser-parser/src/declarations/assertion_declarations.rs b/sv-parser-parser/src/declarations/assertion_declarations.rs index a21ad63..6b3672a 100644 --- a/sv-parser-parser/src/declarations/assertion_declarations.rs +++ b/sv-parser-parser/src/declarations/assertion_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn concurrent_assertion_item(s: Span) -> IResult { alt(( concurrent_assertion_item_statement, @@ -12,7 +12,7 @@ pub(crate) fn concurrent_assertion_item(s: Span) -> IResult IResult { @@ -26,7 +26,7 @@ pub(crate) fn concurrent_assertion_item_statement( )) } -#[parser] +#[tracable_parser] pub(crate) fn concurrent_assertion_statement( s: Span, ) -> IResult { @@ -49,7 +49,7 @@ pub(crate) fn concurrent_assertion_statement( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn assert_property_statement(s: Span) -> IResult { let (s, a) = keyword("assert")(s)?; let (s, b) = keyword("property")(s)?; @@ -63,7 +63,7 @@ pub(crate) fn assert_property_statement(s: Span) -> IResult IResult { let (s, a) = keyword("assume")(s)?; let (s, b) = keyword("property")(s)?; @@ -77,7 +77,7 @@ pub(crate) fn assume_property_statement(s: Span) -> IResult IResult { let (s, a) = keyword("cover")(s)?; let (s, b) = keyword("property")(s)?; @@ -91,7 +91,7 @@ pub(crate) fn cover_property_statement(s: Span) -> IResult IResult { let (s, a) = keyword("expect")(s)?; let (s, b) = paren(property_spec)(s)?; @@ -99,7 +99,7 @@ pub(crate) fn expect_property_statement(s: Span) -> IResult IResult { let (s, a) = keyword("cover")(s)?; let (s, b) = keyword("sequence")(s)?; @@ -121,7 +121,7 @@ pub(crate) fn cover_sequence_statement(s: Span) -> IResult IResult { let (s, a) = keyword("restrict")(s)?; let (s, b) = keyword("property")(s)?; @@ -135,14 +135,14 @@ pub(crate) fn restrict_property_statement(s: Span) -> IResult IResult { let (s, a) = ps_or_hierarchical_property_identifier(s)?; let (s, b) = opt(paren(opt(property_list_of_arguments)))(s)?; Ok((s, PropertyInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn property_list_of_arguments(s: Span) -> IResult { alt(( property_list_of_arguments_ordered, @@ -151,7 +151,7 @@ pub(crate) fn property_list_of_arguments(s: Span) -> IResult IResult { @@ -170,7 +170,7 @@ pub(crate) fn property_list_of_arguments_ordered( )) } -#[parser] +#[tracable_parser] pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult { let (s, a) = list( symbol(","), @@ -182,7 +182,7 @@ pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult IResult { alt(( map(property_expr, |x| { @@ -194,7 +194,7 @@ pub(crate) fn property_actual_arg(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn assertion_item_declaration(s: Span) -> IResult { alt(( map(property_declaration, |x| { @@ -209,7 +209,7 @@ pub(crate) fn assertion_item_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("property")(s)?; let (s, b) = property_identifier(s)?; @@ -228,13 +228,14 @@ pub(crate) fn property_declaration(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), property_port_item)(s)?; Ok((s, PropertyPortList { nodes: (a,) })) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn property_port_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = opt(pair(local, opt(property_lvar_port_direction)))(s)?; @@ -250,13 +251,13 @@ pub(crate) fn property_port_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_lvar_port_direction(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; Ok((s, PropertyLvarPortDirection::Input(Box::new(a)))) } -#[parser] +#[tracable_parser] pub(crate) fn property_formal_type(s: Span) -> IResult { alt(( map(sequence_formal_type, |x| { @@ -269,7 +270,7 @@ pub(crate) fn property_formal_type(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_spec(s: Span) -> IResult { let (s, a) = opt(clocking_event)(s)?; let (s, b) = opt(triple( @@ -281,7 +282,7 @@ pub(crate) fn property_spec(s: Span) -> IResult { Ok((s, PropertySpec { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr(s: Span) -> IResult { alt(( alt(( @@ -324,7 +325,7 @@ pub(crate) fn property_expr(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_strong(s: Span) -> IResult { let (s, a) = keyword("strong")(s)?; let (s, b) = paren(sequence_expr)(s)?; @@ -334,7 +335,7 @@ pub(crate) fn property_expr_strong(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_weak(s: Span) -> IResult { let (s, a) = keyword("weak")(s)?; let (s, b) = paren(sequence_expr)(s)?; @@ -344,7 +345,7 @@ pub(crate) fn property_expr_weak(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_paren(s: Span) -> IResult { let (s, a) = paren(sequence_expr)(s)?; Ok(( @@ -353,7 +354,7 @@ pub(crate) fn property_expr_paren(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_not(s: Span) -> IResult { let (s, a) = keyword("not")(s)?; let (s, b) = property_expr(s)?; @@ -364,7 +365,7 @@ pub(crate) fn property_expr_not(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_or(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("or")(s)?; @@ -376,7 +377,7 @@ pub(crate) fn property_expr_or(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_and(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("and")(s)?; @@ -388,7 +389,7 @@ pub(crate) fn property_expr_and(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = symbol("|->")(s)?; @@ -402,7 +403,7 @@ pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult IResult { let (s, a) = sequence_expr(s)?; let (s, b) = symbol("|=>")(s)?; @@ -415,7 +416,7 @@ pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult IResult { let (s, a) = keyword("if")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -429,7 +430,7 @@ pub(crate) fn property_expr_if(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_case(s: Span) -> IResult { let (s, a) = keyword("case")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -445,7 +446,7 @@ pub(crate) fn property_expr_case(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = symbol("#-#")(s)?; @@ -459,7 +460,7 @@ pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult IResult { let (s, a) = sequence_expr(s)?; let (s, b) = symbol("#=#")(s)?; @@ -472,7 +473,7 @@ pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult IResult { let (s, a) = keyword("nexttime")(s)?; let (s, b) = opt(bracket(constant_expression))(s)?; @@ -483,7 +484,7 @@ pub(crate) fn property_expr_nexttime(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult { let (s, a) = keyword("s_nexttime")(s)?; let (s, b) = opt(bracket(constant_expression))(s)?; @@ -494,7 +495,7 @@ pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_always(s: Span) -> IResult { let (s, a) = keyword("always")(s)?; let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?; @@ -505,7 +506,7 @@ pub(crate) fn property_expr_always(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_s_always(s: Span) -> IResult { let (s, a) = keyword("s_always")(s)?; let (s, b) = bracket(cycle_delay_const_range_expression)(s)?; @@ -516,7 +517,7 @@ pub(crate) fn property_expr_s_always(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_eventually(s: Span) -> IResult { let (s, a) = keyword("eventually")(s)?; let (s, b) = bracket(constant_range)(s)?; @@ -527,7 +528,7 @@ pub(crate) fn property_expr_eventually(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_s_eventually(s: Span) -> IResult { let (s, a) = keyword("s_eventually")(s)?; let (s, b) = opt(bracket(cycle_delay_const_range_expression))(s)?; @@ -539,7 +540,7 @@ pub(crate) fn property_expr_s_eventually(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_until(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("until")(s)?; @@ -551,7 +552,7 @@ pub(crate) fn property_expr_until(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_s_until(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("s_until")(s)?; @@ -563,7 +564,7 @@ pub(crate) fn property_expr_s_until(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_until_with(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("until_with")(s)?; @@ -575,7 +576,7 @@ pub(crate) fn property_expr_until_with(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_s_until_with(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("s_until_with")(s)?; @@ -587,7 +588,7 @@ pub(crate) fn property_expr_s_until_with(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_implies(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("implies")(s)?; @@ -599,7 +600,7 @@ pub(crate) fn property_expr_implies(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_expr_iff(s: Span) -> IResult { let (s, a) = property_expr(s)?; let (s, b) = keyword("iff")(s)?; @@ -610,7 +611,7 @@ pub(crate) fn property_expr_iff(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_accept_on(s: Span) -> IResult { let (s, a) = keyword("accept_on")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -621,7 +622,7 @@ pub(crate) fn property_expr_accept_on(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_reject_on(s: Span) -> IResult { let (s, a) = keyword("reject_on")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -632,7 +633,7 @@ pub(crate) fn property_expr_reject_on(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult { let (s, a) = keyword("sync_accept_on")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -643,7 +644,7 @@ pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult IResult { let (s, a) = keyword("sync_reject_on")(s)?; let (s, b) = paren(expression_or_dist)(s)?; @@ -654,7 +655,7 @@ pub(crate) fn property_expr_sync_reject_on(s: Span) -> IResult IResult { let (s, a) = clocking_event(s)?; let (s, b) = property_expr(s)?; @@ -664,13 +665,13 @@ pub(crate) fn property_expr_clocking_event(s: Span) -> IResult IResult { alt((property_case_item_nondefault, property_case_item_default))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn property_case_item_nondefault(s: Span) -> IResult { let (s, a) = list(symbol(","), expression_or_dist)(s)?; let (s, b) = symbol(":")(s)?; @@ -684,7 +685,7 @@ pub(crate) fn property_case_item_nondefault(s: Span) -> IResult IResult { let (s, a) = keyword("default")(s)?; let (s, b) = opt(symbol(":"))(s)?; @@ -698,7 +699,7 @@ pub(crate) fn property_case_item_default(s: Span) -> IResult IResult { let (s, a) = keyword("sequence")(s)?; let (s, b) = sequence_identifier(s)?; @@ -717,13 +718,14 @@ pub(crate) fn sequence_declaration(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), sequence_port_item)(s)?; Ok((s, SequencePortList { nodes: (a,) })) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn sequence_port_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = opt(pair(local, opt(sequence_lvar_port_direction)))(s)?; @@ -739,7 +741,7 @@ pub(crate) fn sequence_port_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult { alt(( map(keyword("input"), |x| { @@ -754,7 +756,7 @@ pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult IResult { alt(( map(data_type_or_implicit, |x| { @@ -769,7 +771,7 @@ pub(crate) fn sequence_formal_type(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr(s: Span) -> IResult { alt(( sequence_expr_cycle_delay_expr, @@ -787,7 +789,7 @@ pub(crate) fn sequence_expr(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult { let (s, a) = cycle_delay_range(s)?; let (s, b) = sequence_expr(s)?; @@ -799,7 +801,7 @@ pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult IResult { let (s, a) = sequence_expr(s)?; let (s, b) = cycle_delay_range(s)?; @@ -814,7 +816,7 @@ pub(crate) fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult IResult { let (s, a) = expression_or_dist(s)?; let (s, b) = opt(boolean_abbrev)(s)?; @@ -824,7 +826,7 @@ pub(crate) fn sequence_expr_expression(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_instance(s: Span) -> IResult { let (s, a) = sequence_instance(s)?; let (s, b) = opt(sequence_abbrev)(s)?; @@ -834,7 +836,7 @@ pub(crate) fn sequence_expr_instance(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_paren(s: Span) -> IResult { let (s, a) = paren(pair( sequence_expr, @@ -848,7 +850,7 @@ pub(crate) fn sequence_expr_paren(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_and(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = keyword("and")(s)?; @@ -860,7 +862,7 @@ pub(crate) fn sequence_expr_and(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_intersect(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = keyword("intersect")(s)?; @@ -872,7 +874,7 @@ pub(crate) fn sequence_expr_intersect(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_or(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = keyword("or")(s)?; @@ -883,7 +885,7 @@ pub(crate) fn sequence_expr_or(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_first_match(s: Span) -> IResult { let (s, a) = keyword("first_match")(s)?; let (s, b) = paren(pair( @@ -897,7 +899,7 @@ pub(crate) fn sequence_expr_first_match(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_throughout(s: Span) -> IResult { let (s, a) = expression_or_dist(s)?; let (s, b) = keyword("throughout")(s)?; @@ -909,7 +911,7 @@ pub(crate) fn sequence_expr_throughout(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_within(s: Span) -> IResult { let (s, a) = sequence_expr(s)?; let (s, b) = keyword("within")(s)?; @@ -920,7 +922,7 @@ pub(crate) fn sequence_expr_within(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult { let (s, a) = clocking_event(s)?; let (s, b) = sequence_expr(s)?; @@ -930,7 +932,7 @@ pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult IResult { alt(( cycle_delay_range_primary, @@ -940,7 +942,7 @@ pub(crate) fn cycle_delay_range(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult { let (s, a) = symbol("##")(s)?; let (s, b) = constant_primary(s)?; @@ -950,7 +952,7 @@ pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult IResult { let (s, a) = symbol("##")(s)?; let (s, b) = bracket(cycle_delay_const_range_expression)(s)?; @@ -960,7 +962,7 @@ pub(crate) fn cycle_delay_range_expression(s: Span) -> IResult IResult { let (s, a) = symbol("##")(s)?; let (s, b) = bracket(symbol("*"))(s)?; @@ -970,7 +972,7 @@ pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult IResult { let (s, a) = symbol("##")(s)?; let (s, b) = bracket(symbol("+"))(s)?; @@ -980,7 +982,7 @@ pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_method_call(s: Span) -> IResult { let (s, a) = sequence_instance(s)?; let (s, b) = symbol(".")(s)?; @@ -988,7 +990,7 @@ pub(crate) fn sequence_method_call(s: Span) -> IResult Ok((s, SequenceMethodCall { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_match_item(s: Span) -> IResult { alt(( map(operator_assignment, |x| { @@ -1003,14 +1005,14 @@ pub(crate) fn sequence_match_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_instance(s: Span) -> IResult { let (s, a) = ps_or_hierarchical_sequence_identifier(s)?; let (s, b) = opt(paren(opt(sequence_list_of_arguments)))(s)?; Ok((s, SequenceInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult { alt(( sequence_list_of_arguments_ordered, @@ -1019,7 +1021,7 @@ pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult IResult { @@ -1038,7 +1040,7 @@ pub(crate) fn sequence_list_of_arguments_ordered( )) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult { let (s, a) = list( symbol(","), @@ -1050,7 +1052,7 @@ pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult IResult { alt(( map(event_expression, |x| { @@ -1062,7 +1064,7 @@ pub(crate) fn sequence_actual_arg(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn boolean_abbrev(s: Span) -> IResult { alt(( map(consecutive_repetition, |x| { @@ -1077,13 +1079,13 @@ pub(crate) fn boolean_abbrev(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_abbrev(s: Span) -> IResult { let (s, a) = consecutive_repetition(s)?; Ok((s, SequenceAbbrev { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn consecutive_repetition(s: Span) -> IResult { alt(( consecutive_repetition_expression, @@ -1092,7 +1094,7 @@ pub(crate) fn consecutive_repetition(s: Span) -> IResult IResult { let (s, a) = bracket(pair(symbol("*"), const_or_range_expression))(s)?; Ok(( @@ -1103,7 +1105,7 @@ pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult IResult { let (s, a) = bracket(symbol("*"))(s)?; Ok(( @@ -1112,7 +1114,7 @@ pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult IResult { let (s, a) = bracket(symbol("+"))(s)?; Ok(( @@ -1121,19 +1123,19 @@ pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult IResult { let (s, a) = bracket(pair(symbol("="), const_or_range_expression))(s)?; Ok((s, NonConsecutiveRepetition { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn goto_repetition(s: Span) -> IResult { let (s, a) = bracket(pair(symbol("->"), const_or_range_expression))(s)?; Ok((s, GotoRepetition { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn const_or_range_expression(s: Span) -> IResult { alt(( map(constant_expression, |x| { @@ -1145,7 +1147,7 @@ pub(crate) fn const_or_range_expression(s: Span) -> IResult IResult { @@ -1156,7 +1158,7 @@ pub(crate) fn cycle_delay_const_range_expression( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_const_range_expression_binary( s: Span, ) -> IResult { @@ -1172,7 +1174,7 @@ pub(crate) fn cycle_delay_const_range_expression_binary( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn cycle_delay_const_range_expression_dollar( s: Span, ) -> IResult { @@ -1188,14 +1190,14 @@ pub(crate) fn cycle_delay_const_range_expression_dollar( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn expression_or_dist(s: Span) -> IResult { let (s, a) = expression(s)?; let (s, b) = opt(pair(keyword("dist"), brace(dist_list)))(s)?; Ok((s, ExpressionOrDist { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn assertion_variable_declaration( s: Span, ) -> IResult { diff --git a/sv-parser-parser/src/declarations/block_item_declarations.rs b/sv-parser-parser/src/declarations/block_item_declarations.rs index 837367d..80a51f8 100644 --- a/sv-parser-parser/src/declarations/block_item_declarations.rs +++ b/sv-parser-parser/src/declarations/block_item_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn block_item_declaration(s: Span) -> IResult { alt(( block_item_declaration_data, @@ -13,7 +13,7 @@ pub(crate) fn block_item_declaration(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = data_declaration(s)?; @@ -23,7 +23,7 @@ pub(crate) fn block_item_declaration_data(s: Span) -> IResult IResult { @@ -38,7 +38,7 @@ pub(crate) fn block_item_declaration_local_parameter( )) } -#[parser] +#[tracable_parser] pub(crate) fn block_item_declaration_parameter(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = parameter_declaration(s)?; @@ -51,7 +51,7 @@ pub(crate) fn block_item_declaration_parameter(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = let_declaration(s)?; diff --git a/sv-parser-parser/src/declarations/covergroup_declarations.rs b/sv-parser-parser/src/declarations/covergroup_declarations.rs index 821fe7b..438d5df 100644 --- a/sv-parser-parser/src/declarations/covergroup_declarations.rs +++ b/sv-parser-parser/src/declarations/covergroup_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn covergroup_declaration(s: Span) -> IResult { let (s, a) = keyword("covergroup")(s)?; let (s, b) = covergroup_identifier(s)?; @@ -20,12 +20,12 @@ pub(crate) fn covergroup_declaration(s: Span) -> IResult IResult { alt((coverage_spec_or_option_spec, coverage_spec_or_option_option))(s) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_spec_or_option_spec(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = coverage_spec(s)?; @@ -35,7 +35,7 @@ pub(crate) fn coverage_spec_or_option_spec(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = coverage_option(s)?; @@ -46,12 +46,12 @@ pub(crate) fn coverage_spec_or_option_option(s: Span) -> IResult IResult { alt((coverage_option_option, coverage_option_type_option))(s) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_option_option(s: Span) -> IResult { let (s, a) = keyword("option")(s)?; let (s, b) = symbol(".")(s)?; @@ -66,7 +66,7 @@ pub(crate) fn coverage_option_option(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_option_type_option(s: Span) -> IResult { let (s, a) = keyword("type_option")(s)?; let (s, b) = symbol(".")(s)?; @@ -81,7 +81,7 @@ pub(crate) fn coverage_option_type_option(s: Span) -> IResult IResult { alt(( map(cover_point, |x| CoverageSpec::CoverPoint(Box::new(x))), @@ -89,7 +89,7 @@ pub(crate) fn coverage_spec(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_event(s: Span) -> IResult { alt(( map(clocking_event, |x| { @@ -100,7 +100,7 @@ pub(crate) fn coverage_event(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_event_sample(s: Span) -> IResult { let (s, a) = keyword("with")(s)?; let (s, b) = keyword("function")(s)?; @@ -114,7 +114,7 @@ pub(crate) fn coverage_event_sample(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn coverage_event_at(s: Span) -> IResult { let (s, a) = symbol("@@")(s)?; let (s, b) = paren(block_event_expression)(s)?; @@ -124,7 +124,7 @@ pub(crate) fn coverage_event_at(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn block_event_expression(s: Span) -> IResult { alt(( block_event_expression_or, @@ -134,7 +134,7 @@ pub(crate) fn block_event_expression(s: Span) -> IResult IResult { let (s, a) = block_event_expression(s)?; let (s, b) = keyword("or")(s)?; @@ -145,7 +145,7 @@ pub(crate) fn block_event_expression_or(s: Span) -> IResult IResult { let (s, a) = keyword("begin")(s)?; let (s, b) = hierarchical_btf_identifier(s)?; @@ -155,7 +155,7 @@ pub(crate) fn block_event_expression_begin(s: Span) -> IResult IResult { let (s, a) = keyword("end")(s)?; let (s, b) = hierarchical_btf_identifier(s)?; @@ -165,7 +165,7 @@ pub(crate) fn block_event_expression_end(s: Span) -> IResult IResult { alt(( map(hierarchical_tf_identifier, |x| { @@ -178,7 +178,7 @@ pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult IResult { @@ -192,7 +192,7 @@ pub(crate) fn hierarchical_btf_identifier_method( )) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_identifier_or_class_scope( s: Span, ) -> IResult { @@ -207,6 +207,7 @@ pub(crate) fn hierarchical_identifier_or_class_scope( } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn cover_point(s: Span) -> IResult { let (s, a) = opt(triple( ambiguous_opt(data_type_or_implicit), @@ -225,7 +226,7 @@ pub(crate) fn cover_point(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_empty(s: Span) -> IResult { alt(( bins_or_empty_non_empty, @@ -233,7 +234,7 @@ pub(crate) fn bins_or_empty(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult { let (s, a) = brace(pair( many0(attribute_instance), @@ -245,7 +246,7 @@ pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_options(s: Span) -> IResult { alt(( map(coverage_option, |x| { @@ -260,7 +261,7 @@ pub(crate) fn bins_or_options(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult { let (s, a) = opt(wildcard)(s)?; let (s, b) = bins_keyword(s)?; @@ -278,13 +279,13 @@ pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult IResult { let (s, a) = keyword("wildcard")(s)?; Ok((s, Wildcard { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_options_cover_point(s: Span) -> IResult { let (s, a) = opt(wildcard)(s)?; let (s, b) = bins_keyword(s)?; @@ -303,7 +304,7 @@ pub(crate) fn bins_or_options_cover_point(s: Span) -> IResult IResult { let (s, a) = opt(wildcard)(s)?; let (s, b) = bins_keyword(s)?; @@ -320,7 +321,7 @@ pub(crate) fn bins_or_options_set_covergroup(s: Span) -> IResult IResult { let (s, a) = opt(wildcard)(s)?; let (s, b) = bins_keyword(s)?; @@ -337,7 +338,7 @@ pub(crate) fn bins_or_options_trans_list(s: Span) -> IResult IResult { let (s, a) = bins_keyword(s)?; let (s, b) = bin_identifier(s)?; @@ -353,7 +354,7 @@ pub(crate) fn bins_or_options_default(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult { let (s, a) = bins_keyword(s)?; let (s, b) = bin_identifier(s)?; @@ -369,7 +370,7 @@ pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult IResult { alt(( map(keyword("bins"), |x| BinsKeyword::Bins(Box::new(x))), @@ -382,20 +383,20 @@ pub(crate) fn bins_keyword(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn trans_list(s: Span) -> IResult { let (s, a) = list(symbol(","), paren(trans_set))(s)?; Ok((s, TransList { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn trans_set(s: Span) -> IResult { let (s, a) = list(symbol("=>"), trans_range_list)(s)?; Ok((s, TransSet { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn trans_range_list(s: Span) -> IResult { alt(( map(trans_item, |x| TransRangeList::TransItem(Box::new(x))), @@ -406,7 +407,7 @@ pub(crate) fn trans_range_list(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult { let (s, a) = trans_item(s)?; let (s, b) = bracket(pair(symbol("*"), repeat_range))(s)?; @@ -417,7 +418,7 @@ pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult IResult { let (s, a) = trans_item(s)?; let (s, b) = bracket(pair(symbol("->"), repeat_range))(s)?; @@ -428,7 +429,7 @@ pub(crate) fn trans_range_list_arrow(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn trans_range_list_equal(s: Span) -> IResult { let (s, a) = trans_item(s)?; let (s, b) = bracket(pair(symbol("="), repeat_range))(s)?; @@ -438,13 +439,13 @@ pub(crate) fn trans_range_list_equal(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn trans_item(s: Span) -> IResult { let (s, a) = covergroup_range_list(s)?; Ok((s, TransItem { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn repeat_range(s: Span) -> IResult { alt(( map(covergroup_expression, |x| { @@ -455,7 +456,7 @@ pub(crate) fn repeat_range(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn repeat_range_binary(s: Span) -> IResult { let (s, a) = covergroup_expression(s)?; let (s, b) = symbol(":")(s)?; @@ -466,7 +467,7 @@ pub(crate) fn repeat_range_binary(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn cover_cross(s: Span) -> IResult { let (s, a) = opt(pair(cross_identifier, symbol(":")))(s)?; let (s, b) = keyword("cross")(s)?; @@ -481,14 +482,14 @@ pub(crate) fn cover_cross(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_cross_items(s: Span) -> IResult { let (s, a) = cross_item(s)?; let (s, b) = list(symbol(","), cross_item)(s)?; Ok((s, ListOfCrossItems { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn cross_item(s: Span) -> IResult { alt(( map(cover_point_identifier, |x| { @@ -500,7 +501,7 @@ pub(crate) fn cross_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn cross_body(s: Span) -> IResult { alt(( cross_body_non_empty, @@ -508,7 +509,7 @@ pub(crate) fn cross_body(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn cross_body_non_empty(s: Span) -> IResult { let (s, a) = brace(many0(pair(cross_body_item, symbol(";"))))(s)?; Ok(( @@ -517,7 +518,7 @@ pub(crate) fn cross_body_non_empty(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn cross_body_item(s: Span) -> IResult { alt(( map(function_declaration, |x| { @@ -529,7 +530,7 @@ pub(crate) fn cross_body_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bins_selection_or_option(s: Span) -> IResult { alt(( bins_selection_or_option_coverage, @@ -537,7 +538,7 @@ pub(crate) fn bins_selection_or_option(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = coverage_option(s)?; @@ -547,7 +548,7 @@ pub(crate) fn bins_selection_or_option_coverage(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = bins_selection(s)?; @@ -557,7 +558,7 @@ pub(crate) fn bins_selection_or_option_bins(s: Span) -> IResult IResult { let (s, a) = bins_keyword(s)?; let (s, b) = bin_identifier(s)?; @@ -572,7 +573,7 @@ pub(crate) fn bins_selection(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn select_expression(s: Span) -> IResult { alt(( map(select_condition, |x| { @@ -590,7 +591,7 @@ pub(crate) fn select_expression(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn select_expression_not(s: Span) -> IResult { let (s, a) = symbol("!")(s)?; let (s, b) = select_condition(s)?; @@ -601,7 +602,7 @@ pub(crate) fn select_expression_not(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn select_expression_and(s: Span) -> IResult { let (s, a) = select_expression(s)?; let (s, b) = symbol("&&")(s)?; @@ -613,7 +614,7 @@ pub(crate) fn select_expression_and(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn select_expression_or(s: Span) -> IResult { let (s, a) = select_expression(s)?; let (s, b) = symbol("||")(s)?; @@ -624,7 +625,7 @@ pub(crate) fn select_expression_or(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn select_expression_paren(s: Span) -> IResult { let (s, a) = paren(select_expression)(s)?; Ok(( @@ -634,7 +635,7 @@ pub(crate) fn select_expression_paren(s: Span) -> IResult IResult { let (s, a) = select_expression(s)?; let (s, b) = keyword("with")(s)?; @@ -649,7 +650,7 @@ pub(crate) fn select_expression_with(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn select_expression_cross_set(s: Span) -> IResult { let (s, a) = cross_set_expression(s)?; let (s, b) = opt(pair(keyword("matches"), integer_covergroup_expression))(s)?; @@ -659,7 +660,7 @@ pub(crate) fn select_expression_cross_set(s: Span) -> IResult IResult { let (s, a) = keyword("binsof")(s)?; let (s, b) = paren(bins_expression)(s)?; @@ -667,7 +668,7 @@ pub(crate) fn select_condition(s: Span) -> IResult { Ok((s, SelectCondition { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn bins_expression(s: Span) -> IResult { alt(( map(variable_identifier, |x| { @@ -677,7 +678,7 @@ pub(crate) fn bins_expression(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bins_expression_cover_point(s: Span) -> IResult { let (s, a) = cover_point_identifier(s)?; let (s, b) = opt(pair(symbol("."), bin_identifier))(s)?; @@ -688,13 +689,13 @@ pub(crate) fn bins_expression_cover_point(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), covergroup_value_range)(s)?; Ok((s, CovergroupRangeList { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn covergroup_value_range(s: Span) -> IResult { alt(( map(covergroup_expression, |x| { @@ -704,7 +705,7 @@ pub(crate) fn covergroup_value_range(s: Span) -> IResult IResult { let (s, a) = bracket(triple( covergroup_expression, @@ -717,31 +718,31 @@ pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult IResult { let (s, a) = covergroup_expression(s)?; Ok((s, WithCovergroupExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn set_covergroup_expression(s: Span) -> IResult { let (s, a) = covergroup_expression(s)?; Ok((s, SetCovergroupExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn integer_covergroup_expression(s: Span) -> IResult { let (s, a) = covergroup_expression(s)?; Ok((s, IntegerCovergroupExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn cross_set_expression(s: Span) -> IResult { let (s, a) = covergroup_expression(s)?; Ok((s, CrossSetExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn covergroup_expression(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, CovergroupExpression { nodes: (a,) })) diff --git a/sv-parser-parser/src/declarations/declaration_assignments.rs b/sv-parser-parser/src/declarations/declaration_assignments.rs index 0fc43e1..cdfc01b 100644 --- a/sv-parser-parser/src/declarations/declaration_assignments.rs +++ b/sv-parser-parser/src/declarations/declaration_assignments.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn defparam_assignment(s: Span) -> IResult { let (s, a) = hierarchical_parameter_identifier(s)?; let (s, b) = symbol("=")(s)?; @@ -10,7 +10,7 @@ pub(crate) fn defparam_assignment(s: Span) -> IResult Ok((s, DefparamAssignment { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn net_decl_assignment(s: Span) -> IResult { let (s, a) = net_identifier(s)?; let (s, b) = many0(unpacked_dimension)(s)?; @@ -18,7 +18,7 @@ pub(crate) fn net_decl_assignment(s: Span) -> IResult { Ok((s, NetDeclAssignment { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn param_assignment(s: Span) -> IResult { let (s, a) = parameter_identifier(s)?; let (s, b) = many0(unpacked_dimension)(s)?; @@ -26,7 +26,7 @@ pub(crate) fn param_assignment(s: Span) -> IResult { Ok((s, ParamAssignment { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn specparam_assignment(s: Span) -> IResult { alt(( specparam_assignment_mintypmax, @@ -36,7 +36,7 @@ pub(crate) fn specparam_assignment(s: Span) -> IResult IResult { let (s, a) = specparam_identifier(s)?; let (s, b) = symbol("=")(s)?; @@ -47,14 +47,14 @@ pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult IResult { let (s, a) = type_identifier(s)?; let (s, b) = opt(pair(symbol("="), data_type))(s)?; Ok((s, TypeAssignment { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn pulse_control_specparam(s: Span) -> IResult { alt(( pulse_control_specparam_without_descriptor, @@ -62,7 +62,7 @@ pub(crate) fn pulse_control_specparam(s: Span) -> IResult IResult { @@ -80,7 +80,7 @@ pub(crate) fn pulse_control_specparam_without_descriptor( )) } -#[parser] +#[tracable_parser] pub(crate) fn pulse_control_specparam_with_descriptor( s: Span, ) -> IResult { @@ -101,25 +101,25 @@ pub(crate) fn pulse_control_specparam_with_descriptor( )) } -#[parser] +#[tracable_parser] pub(crate) fn error_limit_value(s: Span) -> IResult { let (s, a) = limit_value(s)?; Ok((s, ErrorLimitValue { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn reject_limit_value(s: Span) -> IResult { let (s, a) = limit_value(s)?; Ok((s, RejectLimitValue { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn limit_value(s: Span) -> IResult { let (s, a) = constant_mintypmax_expression(s)?; Ok((s, LimitValue { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn variable_decl_assignment(s: Span) -> IResult { alt(( variable_decl_assignment_variable, @@ -128,7 +128,7 @@ pub(crate) fn variable_decl_assignment(s: Span) -> IResult IResult { let (s, a) = variable_identifier(s)?; let (s, b) = many0(variable_dimension)(s)?; @@ -141,7 +141,7 @@ pub(crate) fn variable_decl_assignment_variable(s: Span) -> IResult IResult { @@ -157,7 +157,7 @@ pub(crate) fn variable_decl_assignment_dynamic_array( )) } -#[parser] +#[tracable_parser] pub(crate) fn variable_decl_assignment_class(s: Span) -> IResult { let (s, a) = class_variable_identifier(s)?; let (s, b) = opt(pair(symbol("="), class_new))(s)?; @@ -167,12 +167,12 @@ pub(crate) fn variable_decl_assignment_class(s: Span) -> IResult IResult { alt((class_new_argument, class_new_expression))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_new_argument(s: Span) -> IResult { let (s, a) = opt(class_scope)(s)?; let (s, b) = keyword("new")(s)?; @@ -183,7 +183,7 @@ pub(crate) fn class_new_argument(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_new_expression(s: Span) -> IResult { let (s, a) = keyword("new")(s)?; let (s, b) = expression(s)?; @@ -193,7 +193,7 @@ pub(crate) fn class_new_expression(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn dynamic_array_new(s: Span) -> IResult { let (s, a) = keyword("new")(s)?; let (s, b) = bracket(expression)(s)?; diff --git a/sv-parser-parser/src/declarations/declaration_lists.rs b/sv-parser-parser/src/declarations/declaration_lists.rs index 30f2dc9..3dcfaa0 100644 --- a/sv-parser-parser/src/declarations/declaration_lists.rs +++ b/sv-parser-parser/src/declarations/declaration_lists.rs @@ -2,19 +2,19 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn list_of_defparam_assignments(s: Span) -> IResult { let (s, a) = list(symbol(","), defparam_assignment)(s)?; Ok((s, ListOfDefparamAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_genvar_identifiers(s: Span) -> IResult { let (s, a) = list(symbol(","), genvar_identifier)(s)?; Ok((s, ListOfGenvarIdentifiers { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult { let (s, a) = list( symbol(","), @@ -23,19 +23,19 @@ pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), net_decl_assignment)(s)?; Ok((s, ListOfNetDeclAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_param_assignments(s: Span) -> IResult { let (s, a) = list(symbol(","), param_assignment)(s)?; Ok((s, ListOfParamAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_port_identifiers(s: Span) -> IResult { let (s, a) = list( symbol(","), @@ -44,19 +44,19 @@ pub(crate) fn list_of_port_identifiers(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), port_identifier)(s)?; Ok((s, ListOfUdpPortIdentifiers { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_specparam_assignments(s: Span) -> IResult { let (s, a) = list(symbol(","), specparam_assignment)(s)?; Ok((s, ListOfSpecparamAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_tf_variable_identifiers( s: Span, ) -> IResult { @@ -71,13 +71,13 @@ pub(crate) fn list_of_tf_variable_identifiers( Ok((s, ListOfTfVariableIdentifiers { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_type_assignments(s: Span) -> IResult { let (s, a) = list(symbol(","), type_assignment)(s)?; Ok((s, ListOfTypeAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_variable_decl_assignments( s: Span, ) -> IResult { @@ -85,7 +85,7 @@ pub(crate) fn list_of_variable_decl_assignments( Ok((s, ListOfVariableDeclAssignments { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult { let (s, a) = list( symbol(","), @@ -94,7 +94,7 @@ pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult IResult { diff --git a/sv-parser-parser/src/declarations/declaration_ranges.rs b/sv-parser-parser/src/declarations/declaration_ranges.rs index e02b417..650f1f5 100644 --- a/sv-parser-parser/src/declarations/declaration_ranges.rs +++ b/sv-parser-parser/src/declarations/declaration_ranges.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn unpacked_dimension(s: Span) -> IResult { alt((unpacked_dimension_range, unpacked_dimension_expression))(s) } -#[parser] +#[tracable_parser] pub(crate) fn unpacked_dimension_range(s: Span) -> IResult { let (s, a) = bracket(constant_range)(s)?; Ok(( @@ -16,7 +16,7 @@ pub(crate) fn unpacked_dimension_range(s: Span) -> IResult IResult { let (s, a) = bracket(constant_expression)(s)?; Ok(( @@ -25,7 +25,7 @@ pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult IResult { alt(( packed_dimension_range, @@ -35,7 +35,7 @@ pub(crate) fn packed_dimension(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn packed_dimension_range(s: Span) -> IResult { let (s, a) = bracket(constant_range)(s)?; Ok(( @@ -44,7 +44,7 @@ pub(crate) fn packed_dimension_range(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn associative_dimension(s: Span) -> IResult { alt(( associative_dimension_data_type, @@ -52,7 +52,7 @@ pub(crate) fn associative_dimension(s: Span) -> IResult IResult { let (s, a) = bracket(data_type)(s)?; Ok(( @@ -61,7 +61,7 @@ pub(crate) fn associative_dimension_data_type(s: Span) -> IResult IResult { let (s, a) = bracket(symbol("*"))(s)?; Ok(( @@ -70,7 +70,7 @@ pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult IResult { alt(( map(unsized_dimension, |x| { @@ -88,7 +88,7 @@ pub(crate) fn variable_dimension(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn queue_dimension(s: Span) -> IResult { let (s, a) = bracket(pair( symbol("$"), @@ -97,7 +97,7 @@ pub(crate) fn queue_dimension(s: Span) -> IResult { Ok((s, QueueDimension { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn unsized_dimension(s: Span) -> IResult { let (s, a) = symbol("[")(s)?; let (s, b) = symbol("]")(s)?; diff --git a/sv-parser-parser/src/declarations/delays.rs b/sv-parser-parser/src/declarations/delays.rs index ad22ef6..b389888 100644 --- a/sv-parser-parser/src/declarations/delays.rs +++ b/sv-parser-parser/src/declarations/delays.rs @@ -2,19 +2,19 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn delay3(s: Span) -> IResult { alt((delay3_single, delay3_mintypmax))(s) } -#[parser] +#[tracable_parser] pub(crate) fn delay3_single(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = delay_value(s)?; Ok((s, Delay3::Single(Box::new(Delay3Single { nodes: (a, b) })))) } -#[parser] +#[tracable_parser] pub(crate) fn delay3_mintypmax(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(pair( @@ -31,19 +31,19 @@ pub(crate) fn delay3_mintypmax(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn delay2(s: Span) -> IResult { alt((delay2_single, delay2_mintypmax))(s) } -#[parser] +#[tracable_parser] pub(crate) fn delay2_single(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = delay_value(s)?; Ok((s, Delay2::Single(Box::new(Delay2Single { nodes: (a, b) })))) } -#[parser] +#[tracable_parser] pub(crate) fn delay2_mintypmax(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(pair( @@ -56,7 +56,7 @@ pub(crate) fn delay2_mintypmax(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn delay_value(s: Span) -> IResult { alt(( map(unsigned_number, |x| DelayValue::UnsignedNumber(Box::new(x))), diff --git a/sv-parser-parser/src/declarations/function_declarations.rs b/sv-parser-parser/src/declarations/function_declarations.rs index 67fb0e8..19e9cd7 100644 --- a/sv-parser-parser/src/declarations/function_declarations.rs +++ b/sv-parser-parser/src/declarations/function_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult { alt(( map(data_type_or_void, |x| { @@ -14,7 +14,7 @@ pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult IResult { let (s, a) = keyword("function")(s)?; let (s, b) = opt(lifetime)(s)?; @@ -22,7 +22,7 @@ pub(crate) fn function_declaration(s: Span) -> IResult IResult { alt(( function_body_declaration_without_port, @@ -31,6 +31,7 @@ pub(crate) fn function_body_declaration(s: Span) -> IResult IResult { @@ -51,6 +52,7 @@ pub(crate) fn function_body_declaration_without_port( } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn function_body_declaration_with_port( s: Span, ) -> IResult { @@ -71,7 +73,7 @@ pub(crate) fn function_body_declaration_with_port( )) } -#[parser] +#[tracable_parser] pub(crate) fn interface_identifier_or_class_scope( s: Span, ) -> IResult { @@ -85,7 +87,7 @@ pub(crate) fn interface_identifier_or_class_scope( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn function_prototype(s: Span) -> IResult { let (s, a) = keyword("function")(s)?; let (s, b) = data_type_or_void(s)?; @@ -99,7 +101,7 @@ pub(crate) fn function_prototype(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn dpi_import_export(s: Span) -> IResult { alt(( dpi_import_export_import_function, @@ -109,7 +111,7 @@ pub(crate) fn dpi_import_export(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult { let (s, a) = keyword("import")(s)?; let (s, b) = dpi_spec_string(s)?; @@ -125,7 +127,7 @@ pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult IResult { let (s, a) = keyword("import")(s)?; let (s, b) = dpi_spec_string(s)?; @@ -141,7 +143,7 @@ pub(crate) fn dpi_import_export_import_task(s: Span) -> IResult IResult { let (s, a) = keyword("export")(s)?; let (s, b) = dpi_spec_string(s)?; @@ -157,7 +159,7 @@ pub(crate) fn dpi_import_export_export_function(s: Span) -> IResult IResult { let (s, a) = keyword("export")(s)?; let (s, b) = dpi_spec_string(s)?; @@ -173,7 +175,7 @@ pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult IResult { alt(( map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))), @@ -181,7 +183,7 @@ pub(crate) fn dpi_spec_string(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn dpi_function_import_property(s: Span) -> IResult { alt(( map(keyword("context"), |x| { @@ -193,19 +195,19 @@ pub(crate) fn dpi_function_import_property(s: Span) -> IResult IResult { let (s, a) = keyword("context")(s)?; Ok((s, DpiTaskImportProperty::Context(Box::new(a)))) } -#[parser] +#[tracable_parser] pub(crate) fn dpi_function_proto(s: Span) -> IResult { let (s, a) = function_prototype(s)?; Ok((s, DpiFunctionProto { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn dpi_task_proto(s: Span) -> IResult { let (s, a) = task_prototype(s)?; Ok((s, DpiTaskProto { nodes: (a,) })) diff --git a/sv-parser-parser/src/declarations/interface_declarations.rs b/sv-parser-parser/src/declarations/interface_declarations.rs index ba5ce79..ae8ea72 100644 --- a/sv-parser-parser/src/declarations/interface_declarations.rs +++ b/sv-parser-parser/src/declarations/interface_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn modport_declaration(s: Span) -> IResult { let (s, a) = keyword("modport")(s)?; let (s, b) = list(symbol(","), modport_item)(s)?; @@ -10,14 +10,14 @@ pub(crate) fn modport_declaration(s: Span) -> IResult Ok((s, ModportDeclaration { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_item(s: Span) -> IResult { let (s, a) = modport_identifier(s)?; let (s, b) = paren(list(symbol(","), modport_ports_declaration))(s)?; Ok((s, ModportItem { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_ports_declaration(s: Span) -> IResult { alt(( modport_ports_declaration_simple, @@ -26,7 +26,7 @@ pub(crate) fn modport_ports_declaration(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = modport_simple_ports_declaration(s)?; @@ -36,7 +36,7 @@ pub(crate) fn modport_ports_declaration_simple(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = modport_tf_ports_declaration(s)?; @@ -46,7 +46,7 @@ pub(crate) fn modport_ports_declaration_tf(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = modport_clocking_declaration(s)?; @@ -58,14 +58,14 @@ pub(crate) fn modport_ports_declaration_clocking(s: Span) -> IResult IResult { let (s, a) = keyword("clocking")(s)?; let (s, b) = clocking_identifier(s)?; Ok((s, ModportClockingDeclaration { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_simple_ports_declaration( s: Span, ) -> IResult { @@ -74,12 +74,12 @@ pub(crate) fn modport_simple_ports_declaration( Ok((s, ModportSimplePortsDeclaration { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_simple_port(s: Span) -> IResult { alt((modport_simple_port_ordered, modport_simple_port_named))(s) } -#[parser] +#[tracable_parser] pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult { let (s, a) = port_identifier(s)?; Ok(( @@ -88,7 +88,7 @@ pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult IResult { let (s, a) = symbol(".")(s)?; let (s, b) = port_identifier(s)?; @@ -99,14 +99,14 @@ pub(crate) fn modport_simple_port_named(s: Span) -> IResult IResult { let (s, a) = import_export(s)?; let (s, b) = list(symbol(","), modport_tf_port)(s)?; Ok((s, ModportTfPortsDeclaration { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_tf_port(s: Span) -> IResult { alt(( map(method_prototype, |x| { @@ -116,7 +116,7 @@ pub(crate) fn modport_tf_port(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn import_export(s: Span) -> IResult { alt(( map(keyword("import"), |x| ImportExport::Import(Box::new(x))), diff --git a/sv-parser-parser/src/declarations/let_declarations.rs b/sv-parser-parser/src/declarations/let_declarations.rs index 86d70a2..5313623 100644 --- a/sv-parser-parser/src/declarations/let_declarations.rs +++ b/sv-parser-parser/src/declarations/let_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn let_declaration(s: Span) -> IResult { let (s, a) = keyword("let")(s)?; let (s, b) = let_identifier(s)?; @@ -18,19 +18,20 @@ pub(crate) fn let_declaration(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn let_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, LetIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn let_port_list(s: Span) -> IResult { let (s, a) = list(symbol(","), let_port_item)(s)?; Ok((s, LetPortList { nodes: (a,) })) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn let_port_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = ambiguous_opt(let_formal_type)(s)?; @@ -45,7 +46,7 @@ pub(crate) fn let_port_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn let_formal_type(s: Span) -> IResult { alt(( map(data_type_or_implicit, |x| { @@ -55,7 +56,7 @@ pub(crate) fn let_formal_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn let_expression(s: Span) -> IResult { let (s, a) = opt(package_scope)(s)?; let (s, b) = let_identifier(s)?; @@ -63,13 +64,13 @@ pub(crate) fn let_expression(s: Span) -> IResult { Ok((s, LetExpression { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn let_list_of_arguments(s: Span) -> IResult { alt((let_list_of_arguments_ordered, let_list_of_arguments_named))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn let_list_of_arguments_ordered(s: Span) -> IResult { let (s, a) = list(symbol(","), opt(let_actual_arg))(s)?; let (s, b) = many0(tuple(( @@ -84,7 +85,7 @@ pub(crate) fn let_list_of_arguments_ordered(s: Span) -> IResult IResult { let (s, a) = list( symbol(","), @@ -96,7 +97,7 @@ pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult IResult { let (s, a) = expression(s)?; Ok((s, LetActualArg { nodes: (a,) })) diff --git a/sv-parser-parser/src/declarations/module_parameter_declarations.rs b/sv-parser-parser/src/declarations/module_parameter_declarations.rs index 16d70db..d4fbbf7 100644 --- a/sv-parser-parser/src/declarations/module_parameter_declarations.rs +++ b/sv-parser-parser/src/declarations/module_parameter_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn local_parameter_declaration(s: Span) -> IResult { alt(( local_parameter_declaration_param, @@ -11,6 +11,7 @@ pub(crate) fn local_parameter_declaration(s: Span) -> IResult IResult { @@ -25,7 +26,7 @@ pub(crate) fn local_parameter_declaration_param( )) } -#[parser] +#[tracable_parser] pub(crate) fn local_parameter_declaration_type( s: Span, ) -> IResult { @@ -40,12 +41,13 @@ pub(crate) fn local_parameter_declaration_type( )) } -#[parser] +#[tracable_parser] pub(crate) fn parameter_declaration(s: Span) -> IResult { alt((parameter_declaration_param, parameter_declaration_type))(s) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn parameter_declaration_param(s: Span) -> IResult { let (s, a) = keyword("parameter")(s)?; let (s, b) = ambiguous_opt(data_type_or_implicit)(s)?; @@ -56,7 +58,7 @@ pub(crate) fn parameter_declaration_param(s: Span) -> IResult IResult { let (s, a) = keyword("parameter")(s)?; let (s, b) = keyword("type")(s)?; @@ -67,7 +69,7 @@ pub(crate) fn parameter_declaration_type(s: Span) -> IResult IResult { let (s, a) = keyword("specparam")(s)?; let (s, b) = opt(packed_dimension)(s)?; diff --git a/sv-parser-parser/src/declarations/net_and_variable_types.rs b/sv-parser-parser/src/declarations/net_and_variable_types.rs index 2067d5d..d33d7fb 100644 --- a/sv-parser-parser/src/declarations/net_and_variable_types.rs +++ b/sv-parser-parser/src/declarations/net_and_variable_types.rs @@ -3,7 +3,7 @@ use crate::*; // ----------------------------------------------------------------------------- #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn casting_type(s: Span) -> IResult { alt(( map(simple_type, |x| CastingType::SimpleType(Box::new(x))), @@ -16,7 +16,7 @@ pub(crate) fn casting_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn data_type(s: Span) -> IResult { alt(( data_type_vector, @@ -37,7 +37,7 @@ pub(crate) fn data_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_vector(s: Span) -> IResult { let (s, a) = integer_vector_type(s)?; let (s, b) = opt(signing)(s)?; @@ -48,14 +48,14 @@ pub(crate) fn data_type_vector(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_atom(s: Span) -> IResult { let (s, a) = integer_atom_type(s)?; let (s, b) = opt(signing)(s)?; Ok((s, DataType::Atom(Box::new(DataTypeAtom { nodes: (a, b) })))) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_struct_union(s: Span) -> IResult { let (s, a) = struct_union(s)?; let (s, b) = opt(pair(packed, opt(signing)))(s)?; @@ -69,13 +69,13 @@ pub(crate) fn data_type_struct_union(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn packed(s: Span) -> IResult { let (s, a) = keyword("packed")(s)?; Ok((s, Packed { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_enum(s: Span) -> IResult { let (s, a) = keyword("enum")(s)?; let (s, b) = opt(enum_base_type)(s)?; @@ -89,7 +89,7 @@ pub(crate) fn data_type_enum(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_virtual(s: Span) -> IResult { let (s, a) = keyword("virtual")(s)?; let (s, b) = opt(interface)(s)?; @@ -104,13 +104,13 @@ pub(crate) fn data_type_virtual(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn interface(s: Span) -> IResult { let (s, a) = keyword("interface")(s)?; Ok((s, Interface { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_type(s: Span) -> IResult { let (s, a) = opt(package_scope_or_class_scope)(s)?; let (s, b) = type_identifier(s)?; @@ -121,7 +121,7 @@ pub(crate) fn data_type_type(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_or_implicit(s: Span) -> IResult { alt(( map(data_type, |x| DataTypeOrImplicit::DataType(Box::new(x))), @@ -131,14 +131,14 @@ pub(crate) fn data_type_or_implicit(s: Span) -> IResult IResult { let (s, a) = opt(signing)(s)?; let (s, b) = many0(packed_dimension)(s)?; Ok((s, ImplicitDataType { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn enum_base_type(s: Span) -> IResult { alt(( enum_base_type_atom, @@ -147,7 +147,7 @@ pub(crate) fn enum_base_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn enum_base_type_atom(s: Span) -> IResult { let (s, a) = integer_atom_type(s)?; let (s, b) = opt(signing)(s)?; @@ -157,7 +157,7 @@ pub(crate) fn enum_base_type_atom(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn enum_base_type_vector(s: Span) -> IResult { let (s, a) = integer_vector_type(s)?; let (s, b) = opt(signing)(s)?; @@ -168,7 +168,7 @@ pub(crate) fn enum_base_type_vector(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn enum_base_type_type(s: Span) -> IResult { let (s, a) = type_identifier(s)?; let (s, b) = opt(packed_dimension)(s)?; @@ -178,7 +178,7 @@ pub(crate) fn enum_base_type_type(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn enum_name_declaration(s: Span) -> IResult { let (s, a) = enum_identifier(s)?; let (s, b) = opt(bracket(pair( @@ -190,14 +190,14 @@ pub(crate) fn enum_name_declaration(s: Span) -> IResult IResult { let (s, a) = class_type(s)?; let (s, b) = symbol("::")(s)?; Ok((s, ClassScope { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn class_type(s: Span) -> IResult { let (s, a) = ps_class_identifier(s)?; let (s, b) = opt(parameter_value_assignment)(s)?; @@ -209,7 +209,7 @@ pub(crate) fn class_type(s: Span) -> IResult { Ok((s, ClassType { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn integer_type(s: Span) -> IResult { alt(( map(integer_vector_type, |x| { @@ -221,7 +221,7 @@ pub(crate) fn integer_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn integer_atom_type(s: Span) -> IResult { alt(( map(keyword("byte"), |x| IntegerAtomType::Byte(Box::new(x))), @@ -239,7 +239,7 @@ pub(crate) fn integer_atom_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn integer_vector_type(s: Span) -> IResult { alt(( map(keyword("bit"), |x| IntegerVectorType::Bit(Box::new(x))), @@ -248,7 +248,7 @@ pub(crate) fn integer_vector_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn non_integer_type(s: Span) -> IResult { alt(( map(keyword("shortreal"), |x| { @@ -261,7 +261,7 @@ pub(crate) fn non_integer_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_type(s: Span) -> IResult { alt(( map(keyword("supply0"), |x| NetType::Supply0(Box::new(x))), @@ -279,7 +279,7 @@ pub(crate) fn net_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_port_type(s: Span) -> IResult { alt(( net_port_type_data_type, @@ -290,7 +290,7 @@ pub(crate) fn net_port_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_port_type_data_type(s: Span) -> IResult { let (s, a) = opt(net_type)(s)?; let (s, b) = data_type_or_implicit(s)?; @@ -300,7 +300,7 @@ pub(crate) fn net_port_type_data_type(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn net_port_type_interconnect(s: Span) -> IResult { let (s, a) = keyword("interconnect")(s)?; let (s, b) = implicit_data_type(s)?; @@ -310,13 +310,13 @@ pub(crate) fn net_port_type_interconnect(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn variable_port_type(s: Span) -> IResult { let (s, a) = var_data_type(s)?; Ok((s, VariablePortType { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn var_data_type(s: Span) -> IResult { alt(( map(data_type, |x| VarDataType::DataType(Box::new(x))), @@ -324,7 +324,7 @@ pub(crate) fn var_data_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn var_data_type_var(s: Span) -> IResult { let (s, a) = keyword("var")(s)?; let (s, b) = data_type_or_implicit(s)?; @@ -334,7 +334,7 @@ pub(crate) fn var_data_type_var(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn signing(s: Span) -> IResult { alt(( map(keyword("signed"), |x| Signing::Signed(Box::new(x))), @@ -343,7 +343,7 @@ pub(crate) fn signing(s: Span) -> IResult { } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn simple_type(s: Span) -> IResult { alt(( map(integer_type, |x| SimpleType::IntegerType(Box::new(x))), @@ -359,7 +359,7 @@ pub(crate) fn simple_type(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn struct_union_member(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = opt(random_qualifier)(s)?; @@ -374,7 +374,7 @@ pub(crate) fn struct_union_member(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn data_type_or_void(s: Span) -> IResult { alt(( map(data_type, |x| DataTypeOrVoid::DataType(Box::new(x))), @@ -382,7 +382,7 @@ pub(crate) fn data_type_or_void(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn struct_union(s: Span) -> IResult { alt(( map(keyword("struct"), |x| StructUnion::Struct(Box::new(x))), @@ -393,12 +393,12 @@ pub(crate) fn struct_union(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn type_reference(s: Span) -> IResult { alt((type_reference_expression, type_reference_data_type))(s) } -#[parser] +#[tracable_parser] pub(crate) fn type_reference_expression(s: Span) -> IResult { let (s, a) = keyword("type")(s)?; let (s, b) = paren(expression)(s)?; @@ -408,7 +408,7 @@ pub(crate) fn type_reference_expression(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn type_reference_data_type(s: Span) -> IResult { let (s, a) = keyword("type")(s)?; let (s, b) = paren(data_type)(s)?; diff --git a/sv-parser-parser/src/declarations/port_declarations.rs b/sv-parser-parser/src/declarations/port_declarations.rs index 91d1b38..956b4ed 100644 --- a/sv-parser-parser/src/declarations/port_declarations.rs +++ b/sv-parser-parser/src/declarations/port_declarations.rs @@ -3,6 +3,7 @@ use crate::*; // ----------------------------------------------------------------------------- #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn inout_declaration(s: Span) -> IResult { let (s, a) = keyword("inout")(s)?; let (s, b) = ambiguous_opt(net_port_type)(s)?; @@ -10,12 +11,13 @@ pub(crate) fn inout_declaration(s: Span) -> IResult { Ok((s, InoutDeclaration { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn input_declaration(s: Span) -> IResult { alt((input_declaration_net, input_declaration_variable))(s) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn input_declaration_net(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; let (s, b) = ambiguous_opt(net_port_type)(s)?; @@ -27,6 +29,7 @@ pub(crate) fn input_declaration_net(s: Span) -> IResult } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn input_declaration_variable(s: Span) -> IResult { let (s, a) = keyword("input")(s)?; let (s, b) = ambiguous_alt(variable_port_type, implicit_var)(s)?; @@ -37,12 +40,13 @@ pub(crate) fn input_declaration_variable(s: Span) -> IResult IResult { alt((output_declaration_net, output_declaration_variable))(s) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn output_declaration_net(s: Span) -> IResult { let (s, a) = keyword("output")(s)?; let (s, b) = ambiguous_opt(net_port_type)(s)?; @@ -54,6 +58,7 @@ pub(crate) fn output_declaration_net(s: Span) -> IResult IResult { let (s, a) = keyword("output")(s)?; let (s, b) = ambiguous_alt(variable_port_type, implicit_var)(s)?; @@ -64,7 +69,7 @@ pub(crate) fn output_declaration_variable(s: Span) -> IResult IResult { let (s, a) = interface_identifier(s)?; let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?; @@ -73,6 +78,7 @@ pub(crate) fn interface_port_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("ref")(s)?; let (s, b) = ambiguous_alt(variable_port_type, implicit_var)(s)?; @@ -80,7 +86,7 @@ pub(crate) fn ref_declaration(s: Span) -> IResult { Ok((s, RefDeclaration { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn implicit_var(s: Span) -> IResult { let (s, a) = keyword("var")(s)?; Ok(( diff --git a/sv-parser-parser/src/declarations/strengths.rs b/sv-parser-parser/src/declarations/strengths.rs index 75a87a7..0a5d524 100644 --- a/sv-parser-parser/src/declarations/strengths.rs +++ b/sv-parser-parser/src/declarations/strengths.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn drive_strength(s: Span) -> IResult { alt(( drive_strength01, @@ -14,7 +14,7 @@ pub(crate) fn drive_strength(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strength01(s: Span) -> IResult { let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?; Ok(( @@ -23,7 +23,7 @@ pub(crate) fn drive_strength01(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strength10(s: Span) -> IResult { let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?; Ok(( @@ -32,7 +32,7 @@ pub(crate) fn drive_strength10(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strength0z(s: Span) -> IResult { let (s, a) = paren(triple(strength0, symbol(","), keyword("highz1")))(s)?; Ok(( @@ -41,7 +41,7 @@ pub(crate) fn drive_strength0z(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strength1z(s: Span) -> IResult { let (s, a) = paren(triple(strength1, symbol(","), keyword("highz0")))(s)?; Ok(( @@ -50,7 +50,7 @@ pub(crate) fn drive_strength1z(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strengthz1(s: Span) -> IResult { let (s, a) = paren(triple(keyword("highz0"), symbol(","), strength1))(s)?; Ok(( @@ -59,7 +59,7 @@ pub(crate) fn drive_strengthz1(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn drive_strengthz0(s: Span) -> IResult { let (s, a) = paren(triple(keyword("highz1"), symbol(","), strength0))(s)?; Ok(( @@ -68,7 +68,7 @@ pub(crate) fn drive_strengthz0(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn strength0(s: Span) -> IResult { alt(( map(keyword("supply0"), |x| Strength0::Supply0(Box::new(x))), @@ -78,7 +78,7 @@ pub(crate) fn strength0(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn strength1(s: Span) -> IResult { alt(( map(keyword("supply1"), |x| Strength1::Supply1(Box::new(x))), @@ -88,7 +88,7 @@ pub(crate) fn strength1(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn charge_strength(s: Span) -> IResult { alt(( charge_strength_small, @@ -97,7 +97,7 @@ pub(crate) fn charge_strength(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn charge_strength_small(s: Span) -> IResult { let (s, a) = paren(keyword("small"))(s)?; Ok(( @@ -106,7 +106,7 @@ pub(crate) fn charge_strength_small(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn charge_strength_medium(s: Span) -> IResult { let (s, a) = paren(keyword("medium"))(s)?; Ok(( @@ -115,7 +115,7 @@ pub(crate) fn charge_strength_medium(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn charge_strength_large(s: Span) -> IResult { let (s, a) = paren(keyword("large"))(s)?; Ok(( diff --git a/sv-parser-parser/src/declarations/task_declarations.rs b/sv-parser-parser/src/declarations/task_declarations.rs index 9660209..dc6bd31 100644 --- a/sv-parser-parser/src/declarations/task_declarations.rs +++ b/sv-parser-parser/src/declarations/task_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn task_declaration(s: Span) -> IResult { let (s, a) = keyword("task")(s)?; let (s, b) = opt(lifetime)(s)?; @@ -10,7 +10,7 @@ pub(crate) fn task_declaration(s: Span) -> IResult { Ok((s, TaskDeclaration { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn task_body_declaration(s: Span) -> IResult { alt(( task_body_declaration_without_port, @@ -18,7 +18,7 @@ pub(crate) fn task_body_declaration(s: Span) -> IResult IResult { let (s, a) = opt(interface_identifier_or_class_scope)(s)?; let (s, b) = task_identifier(s)?; @@ -35,7 +35,7 @@ pub(crate) fn task_body_declaration_without_port(s: Span) -> IResult IResult { let (s, a) = opt(interface_identifier_or_class_scope)(s)?; let (s, b) = task_identifier(s)?; @@ -53,7 +53,7 @@ pub(crate) fn task_body_declaration_with_port(s: Span) -> IResult IResult { alt(( map(block_item_declaration, |x| { @@ -65,13 +65,14 @@ pub(crate) fn tf_item_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn tf_port_list(s: Span) -> IResult { let (s, a) = list(symbol(","), tf_port_item)(s)?; Ok((s, TfPortList { nodes: (a,) })) } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn tf_port_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = opt(tf_port_direction)(s)?; @@ -90,7 +91,7 @@ pub(crate) fn tf_port_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn tf_port_direction(s: Span) -> IResult { alt(( map(port_direction, |x| { @@ -103,6 +104,7 @@ pub(crate) fn tf_port_direction(s: Span) -> IResult { } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn tf_port_declaration(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = tf_port_direction(s)?; @@ -118,7 +120,7 @@ pub(crate) fn tf_port_declaration(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn task_prototype(s: Span) -> IResult { let (s, a) = keyword("task")(s)?; let (s, b) = task_identifier(s)?; diff --git a/sv-parser-parser/src/declarations/type_declarations.rs b/sv-parser-parser/src/declarations/type_declarations.rs index 675d1ed..f012563 100644 --- a/sv-parser-parser/src/declarations/type_declarations.rs +++ b/sv-parser-parser/src/declarations/type_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn data_declaration(s: Span) -> IResult { alt(( data_declaration_variable, @@ -19,6 +19,7 @@ pub(crate) fn data_declaration(s: Span) -> IResult { } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn data_declaration_variable(s: Span) -> IResult { let (s, a) = opt(r#const)(s)?; let (s, b) = opt(var)(s)?; @@ -34,13 +35,13 @@ pub(crate) fn data_declaration_variable(s: Span) -> IResult IResult { let (s, a) = keyword("const")(s)?; Ok((s, Const { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn package_import_declaration(s: Span) -> IResult { let (s, a) = keyword("import")(s)?; let (s, b) = list(symbol(","), package_import_item)(s)?; @@ -48,12 +49,12 @@ pub(crate) fn package_import_declaration(s: Span) -> IResult IResult { alt((package_import_item_identifier, package_import_item_asterisk))(s) } -#[parser] +#[tracable_parser] pub(crate) fn package_import_item_identifier(s: Span) -> IResult { let (s, a) = package_identifier(s)?; let (s, b) = symbol("::")(s)?; @@ -64,7 +65,7 @@ pub(crate) fn package_import_item_identifier(s: Span) -> IResult IResult { let (s, a) = package_identifier(s)?; let (s, b) = symbol("::")(s)?; @@ -75,7 +76,7 @@ pub(crate) fn package_import_item_asterisk(s: Span) -> IResult IResult { alt(( package_export_declaration_asterisk, @@ -83,7 +84,7 @@ pub(crate) fn package_export_declaration(s: Span) -> IResult IResult { @@ -98,7 +99,7 @@ pub(crate) fn package_export_declaration_asterisk( )) } -#[parser] +#[tracable_parser] pub(crate) fn package_export_declaration_item(s: Span) -> IResult { let (s, a) = keyword("export")(s)?; let (s, b) = list(symbol(","), package_import_item)(s)?; @@ -109,7 +110,7 @@ pub(crate) fn package_export_declaration_item(s: Span) -> IResult IResult { let (s, a) = keyword("genvar")(s)?; let (s, b) = list_of_genvar_identifiers(s)?; @@ -117,7 +118,7 @@ pub(crate) fn genvar_declaration(s: Span) -> IResult { Ok((s, GenvarDeclaration { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn net_declaration(s: Span) -> IResult { alt(( net_declaration_interconnect, @@ -127,6 +128,7 @@ pub(crate) fn net_declaration(s: Span) -> IResult { } #[parser(Ambiguous)] +#[tracable_parser] pub(crate) fn net_declaration_net_type(s: Span) -> IResult { let (s, a) = net_type(s)?; let (s, b) = opt(strength)(s)?; @@ -143,7 +145,7 @@ pub(crate) fn net_declaration_net_type(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn strength(s: Span) -> IResult { alt(( map(drive_strength, |x| Strength::Drive(Box::new(x))), @@ -151,7 +153,7 @@ pub(crate) fn strength(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn vector_scalar(s: Span) -> IResult { alt(( map(keyword("vectored"), |x| VectorScalar::Vectored(Box::new(x))), @@ -159,7 +161,7 @@ pub(crate) fn vector_scalar(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult { let (s, a) = net_type_identifier(s)?; let (s, b) = opt(delay_control)(s)?; @@ -173,7 +175,7 @@ pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult IResult { let (s, a) = keyword("interconnect")(s)?; let (s, b) = implicit_data_type(s)?; @@ -194,7 +196,7 @@ pub(crate) fn net_declaration_interconnect(s: Span) -> IResult IResult { alt(( type_declaration_data_type, @@ -203,7 +205,7 @@ pub(crate) fn type_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn type_declaration_data_type(s: Span) -> IResult { let (s, a) = keyword("typedef")(s)?; let (s, b) = data_type(s)?; @@ -218,7 +220,7 @@ pub(crate) fn type_declaration_data_type(s: Span) -> IResult IResult { let (s, a) = keyword("typedef")(s)?; let (s, b) = interface_instance_identifier(s)?; @@ -235,7 +237,7 @@ pub(crate) fn type_declaration_interface(s: Span) -> IResult IResult { let (s, a) = keyword("typedef")(s)?; let (s, b) = opt(type_declaration_keyword)(s)?; @@ -249,7 +251,7 @@ pub(crate) fn type_declaration_reserved(s: Span) -> IResult IResult { alt(( map(keyword("enum"), |x| { @@ -270,7 +272,7 @@ pub(crate) fn type_declaration_keyword(s: Span) -> IResult IResult { alt(( net_type_declaration_data_type, @@ -278,7 +280,7 @@ pub(crate) fn net_type_declaration(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult { let (s, a) = keyword("nettype")(s)?; let (s, b) = data_type(s)?; @@ -297,7 +299,7 @@ pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult IResult { let (s, a) = keyword("nettype")(s)?; let (s, b) = opt(package_scope_or_class_scope)(s)?; @@ -312,7 +314,7 @@ pub(crate) fn net_type_declaration_net_type(s: Span) -> IResult IResult { alt(( map(keyword("static"), |x| Lifetime::Static(Box::new(x))), diff --git a/sv-parser-parser/src/expressions/concatenations.rs b/sv-parser-parser/src/expressions/concatenations.rs index 7cf9cd0..e07b65f 100644 --- a/sv-parser-parser/src/expressions/concatenations.rs +++ b/sv-parser-parser/src/expressions/concatenations.rs @@ -2,19 +2,19 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn concatenation(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), expression))(s)?; Ok((s, Concatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constant_concatenation(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), constant_expression))(s)?; Ok((s, ConstantConcatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constant_multiple_concatenation( s: Span, ) -> IResult { @@ -22,13 +22,13 @@ pub(crate) fn constant_multiple_concatenation( Ok((s, ConstantMultipleConcatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn module_path_concatenation(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), module_path_expression))(s)?; Ok((s, ModulePathConcatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn module_path_multiple_concatenation( s: Span, ) -> IResult { @@ -36,13 +36,13 @@ pub(crate) fn module_path_multiple_concatenation( Ok((s, ModulePathMultipleConcatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn multiple_concatenation(s: Span) -> IResult { let (s, a) = brace(pair(expression, concatenation))(s)?; Ok((s, MultipleConcatenation { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn streaming_concatenation(s: Span) -> IResult { let (s, a) = brace(triple( stream_operator, @@ -52,7 +52,7 @@ pub(crate) fn streaming_concatenation(s: Span) -> IResult IResult { alt(( map(symbol(">>"), |x| StreamOperator { nodes: (x,) }), @@ -60,7 +60,7 @@ pub(crate) fn stream_operator(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn slice_size(s: Span) -> IResult { alt(( map(simple_type, |x| SliceSize::SimpleType(Box::new(x))), @@ -70,21 +70,21 @@ pub(crate) fn slice_size(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn stream_concatenation(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), stream_expression))(s)?; Ok((s, StreamConcatenation { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn stream_expression(s: Span) -> IResult { let (s, a) = expression(s)?; let (s, b) = opt(pair(keyword("with"), bracket(array_range_expression)))(s)?; Ok((s, StreamExpression { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn array_range_expression(s: Span) -> IResult { alt(( map(expression, |x| { @@ -97,7 +97,7 @@ pub(crate) fn array_range_expression(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = symbol(":")(s)?; @@ -109,7 +109,7 @@ pub(crate) fn array_range_expression_colon(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = symbol("+:")(s)?; @@ -123,7 +123,7 @@ pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = symbol("-:")(s)?; @@ -136,7 +136,7 @@ pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult IResult { diff --git a/sv-parser-parser/src/expressions/expression_leftside_values.rs b/sv-parser-parser/src/expressions/expression_leftside_values.rs index 421d86a..d7a1fb2 100644 --- a/sv-parser-parser/src/expressions/expression_leftside_values.rs +++ b/sv-parser-parser/src/expressions/expression_leftside_values.rs @@ -3,12 +3,12 @@ use crate::*; // ----------------------------------------------------------------------------- #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn net_lvalue(s: Span) -> IResult { alt((net_lvalue_identifier, net_lvalue_lvalue, net_lvalue_pattern))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_lvalue_identifier(s: Span) -> IResult { let (s, a) = ps_or_hierarchical_net_identifier(s)?; let (s, b) = constant_select(s)?; @@ -18,7 +18,7 @@ pub(crate) fn net_lvalue_identifier(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn net_lvalue_pattern(s: Span) -> IResult { let (s, a) = opt(assignment_pattern_expression_type)(s)?; let (s, b) = assignment_pattern_net_lvalue(s)?; @@ -28,7 +28,7 @@ pub(crate) fn net_lvalue_pattern(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), net_lvalue))(s)?; Ok(( @@ -38,7 +38,7 @@ pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult { } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn variable_lvalue(s: Span) -> IResult { alt(( variable_lvalue_identifier, @@ -50,7 +50,7 @@ pub(crate) fn variable_lvalue(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult { let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?; let (s, b) = hierarchical_variable_identifier(s)?; @@ -61,7 +61,7 @@ pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult IResult { let (s, a) = opt(assignment_pattern_expression_type)(s)?; let (s, b) = assignment_pattern_variable_lvalue(s)?; @@ -71,7 +71,7 @@ pub(crate) fn variable_lvalue_pattern(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), variable_lvalue))(s)?; Ok(( @@ -80,7 +80,7 @@ pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn nonrange_variable_lvalue(s: Span) -> IResult { let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?; let (s, b) = hierarchical_variable_identifier(s)?; diff --git a/sv-parser-parser/src/expressions/expressions.rs b/sv-parser-parser/src/expressions/expressions.rs index a01c340..6fe0042 100644 --- a/sv-parser-parser/src/expressions/expressions.rs +++ b/sv-parser-parser/src/expressions/expressions.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn inc_or_dec_expression(s: Span) -> IResult { alt((inc_or_dec_expression_prefix, inc_or_dec_expression_suffix))(s) } -#[parser] +#[tracable_parser] pub(crate) fn inc_or_dec_expression_prefix(s: Span) -> IResult { let (s, a) = inc_or_dec_operator(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -19,7 +19,7 @@ pub(crate) fn inc_or_dec_expression_prefix(s: Span) -> IResult IResult { let (s, a) = variable_lvalue(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -31,7 +31,7 @@ pub(crate) fn inc_or_dec_expression_suffix(s: Span) -> IResult IResult { let (s, a) = cond_predicate(s)?; let (s, b) = symbol("?")(s)?; @@ -48,7 +48,7 @@ pub(crate) fn conditional_expression(s: Span) -> IResult IResult { alt(( constant_expression_unary, @@ -60,7 +60,7 @@ pub(crate) fn constant_expression(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn constant_expression_unary(s: Span) -> IResult { let (s, a) = unary_operator(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -72,7 +72,7 @@ pub(crate) fn constant_expression_unary(s: Span) -> IResult IResult { let (s, a) = constant_expression(s)?; let (s, b) = binary_operator(s)?; @@ -87,7 +87,7 @@ pub(crate) fn constant_expression_binary(s: Span) -> IResult IResult { let (s, a) = constant_expression(s)?; let (s, b) = symbol("?")(s)?; @@ -103,7 +103,7 @@ pub(crate) fn constant_expression_ternary(s: Span) -> IResult IResult { alt(( constant_mintypmax_expression_ternary, @@ -114,7 +114,7 @@ pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult IResult { @@ -131,7 +131,7 @@ pub(crate) fn constant_mintypmax_expression_ternary( )) } -#[parser] +#[tracable_parser] pub(crate) fn constant_param_expression(s: Span) -> IResult { alt(( map(symbol("$"), |x| { @@ -146,7 +146,7 @@ pub(crate) fn constant_param_expression(s: Span) -> IResult IResult { alt(( map(symbol("$"), |x| ParamExpression::Dollar(Box::new(x))), @@ -157,7 +157,7 @@ pub(crate) fn param_expression(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn constant_range_expression(s: Span) -> IResult { alt(( map(constant_part_select_range, |x| { @@ -169,7 +169,7 @@ pub(crate) fn constant_range_expression(s: Span) -> IResult IResult { alt(( map(constant_range, |x| { @@ -182,7 +182,7 @@ pub(crate) fn constant_part_select_range(s: Span) -> IResult IResult { let (s, a) = constant_expression(s)?; let (s, b) = symbol(":")(s)?; @@ -191,7 +191,7 @@ pub(crate) fn constant_range(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn constant_indexed_range(s: Span) -> IResult { let (s, a) = constant_expression(s)?; let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?; @@ -200,7 +200,7 @@ pub(crate) fn constant_indexed_range(s: Span) -> IResult IResult { alt(( expression_unary, @@ -222,7 +222,7 @@ pub(crate) fn expression(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn expression_unary(s: Span) -> IResult { let (s, x) = unary_operator(s)?; let (s, y) = many0(attribute_instance)(s)?; @@ -233,7 +233,7 @@ pub(crate) fn expression_unary(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn expression_operator_assignment(s: Span) -> IResult { let (s, a) = paren(operator_assignment)(s)?; Ok(( @@ -243,7 +243,7 @@ pub(crate) fn expression_operator_assignment(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = binary_operator(s)?; @@ -257,7 +257,7 @@ pub(crate) fn expression_binary(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn tagged_union_expression(s: Span) -> IResult { let (s, a) = keyword("tagged")(s)?; let (s, b) = member_identifier(s)?; @@ -266,7 +266,7 @@ pub(crate) fn tagged_union_expression(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = keyword("inside")(s)?; @@ -274,7 +274,7 @@ pub(crate) fn inside_expression(s: Span) -> IResult { Ok((s, InsideExpression { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn value_range(s: Span) -> IResult { alt(( value_range_binary, @@ -282,7 +282,7 @@ pub(crate) fn value_range(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn value_range_binary(s: Span) -> IResult { let (s, a) = bracket(triple(expression, symbol(":"), expression))(s)?; Ok(( @@ -291,7 +291,7 @@ pub(crate) fn value_range_binary(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn mintypmax_expression(s: Span) -> IResult { alt(( mintypmax_expression_ternary, @@ -300,7 +300,7 @@ pub(crate) fn mintypmax_expression(s: Span) -> IResult IResult { let (s, a) = expression(s)?; let (s, b) = symbol(":")(s)?; @@ -316,7 +316,7 @@ pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult IResult { @@ -334,7 +334,7 @@ pub(crate) fn module_path_conditional_expression( )) } -#[parser] +#[tracable_parser] pub(crate) fn module_path_expression(s: Span) -> IResult { alt(( map(module_path_primary, |x| { @@ -348,7 +348,7 @@ pub(crate) fn module_path_expression(s: Span) -> IResult IResult { let (s, a) = unary_module_path_operator(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -360,7 +360,7 @@ pub(crate) fn module_path_expression_unary(s: Span) -> IResult IResult { let (s, a) = module_path_expression(s)?; let (s, b) = binary_module_path_operator(s)?; @@ -374,7 +374,7 @@ pub(crate) fn module_path_expression_binary(s: Span) -> IResult IResult { @@ -387,7 +387,7 @@ pub(crate) fn module_path_mintypmax_expression( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn module_path_mintypmax_expression_ternary( s: Span, ) -> IResult { @@ -404,7 +404,7 @@ pub(crate) fn module_path_mintypmax_expression_ternary( )) } -#[parser] +#[tracable_parser] pub(crate) fn part_select_range(s: Span) -> IResult { alt(( map(constant_range, |x| { @@ -417,7 +417,7 @@ pub(crate) fn part_select_range(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn indexed_range(s: Span) -> IResult { let (s, a) = expression(s)?; let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?; @@ -425,7 +425,7 @@ pub(crate) fn indexed_range(s: Span) -> IResult { Ok((s, IndexedRange { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn genvar_expression(s: Span) -> IResult { let (s, a) = constant_expression(s)?; Ok((s, GenvarExpression { nodes: (a,) })) diff --git a/sv-parser-parser/src/expressions/numbers.rs b/sv-parser-parser/src/expressions/numbers.rs index a3c24c2..5853ccb 100644 --- a/sv-parser-parser/src/expressions/numbers.rs +++ b/sv-parser-parser/src/expressions/numbers.rs @@ -3,7 +3,7 @@ use crate::*; // ----------------------------------------------------------------------------- #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn number(s: Span) -> IResult { alt(( map(real_number, |x| Number::RealNumber(Box::new(x))), @@ -11,7 +11,7 @@ pub(crate) fn number(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn integral_number(s: Span) -> IResult { alt(( map(octal_number, |x| IntegralNumber::OctalNumber(Box::new(x))), @@ -23,7 +23,7 @@ pub(crate) fn integral_number(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn decimal_number(s: Span) -> IResult { alt(( decimal_number_base_unsigned, @@ -35,7 +35,7 @@ pub(crate) fn decimal_number(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult { let (s, a) = opt(size)(s)?; let (s, b) = decimal_base(s)?; @@ -46,7 +46,7 @@ pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult IResult { let (s, a) = opt(size)(s)?; let (s, b) = decimal_base(s)?; @@ -57,7 +57,7 @@ pub(crate) fn decimal_number_base_x_number(s: Span) -> IResult IResult { let (s, a) = opt(size)(s)?; let (s, b) = decimal_base(s)?; @@ -68,7 +68,7 @@ pub(crate) fn decimal_number_base_z_number(s: Span) -> IResult IResult { let (s, a) = opt(size)(s)?; let (s, b) = binary_base(s)?; @@ -76,7 +76,7 @@ pub(crate) fn binary_number(s: Span) -> IResult { Ok((s, BinaryNumber { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn octal_number(s: Span) -> IResult { let (s, a) = opt(size)(s)?; let (s, b) = octal_base(s)?; @@ -84,7 +84,7 @@ pub(crate) fn octal_number(s: Span) -> IResult { Ok((s, OctalNumber { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn hex_number(s: Span) -> IResult { let (s, a) = opt(size)(s)?; let (s, b) = hex_base(s)?; @@ -92,7 +92,7 @@ pub(crate) fn hex_number(s: Span) -> IResult { Ok((s, HexNumber { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn sign(s: Span) -> IResult { alt(( map(symbol("+"), |x| Sign::Plus(Box::new(x))), @@ -100,19 +100,19 @@ pub(crate) fn sign(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn size(s: Span) -> IResult { let (s, a) = non_zero_unsigned_number(s)?; Ok((s, Size { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn non_zero_unsigned_number(s: Span) -> IResult { let (s, a) = ws(non_zero_unsigned_number_impl)(s)?; Ok((s, NonZeroUnsignedNumber { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn non_zero_unsigned_number_impl(s: Span) -> IResult { let (s, a) = is_a("123456789")(s)?; let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| { @@ -121,7 +121,7 @@ pub(crate) fn non_zero_unsigned_number_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn real_number(s: Span) -> IResult { alt(( real_number_floating, @@ -131,7 +131,7 @@ pub(crate) fn real_number(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn real_number_floating(s: Span) -> IResult { let (s, a) = unsigned_number(s)?; let (s, b) = opt(pair(symbol("."), unsigned_number))(s)?; @@ -146,7 +146,7 @@ pub(crate) fn real_number_floating(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn fixed_point_number(s: Span) -> IResult { let (s, a) = unsigned_number(s)?; let (s, b) = map(tag("."), |x: Span| Symbol { @@ -156,19 +156,19 @@ pub(crate) fn fixed_point_number(s: Span) -> IResult { Ok((s, FixedPointNumber { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn exp(s: Span) -> IResult { let (s, a) = alt((symbol("e"), symbol("E")))(s)?; Ok((s, Exp { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn unsigned_number(s: Span) -> IResult { let (s, a) = ws(unsigned_number_impl)(s)?; Ok((s, UnsignedNumber { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn unsigned_number_impl(s: Span) -> IResult { let (s, a) = digit1(s)?; let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| { @@ -177,13 +177,13 @@ pub(crate) fn unsigned_number_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn binary_value(s: Span) -> IResult { let (s, a) = ws(binary_value_impl)(s)?; Ok((s, BinaryValue { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn binary_value_impl(s: Span) -> IResult { let (s, a) = is_a("01xXzZ?")(s)?; let (s, a) = fold_many0(alt((tag("_"), is_a("01xXzZ?"))), a, |acc, item| { @@ -192,13 +192,13 @@ pub(crate) fn binary_value_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn octal_value(s: Span) -> IResult { let (s, a) = ws(octal_value_impl)(s)?; Ok((s, OctalValue { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn octal_value_impl(s: Span) -> IResult { let (s, a) = is_a("01234567xXzZ?")(s)?; let (s, a) = fold_many0(alt((tag("_"), is_a("01234567xXzZ?"))), a, |acc, item| { @@ -207,13 +207,13 @@ pub(crate) fn octal_value_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn hex_value(s: Span) -> IResult { let (s, a) = ws(hex_value_impl)(s)?; Ok((s, HexValue { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn hex_value_impl(s: Span) -> IResult { let (s, a) = is_a("0123456789abcdefABCDEFxXzZ?")(s)?; let (s, a) = fold_many0( @@ -224,61 +224,61 @@ pub(crate) fn hex_value_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn decimal_base(s: Span) -> IResult { let (s, a) = ws(decimal_base_impl)(s)?; Ok((s, DecimalBase { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn decimal_base_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("'d"), tag_no_case("'sd")))(s)?; Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn binary_base(s: Span) -> IResult { let (s, a) = ws(binary_base_impl)(s)?; Ok((s, BinaryBase { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn binary_base_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("'b"), tag_no_case("'sb")))(s)?; Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn octal_base(s: Span) -> IResult { let (s, a) = ws(octal_base_impl)(s)?; Ok((s, OctalBase { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn octal_base_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("'o"), tag_no_case("'so")))(s)?; Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn hex_base(s: Span) -> IResult { let (s, a) = ws(hex_base_impl)(s)?; Ok((s, HexBase { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn hex_base_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("'h"), tag_no_case("'sh")))(s)?; Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn x_number(s: Span) -> IResult { let (s, a) = ws(x_number_impl)(s)?; Ok((s, XNumber { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn x_number_impl(s: Span) -> IResult { let (s, a) = tag_no_case("x")(s)?; let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { @@ -287,13 +287,13 @@ pub(crate) fn x_number_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn z_number(s: Span) -> IResult { let (s, a) = ws(z_number_impl)(s)?; Ok((s, ZNumber { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn z_number_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("z"), tag("?")))(s)?; let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { @@ -302,7 +302,7 @@ pub(crate) fn z_number_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn unbased_unsized_literal(s: Span) -> IResult { let (s, a) = alt((symbol("'0"), symbol("'1"), symbol("'z"), symbol("'x")))(s)?; Ok((s, UnbasedUnsizedLiteral { nodes: (a,) })) diff --git a/sv-parser-parser/src/expressions/operators.rs b/sv-parser-parser/src/expressions/operators.rs index bcf41c4..7c39b17 100644 --- a/sv-parser-parser/src/expressions/operators.rs +++ b/sv-parser-parser/src/expressions/operators.rs @@ -3,7 +3,7 @@ use crate::*; // ----------------------------------------------------------------------------- #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn unary_operator(s: Span) -> IResult { let (s, a) = alt(( symbol("+"), @@ -21,7 +21,7 @@ pub(crate) fn unary_operator(s: Span) -> IResult { Ok((s, UnaryOperator { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn binary_operator(s: Span) -> IResult { let (s, a) = alt(( alt(( @@ -61,13 +61,13 @@ pub(crate) fn binary_operator(s: Span) -> IResult { Ok((s, BinaryOperator { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn inc_or_dec_operator(s: Span) -> IResult { let (s, a) = alt((symbol("++"), symbol("--")))(s)?; Ok((s, IncOrDecOperator { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn unary_module_path_operator(s: Span) -> IResult { let (s, a) = alt(( symbol("!"), @@ -83,7 +83,7 @@ pub(crate) fn unary_module_path_operator(s: Span) -> IResult IResult { let (s, a) = alt(( symbol("=="), diff --git a/sv-parser-parser/src/expressions/primaries.rs b/sv-parser-parser/src/expressions/primaries.rs index c1e63bd..b89d4f8 100644 --- a/sv-parser-parser/src/expressions/primaries.rs +++ b/sv-parser-parser/src/expressions/primaries.rs @@ -3,7 +3,7 @@ use crate::*; // ----------------------------------------------------------------------------- #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn constant_primary(s: Span) -> IResult { alt(( map(keyword("null"), |x| ConstantPrimary::Null(Box::new(x))), @@ -38,7 +38,7 @@ pub(crate) fn constant_primary(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult { let (s, a) = ps_parameter_identifier(s)?; let (s, b) = constant_select(s)?; @@ -48,7 +48,7 @@ pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult IResult { let (s, a) = specparam_identifier(s)?; let (s, b) = opt(bracket(constant_range_expression))(s)?; @@ -58,7 +58,7 @@ pub(crate) fn constant_primary_specparam(s: Span) -> IResult IResult { let (s, a) = formal_port_identifier(s)?; let (s, b) = constant_select(s)?; @@ -68,7 +68,7 @@ pub(crate) fn constant_primary_formal_port(s: Span) -> IResult IResult { let (s, a) = package_scope_or_class_scope(s)?; let (s, b) = enum_identifier(s)?; @@ -78,7 +78,7 @@ pub(crate) fn constant_primary_enum(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn constant_primary_concatenation(s: Span) -> IResult { let (s, a) = constant_concatenation(s)?; let (s, b) = opt(bracket(constant_range_expression))(s)?; @@ -88,7 +88,7 @@ pub(crate) fn constant_primary_concatenation(s: Span) -> IResult IResult { let (s, a) = constant_multiple_concatenation(s)?; let (s, b) = opt(bracket(constant_range_expression))(s)?; @@ -100,7 +100,7 @@ pub(crate) fn constant_primary_multiple_concatenation(s: Span) -> IResult IResult { let (s, a) = paren(constant_mintypmax_expression)(s)?; Ok(( @@ -111,7 +111,7 @@ pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult IResult { alt(( map(number, |x| ModulePathPrimary::Number(Box::new(x))), @@ -129,7 +129,7 @@ pub(crate) fn module_path_primary(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_path_primary_mintypmax_expression( s: Span, ) -> IResult { @@ -141,7 +141,7 @@ pub(crate) fn module_path_primary_mintypmax_expression( } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn primary(s: Span) -> IResult { alt(( map(keyword("this"), |x| Primary::This(Box::new(x))), @@ -172,7 +172,7 @@ pub(crate) fn primary(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn primary_hierarchical(s: Span) -> IResult { let (s, a) = opt(class_qualifier_or_package_scope)(s)?; let (s, b) = hierarchical_identifier(s)?; @@ -183,7 +183,7 @@ pub(crate) fn primary_hierarchical(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn primary_concatenation(s: Span) -> IResult { let (s, a) = concatenation(s)?; let (s, b) = opt(bracket(range_expression))(s)?; @@ -193,7 +193,7 @@ pub(crate) fn primary_concatenation(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult { let (s, a) = multiple_concatenation(s)?; let (s, b) = opt(bracket(range_expression))(s)?; @@ -203,7 +203,7 @@ pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult { let (s, a) = paren(mintypmax_expression)(s)?; Ok(( @@ -212,7 +212,7 @@ pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_qualifier_or_package_scope( s: Span, ) -> IResult { @@ -227,14 +227,14 @@ pub(crate) fn class_qualifier_or_package_scope( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn class_qualifier(s: Span) -> IResult { let (s, a) = opt(local)(s)?; let (s, b) = opt(implicit_class_handle_or_class_scope)(s)?; Ok((s, ClassQualifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn range_expression(s: Span) -> IResult { alt(( map(expression, |x| RangeExpression::Expression(Box::new(x))), @@ -245,7 +245,7 @@ pub(crate) fn range_expression(s: Span) -> IResult { } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn primary_literal(s: Span) -> IResult { alt(( map(time_literal, |x| PrimaryLiteral::TimeLiteral(Box::new(x))), @@ -259,12 +259,12 @@ pub(crate) fn primary_literal(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn time_literal(s: Span) -> IResult { alt((time_literal_unsigned, time_literal_fixed_point))(s) } -#[parser] +#[tracable_parser] pub(crate) fn time_literal_unsigned(s: Span) -> IResult { let (s, a) = unsigned_number(s)?; let (s, b) = time_unit(s)?; @@ -274,7 +274,7 @@ pub(crate) fn time_literal_unsigned(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn time_literal_fixed_point(s: Span) -> IResult { let (s, a) = fixed_point_number(s)?; let (s, b) = time_unit(s)?; @@ -284,7 +284,7 @@ pub(crate) fn time_literal_fixed_point(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn time_unit(s: Span) -> IResult { alt(( map(keyword("s"), |x| TimeUnit::S(Box::new(x))), @@ -296,7 +296,7 @@ pub(crate) fn time_unit(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn implicit_class_handle(s: Span) -> IResult { alt(( map( @@ -310,13 +310,13 @@ pub(crate) fn implicit_class_handle(s: Span) -> IResult IResult { let (s, a) = many0(bracket(expression))(s)?; Ok((s, BitSelect { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn select(s: Span) -> IResult { let (s, a) = opt(triple( many0(triple(symbol("."), member_identifier, bit_select)), @@ -328,7 +328,7 @@ pub(crate) fn select(s: Span) -> IResult { Ok((s, Select { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn nonrange_select(s: Span) -> IResult { let (s, a) = opt(triple( many0(triple(symbol("."), member_identifier, bit_select)), @@ -339,13 +339,13 @@ pub(crate) fn nonrange_select(s: Span) -> IResult { Ok((s, NonrangeSelect { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn constant_bit_select(s: Span) -> IResult { let (s, a) = many0(bracket(constant_expression))(s)?; Ok((s, ConstantBitSelect { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constant_select(s: Span) -> IResult { let (s, a) = opt(triple( many0(triple(symbol("."), member_identifier, constant_bit_select)), @@ -358,7 +358,7 @@ pub(crate) fn constant_select(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn constant_cast(s: Span) -> IResult { let (s, a) = casting_type(s)?; let (s, b) = symbol("'")(s)?; @@ -366,14 +366,14 @@ pub(crate) fn constant_cast(s: Span) -> IResult { Ok((s, ConstantCast { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn constant_let_expression(s: Span) -> IResult { let (s, a) = let_expression(s)?; Ok((s, ConstantLetExpression { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn cast(s: Span) -> IResult { let (s, a) = casting_type(s)?; let (s, b) = symbol("'")(s)?; diff --git a/sv-parser-parser/src/expressions/strings.rs b/sv-parser-parser/src/expressions/strings.rs index 6b2403a..8af7117 100644 --- a/sv-parser-parser/src/expressions/strings.rs +++ b/sv-parser-parser/src/expressions/strings.rs @@ -2,13 +2,13 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn string_literal(s: Span) -> IResult { let (s, a) = ws(string_literal_impl)(s)?; Ok((s, StringLiteral { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn string_literal_impl(s: Span) -> IResult { let (s, a) = tag("\"")(s)?; let (s, b) = many1(pair(is_not("\\\""), opt(pair(tag("\\"), take(1usize)))))(s)?; diff --git a/sv-parser-parser/src/expressions/subroutine_calls.rs b/sv-parser-parser/src/expressions/subroutine_calls.rs index 3fb7360..ac59a07 100644 --- a/sv-parser-parser/src/expressions/subroutine_calls.rs +++ b/sv-parser-parser/src/expressions/subroutine_calls.rs @@ -2,13 +2,13 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn constant_function_call(s: Span) -> IResult { let (s, a) = function_subroutine_call(s)?; Ok((s, ConstantFunctionCall { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn tf_call(s: Span) -> IResult { let (s, a) = ps_or_hierarchical_tf_identifier(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -16,7 +16,7 @@ pub(crate) fn tf_call(s: Span) -> IResult { Ok((s, TfCall { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn system_tf_call(s: Span) -> IResult { alt(( system_tf_call_arg_optional, @@ -25,7 +25,7 @@ pub(crate) fn system_tf_call(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult { let (s, a) = system_tf_identifier(s)?; let (s, b) = opt(paren(list_of_arguments))(s)?; @@ -35,7 +35,7 @@ pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult IResult { let (s, a) = system_tf_identifier(s)?; let (s, b) = paren(pair(data_type, opt(pair(symbol(","), expression))))(s)?; @@ -45,7 +45,7 @@ pub(crate) fn system_tf_call_arg_data_type(s: Span) -> IResult IResult { let (s, a) = system_tf_identifier(s)?; let (s, b) = paren(pair( @@ -59,7 +59,7 @@ pub(crate) fn system_tf_call_arg_expression(s: Span) -> IResult IResult { alt(( map(tf_call, |x| SubroutineCall::TfCall(Box::new(x))), @@ -71,7 +71,7 @@ pub(crate) fn subroutine_call(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn subroutine_call_randomize(s: Span) -> IResult { let (s, a) = opt(pair(keyword("std"), symbol("::")))(s)?; let (s, b) = randomize_call(s)?; @@ -81,18 +81,18 @@ pub(crate) fn subroutine_call_randomize(s: Span) -> IResult IResult { map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_arguments(s: Span) -> IResult { alt((list_of_arguments_ordered, list_of_arguments_named))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn list_of_arguments_ordered(s: Span) -> IResult { let (s, a) = list(symbol(","), opt(expression))(s)?; let (s, b) = many0(tuple(( @@ -107,7 +107,7 @@ pub(crate) fn list_of_arguments_ordered(s: Span) -> IResult IResult { let (s, a) = symbol(".")(s)?; let (s, b) = identifier(s)?; @@ -127,7 +127,7 @@ pub(crate) fn list_of_arguments_named(s: Span) -> IResult } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn method_call(s: Span) -> IResult { let (s, a) = method_call_root(s)?; let (s, b) = symbol(".")(s)?; @@ -136,7 +136,7 @@ pub(crate) fn method_call(s: Span) -> IResult { Ok((s, MethodCall { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn method_call_body(s: Span) -> IResult { alt(( method_call_body_user, @@ -146,7 +146,7 @@ pub(crate) fn method_call_body(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn method_call_body_user(s: Span) -> IResult { let (s, a) = method_identifier(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -157,7 +157,7 @@ pub(crate) fn method_call_body_user(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn built_in_method_call(s: Span) -> IResult { alt(( map(array_manipulation_call, |x| { @@ -169,7 +169,7 @@ pub(crate) fn built_in_method_call(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn array_manipulation_call(s: Span) -> IResult { let (s, a) = array_method_name(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -183,7 +183,7 @@ pub(crate) fn array_manipulation_call(s: Span) -> IResult IResult { let (s, a) = keyword("randomize")(s)?; let (s, b) = many0(attribute_instance)(s)?; @@ -201,7 +201,7 @@ pub(crate) fn randomize_call(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn variable_identifier_list_or_null( s: Span, ) -> IResult { @@ -215,7 +215,7 @@ pub(crate) fn variable_identifier_list_or_null( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn method_call_root(s: Span) -> IResult { alt(( map(primary, |x| MethodCallRoot::Primary(Box::new(x))), @@ -225,7 +225,7 @@ pub(crate) fn method_call_root(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn array_method_name(s: Span) -> IResult { alt(( map(keyword("unique"), |x| ArrayMethodName::Unique(Box::new(x))), diff --git a/sv-parser-parser/src/general/attributes.rs b/sv-parser-parser/src/general/attributes.rs index 138a224..85649c4 100644 --- a/sv-parser-parser/src/general/attributes.rs +++ b/sv-parser-parser/src/general/attributes.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn attribute_instance(s: Span) -> IResult { let (s, a) = symbol("(*")(s)?; let (s, b) = list(symbol(","), attr_spec)(s)?; @@ -10,7 +10,7 @@ pub(crate) fn attribute_instance(s: Span) -> IResult { Ok((s, AttributeInstance { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn attr_spec(s: Span) -> IResult { let (s, a) = identifier(s)?; let (s, b) = opt(pair(symbol("="), constant_expression))(s)?; diff --git a/sv-parser-parser/src/general/comments.rs b/sv-parser-parser/src/general/comments.rs index d30e4ac..b92c92f 100644 --- a/sv-parser-parser/src/general/comments.rs +++ b/sv-parser-parser/src/general/comments.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn comment(s: Span) -> IResult { alt((one_line_comment, block_comment))(s) } -#[parser] +#[tracable_parser] pub(crate) fn one_line_comment(s: Span) -> IResult { let (s, a) = tag("//")(s)?; let (s, b) = is_not("\n")(s)?; @@ -20,7 +20,7 @@ pub(crate) fn one_line_comment(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn block_comment(s: Span) -> IResult { let (s, a) = tag("/*")(s)?; let (s, b) = is_not("*/")(s)?; diff --git a/sv-parser-parser/src/general/identifiers.rs b/sv-parser-parser/src/general/identifiers.rs index 579d798..9ccecdf 100644 --- a/sv-parser-parser/src/general/identifiers.rs +++ b/sv-parser-parser/src/general/identifiers.rs @@ -8,31 +8,31 @@ pub(crate) const AZ09_DOLLAR: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$"; #[allow(dead_code)] -#[parser] +#[tracable_parser] pub(crate) fn array_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ArrayIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn block_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, BlockIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn bin_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, BinIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn c_identifier(s: Span) -> IResult { let (s, a) = ws(c_identifier_impl)(s)?; Ok((s, CIdentifier { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn c_identifier_impl(s: Span) -> IResult { let (s, a) = is_a(AZ_)(s)?; let (s, b) = opt(is_a(AZ09_))(s)?; @@ -48,62 +48,62 @@ pub(crate) fn c_identifier_impl(s: Span) -> IResult { } } -#[parser] +#[tracable_parser] pub(crate) fn cell_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, CellIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn checker_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, CheckerIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn class_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ClassIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn class_variable_identifier(s: Span) -> IResult { let (s, a) = variable_identifier(s)?; Ok((s, ClassVariableIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn clocking_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ClockingIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn config_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ConfigIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn const_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ConstIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ConstraintIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn covergroup_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, CovergroupIdentifier { nodes: (a,) })) } #[allow(dead_code)] -#[parser] +#[tracable_parser] pub(crate) fn covergroup_variable_identifier( s: Span, ) -> IResult { @@ -111,19 +111,19 @@ pub(crate) fn covergroup_variable_identifier( Ok((s, CovergroupVariableIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn cover_point_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, CoverPointIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn cross_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, CrossIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn dynamic_array_variable_identifier( s: Span, ) -> IResult { @@ -131,19 +131,19 @@ pub(crate) fn dynamic_array_variable_identifier( Ok((s, DynamicArrayVariableIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn enum_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, EnumIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn escaped_identifier(s: Span) -> IResult { let (s, a) = ws(escaped_identifier_impl)(s)?; Ok((s, EscapedIdentifier { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn escaped_identifier_impl(s: Span) -> IResult { let (s, a) = tag("\\")(s)?; let (s, b) = is_not(" \t\r\n")(s)?; @@ -152,56 +152,56 @@ pub(crate) fn escaped_identifier_impl(s: Span) -> IResult { } #[allow(dead_code)] -#[parser] +#[tracable_parser] pub(crate) fn formal_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, FormalIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn formal_port_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, FormalPortIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn function_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, FunctionIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn generate_block_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, GenerateBlockIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn genvar_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, GenvarIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_array_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalArrayIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_block_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalBlockIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_event_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalEventIdentifier { nodes: (a,) })) } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_identifier(s: Span) -> IResult { let (s, a) = opt(root)(s)?; let (s, b) = many0(triple(identifier, constant_bit_select, symbol(".")))(s)?; @@ -209,20 +209,20 @@ pub(crate) fn hierarchical_identifier(s: Span) -> IResult IResult { let (s, a) = keyword("$root")(s)?; let (s, b) = symbol(".")(s)?; Ok((s, Root { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_net_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalNetIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_parameter_identifier( s: Span, ) -> IResult { @@ -230,7 +230,7 @@ pub(crate) fn hierarchical_parameter_identifier( Ok((s, HierarchicalParameterIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_property_identifier( s: Span, ) -> IResult { @@ -238,7 +238,7 @@ pub(crate) fn hierarchical_property_identifier( Ok((s, HierarchicalPropertyIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_sequence_identifier( s: Span, ) -> IResult { @@ -246,19 +246,19 @@ pub(crate) fn hierarchical_sequence_identifier( Ok((s, HierarchicalSequenceIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_task_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalTaskIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_tf_identifier(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; Ok((s, HierarchicalTfIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn hierarchical_variable_identifier( s: Span, ) -> IResult { @@ -267,7 +267,7 @@ pub(crate) fn hierarchical_variable_identifier( } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn identifier(s: Span) -> IResult { alt(( map(escaped_identifier, |x| { @@ -279,98 +279,98 @@ pub(crate) fn identifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn index_variable_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, IndexVariableIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn interface_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, InterfaceIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn interface_instance_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, InterfaceInstanceIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn inout_port_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, InoutPortIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn input_port_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, InputPortIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn instance_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, InstanceIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn library_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, LibraryIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn member_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, MemberIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn method_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, MethodIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn modport_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ModportIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn module_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ModuleIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn net_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, NetIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn net_type_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, NetTypeIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn output_port_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, OutputPortIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn package_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, PackageIdentifier { nodes: (a,) })) } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn package_scope(s: Span) -> IResult { alt(( package_scope_package, @@ -378,7 +378,7 @@ pub(crate) fn package_scope(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn package_scope_package(s: Span) -> IResult { let (s, a) = package_identifier(s)?; let (s, b) = symbol("::")(s)?; @@ -388,72 +388,72 @@ pub(crate) fn package_scope_package(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn unit(s: Span) -> IResult { let (s, a) = keyword("$unit")(s)?; let (s, b) = symbol("::")(s)?; Ok((s, Unit { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn parameter_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ParameterIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn port_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, PortIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn production_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ProductionIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn program_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, ProgramIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn property_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, PropertyIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_class_identifier(s: Span) -> IResult { let (s, a) = opt(package_scope)(s)?; let (s, b) = class_identifier(s)?; Ok((s, PsClassIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_covergroup_identifier(s: Span) -> IResult { let (s, a) = opt(package_scope)(s)?; let (s, b) = covergroup_identifier(s)?; Ok((s, PsCovergroupIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_checker_identifier(s: Span) -> IResult { let (s, a) = opt(package_scope)(s)?; let (s, b) = checker_identifier(s)?; Ok((s, PsCheckerIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_identifier(s: Span) -> IResult { let (s, a) = opt(package_scope)(s)?; let (s, b) = identifier(s)?; Ok((s, PsIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_array_identifier( s: Span, ) -> IResult { @@ -462,7 +462,7 @@ pub(crate) fn ps_or_hierarchical_array_identifier( Ok((s, PsOrHierarchicalArrayIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_net_identifier( s: Span, ) -> IResult { @@ -474,7 +474,7 @@ pub(crate) fn ps_or_hierarchical_net_identifier( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_net_identifier_package_scope( s: Span, ) -> IResult { @@ -488,7 +488,7 @@ pub(crate) fn ps_or_hierarchical_net_identifier_package_scope( )) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_property_identifier( s: Span, ) -> IResult { @@ -500,7 +500,7 @@ pub(crate) fn ps_or_hierarchical_property_identifier( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_property_identifier_package_scope( s: Span, ) -> IResult { @@ -514,7 +514,7 @@ pub(crate) fn ps_or_hierarchical_property_identifier_package_scope( )) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_sequence_identifier( s: Span, ) -> IResult { @@ -526,7 +526,7 @@ pub(crate) fn ps_or_hierarchical_sequence_identifier( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope( s: Span, ) -> IResult { @@ -540,7 +540,7 @@ pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope( )) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_tf_identifier( s: Span, ) -> IResult { @@ -552,7 +552,7 @@ pub(crate) fn ps_or_hierarchical_tf_identifier( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope( s: Span, ) -> IResult { @@ -567,7 +567,7 @@ pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope( } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn ps_parameter_identifier(s: Span) -> IResult { alt(( ps_parameter_identifier_scope, @@ -575,7 +575,7 @@ pub(crate) fn ps_parameter_identifier(s: Span) -> IResult IResult { let (s, a) = opt(package_scope_or_class_scope)(s)?; let (s, b) = parameter_identifier(s)?; @@ -585,7 +585,7 @@ pub(crate) fn ps_parameter_identifier_scope(s: Span) -> IResult IResult { let (s, a) = many0(triple( generate_block_identifier, @@ -600,32 +600,32 @@ pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult IResult { let (s, a) = opt(local_or_package_scope_or_class_scope)(s)?; let (s, b) = type_identifier(s)?; Ok((s, PsTypeIdentifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn sequence_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, SequenceIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn signal_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, SignalIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn simple_identifier(s: Span) -> IResult { let (s, a) = ws(simple_identifier_impl)(s)?; Ok((s, SimpleIdentifier { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn simple_identifier_impl(s: Span) -> IResult { let (s, a) = is_a(AZ_)(s)?; let (s, b) = opt(is_a(AZ09_DOLLAR))(s)?; @@ -641,19 +641,19 @@ pub(crate) fn simple_identifier_impl(s: Span) -> IResult { } } -#[parser] +#[tracable_parser] pub(crate) fn specparam_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, SpecparamIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn system_tf_identifier(s: Span) -> IResult { let (s, a) = ws(system_tf_identifier_impl)(s)?; Ok((s, SystemTfIdentifier { nodes: a })) } -#[parser] +#[tracable_parser] pub(crate) fn system_tf_identifier_impl(s: Span) -> IResult { let (s, a) = tag("$")(s)?; let (s, b) = is_a(AZ09_DOLLAR)(s)?; @@ -661,50 +661,50 @@ pub(crate) fn system_tf_identifier_impl(s: Span) -> IResult { Ok((s, into_locate(a))) } -#[parser] +#[tracable_parser] pub(crate) fn task_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, TaskIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn tf_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, TfIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn terminal_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, TerminalIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn topmodule_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, TopmoduleIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn type_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, TypeIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn udp_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, UdpIdentifier { nodes: (a,) })) } #[packrat_parser] -#[parser] +#[tracable_parser] pub(crate) fn variable_identifier(s: Span) -> IResult { let (s, a) = identifier(s)?; Ok((s, VariableIdentifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope( s: Span, ) -> IResult { @@ -721,7 +721,7 @@ pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn implicit_class_handle_or_package_scope( s: Span, ) -> IResult { @@ -735,7 +735,7 @@ pub(crate) fn implicit_class_handle_or_package_scope( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn implicit_class_handle_or_class_scope( s: Span, ) -> IResult { @@ -749,7 +749,7 @@ pub(crate) fn implicit_class_handle_or_class_scope( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult { alt(( map(package_scope, |x| { @@ -761,7 +761,7 @@ pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult IResult { @@ -778,7 +778,7 @@ pub(crate) fn local_or_package_scope_or_class_scope( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn local(s: Span) -> IResult { let (s, a) = keyword("local")(s)?; let (s, b) = symbol("::")(s)?; diff --git a/sv-parser-parser/src/instantiations/checker_instantiation.rs b/sv-parser-parser/src/instantiations/checker_instantiation.rs index 998f0d2..7db1fa1 100644 --- a/sv-parser-parser/src/instantiations/checker_instantiation.rs +++ b/sv-parser-parser/src/instantiations/checker_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn checker_instantiation(s: Span) -> IResult { let (s, a) = ps_checker_identifier(s)?; let (s, b) = name_of_instance(s)?; @@ -16,7 +16,7 @@ pub(crate) fn checker_instantiation(s: Span) -> IResult IResult { @@ -27,7 +27,7 @@ pub(crate) fn list_of_checker_port_connections( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn list_of_checker_port_connections_ordered( s: Span, ) -> IResult { @@ -40,7 +40,7 @@ pub(crate) fn list_of_checker_port_connections_ordered( )) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_checker_port_connections_named( s: Span, ) -> IResult { @@ -54,7 +54,7 @@ pub(crate) fn list_of_checker_port_connections_named( } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn ordered_checker_port_connection( s: Span, ) -> IResult { @@ -63,7 +63,7 @@ pub(crate) fn ordered_checker_port_connection( Ok((s, OrderedCheckerPortConnection { nodes: (x, y) })) } -#[parser] +#[tracable_parser] pub(crate) fn named_checker_port_connection(s: Span) -> IResult { alt(( named_checker_port_connection_identifier, @@ -71,7 +71,7 @@ pub(crate) fn named_checker_port_connection(s: Span) -> IResult IResult { @@ -87,7 +87,7 @@ pub(crate) fn named_checker_port_connection_identifier( )) } -#[parser] +#[tracable_parser] pub(crate) fn named_checker_port_connection_asterisk( s: Span, ) -> IResult { diff --git a/sv-parser-parser/src/instantiations/generated_instantiation.rs b/sv-parser-parser/src/instantiations/generated_instantiation.rs index 5b149ac..0c53aad 100644 --- a/sv-parser-parser/src/instantiations/generated_instantiation.rs +++ b/sv-parser-parser/src/instantiations/generated_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn generate_region(s: Span) -> IResult { let (s, a) = keyword("generate")(s)?; let (s, b) = many0(generate_item)(s)?; @@ -10,7 +10,7 @@ pub(crate) fn generate_region(s: Span) -> IResult { Ok((s, GenerateRegion { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn loop_generate_construct(s: Span) -> IResult { let (s, a) = keyword("for")(s)?; let (s, b) = paren(tuple(( @@ -24,7 +24,7 @@ pub(crate) fn loop_generate_construct(s: Span) -> IResult IResult { let (s, a) = opt(map(keyword("genvar"), |x| Genvar { nodes: (x,) }))(s)?; let (s, b) = genvar_identifier(s)?; @@ -38,7 +38,7 @@ pub(crate) fn generate_initialization(s: Span) -> IResult IResult { alt(( genvar_iteration_assignment, @@ -47,7 +47,7 @@ pub(crate) fn genvar_iteration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult { let (s, a) = genvar_identifier(s)?; let (s, b) = assignment_operator(s)?; @@ -58,7 +58,7 @@ pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult IResult { let (s, a) = inc_or_dec_operator(s)?; let (s, b) = genvar_identifier(s)?; @@ -68,7 +68,7 @@ pub(crate) fn genvar_iteration_prefix(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult { let (s, a) = genvar_identifier(s)?; let (s, b) = inc_or_dec_operator(s)?; @@ -78,7 +78,7 @@ pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn conditional_generate_construct( s: Span, ) -> IResult { @@ -92,7 +92,7 @@ pub(crate) fn conditional_generate_construct( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn if_generate_construct(s: Span) -> IResult { let (s, a) = keyword("if")(s)?; let (s, b) = paren(constant_expression)(s)?; @@ -106,7 +106,7 @@ pub(crate) fn if_generate_construct(s: Span) -> IResult IResult { let (s, a) = keyword("case")(s)?; let (s, b) = paren(constant_expression)(s)?; @@ -120,13 +120,13 @@ pub(crate) fn case_generate_construct(s: Span) -> IResult IResult { alt((case_generate_item_nondefault, case_generate_item_default))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn case_generate_item_nondefault(s: Span) -> IResult { let (s, a) = list(symbol(","), constant_expression)(s)?; let (s, b) = symbol(":")(s)?; @@ -137,7 +137,7 @@ pub(crate) fn case_generate_item_nondefault(s: Span) -> IResult IResult { let (s, a) = keyword("default")(s)?; let (s, b) = opt(symbol(":"))(s)?; @@ -148,7 +148,7 @@ pub(crate) fn case_generate_item_default(s: Span) -> IResult IResult { alt(( map(generate_item, |x| GenerateBlock::GenerateItem(Box::new(x))), @@ -156,7 +156,7 @@ pub(crate) fn generate_block(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn generate_block_multiple(s: Span) -> IResult { let (s, a) = opt(pair(generate_block_identifier, symbol(":")))(s)?; let (s, b) = keyword("begin")(s)?; @@ -172,7 +172,7 @@ pub(crate) fn generate_block_multiple(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn generate_item(s: Span) -> IResult { alt(( map(module_or_generate_item, |x| { diff --git a/sv-parser-parser/src/instantiations/interface_instantiation.rs b/sv-parser-parser/src/instantiations/interface_instantiation.rs index c7f2688..828a842 100644 --- a/sv-parser-parser/src/instantiations/interface_instantiation.rs +++ b/sv-parser-parser/src/instantiations/interface_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn interface_instantiation(s: Span) -> IResult { let (s, a) = interface_identifier(s)?; let (s, b) = opt(parameter_value_assignment)(s)?; diff --git a/sv-parser-parser/src/instantiations/module_instantiation.rs b/sv-parser-parser/src/instantiations/module_instantiation.rs index f7674ab..0cf0eb4 100644 --- a/sv-parser-parser/src/instantiations/module_instantiation.rs +++ b/sv-parser-parser/src/instantiations/module_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn module_instantiation(s: Span) -> IResult { let (s, a) = module_identifier(s)?; let (s, b) = opt(parameter_value_assignment)(s)?; @@ -16,14 +16,14 @@ pub(crate) fn module_instantiation(s: Span) -> IResult IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(opt(list_of_parameter_assignments))(s)?; Ok((s, ParameterValueAssignment { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult { alt(( list_of_parameter_assignments_ordered, @@ -32,7 +32,7 @@ pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult IResult { @@ -45,7 +45,7 @@ pub(crate) fn list_of_parameter_assignments_ordered( )) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_parameter_assignments_named( s: Span, ) -> IResult { @@ -58,13 +58,13 @@ pub(crate) fn list_of_parameter_assignments_named( )) } -#[parser] +#[tracable_parser] pub(crate) fn ordered_parameter_assignment(s: Span) -> IResult { let (s, x) = param_expression(s)?; Ok((s, OrderedParameterAssignment { nodes: (x,) })) } -#[parser] +#[tracable_parser] pub(crate) fn named_parameter_assignment(s: Span) -> IResult { let (s, a) = symbol(".")(s)?; let (s, b) = parameter_identifier(s)?; @@ -72,21 +72,21 @@ pub(crate) fn named_parameter_assignment(s: Span) -> IResult IResult { let (s, a) = name_of_instance(s)?; let (s, b) = paren(opt(list_of_port_connections))(s)?; Ok((s, HierarchicalInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn name_of_instance(s: Span) -> IResult { let (s, x) = instance_identifier(s)?; let (s, y) = many0(unpacked_dimension)(s)?; Ok((s, NameOfInstance { nodes: (x, y) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_port_connections(s: Span) -> IResult { alt(( list_of_port_connections_ordered, @@ -95,7 +95,7 @@ pub(crate) fn list_of_port_connections(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), ordered_port_connection)(s)?; Ok(( @@ -104,7 +104,7 @@ pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), named_port_connection)(s)?; Ok(( @@ -114,14 +114,14 @@ pub(crate) fn list_of_port_connections_named(s: Span) -> IResult IResult { let (s, x) = many0(attribute_instance)(s)?; let (s, y) = opt(expression)(s)?; Ok((s, OrderedPortConnection { nodes: (x, y) })) } -#[parser] +#[tracable_parser] pub(crate) fn named_port_connection(s: Span) -> IResult { alt(( named_port_connection_identifier, @@ -129,7 +129,7 @@ pub(crate) fn named_port_connection(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = symbol(".")(s)?; @@ -143,7 +143,7 @@ pub(crate) fn named_port_connection_identifier(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = symbol(".*")(s)?; diff --git a/sv-parser-parser/src/instantiations/program_instantiation.rs b/sv-parser-parser/src/instantiations/program_instantiation.rs index 4b948e6..ca4cda6 100644 --- a/sv-parser-parser/src/instantiations/program_instantiation.rs +++ b/sv-parser-parser/src/instantiations/program_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn program_instantiation(s: Span) -> IResult { let (s, a) = program_identifier(s)?; let (s, b) = opt(parameter_value_assignment)(s)?; diff --git a/sv-parser-parser/src/lib.rs b/sv-parser-parser/src/lib.rs index 8e2e3a2..14cfa7f 100644 --- a/sv-parser-parser/src/lib.rs +++ b/sv-parser-parser/src/lib.rs @@ -33,6 +33,9 @@ pub(crate) use nom::sequence::*; pub(crate) use nom::{Err, IResult}; pub(crate) use nom_packrat::{self, packrat_parser}; pub(crate) use nom_recursive::{recursive_parser, RecursiveInfo, RecursiveTracer}; +pub(crate) use nom_tracable::tracable_parser; +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) use nom_tracable::{HasTracableInfo, Tracable, TracableInfo}; pub(crate) use sv_parser_macros::*; pub(crate) use sv_parser_syntaxtree::*; @@ -40,8 +43,8 @@ pub(crate) use sv_parser_syntaxtree::*; #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct SpanInfo { - #[cfg(feature = "trace")] - pub depth: usize, + #[cfg(any(feature = "forward_trace", feature = "backward_trace"))] + pub tracable_info: TracableInfo, pub recursive_info: RecursiveInfo, } @@ -58,6 +61,18 @@ impl RecursiveTracer for SpanInfo { } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +impl HasTracableInfo for SpanInfo { + fn get_tracable_info(&self) -> TracableInfo { + self.tracable_info + } + + fn set_tracable_info(mut self, info: TracableInfo) -> Self { + self.tracable_info = info; + self + } +} + // ----------------------------------------------------------------------------- nom_packrat::storage!(AnyNode); diff --git a/sv-parser-parser/src/primitive_instances/primitive_gate_and_switch_types.rs b/sv-parser-parser/src/primitive_instances/primitive_gate_and_switch_types.rs index a223b1a..722ae94 100644 --- a/sv-parser-parser/src/primitive_instances/primitive_gate_and_switch_types.rs +++ b/sv-parser-parser/src/primitive_instances/primitive_gate_and_switch_types.rs @@ -2,13 +2,13 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn cmos_switchtype(s: Span) -> IResult { let (s, a) = alt((keyword("cmos"), keyword("rcmos")))(s)?; Ok((s, CmosSwitchtype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn enable_gatetype(s: Span) -> IResult { let (s, a) = alt(( keyword("bufif0"), @@ -19,7 +19,7 @@ pub(crate) fn enable_gatetype(s: Span) -> IResult { Ok((s, EnableGatetype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn mos_switchtype(s: Span) -> IResult { let (s, a) = alt(( keyword("nmos"), @@ -30,7 +30,7 @@ pub(crate) fn mos_switchtype(s: Span) -> IResult { Ok((s, MosSwitchtype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn n_input_gatetype(s: Span) -> IResult { let (s, a) = alt(( keyword("and"), @@ -43,13 +43,13 @@ pub(crate) fn n_input_gatetype(s: Span) -> IResult { Ok((s, NInputGatetype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn n_output_gatetype(s: Span) -> IResult { let (s, a) = alt((keyword("buf"), keyword("not")))(s)?; Ok((s, NOutputGatetype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn pass_en_switchtype(s: Span) -> IResult { let (s, a) = alt(( keyword("tranif0"), @@ -60,7 +60,7 @@ pub(crate) fn pass_en_switchtype(s: Span) -> IResult { Ok((s, PassEnSwitchtype { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn pass_switchtype(s: Span) -> IResult { let (s, a) = alt((keyword("tran"), keyword("rtran")))(s)?; Ok((s, PassSwitchtype { nodes: (a,) })) diff --git a/sv-parser-parser/src/primitive_instances/primitive_instantiation_and_instances.rs b/sv-parser-parser/src/primitive_instances/primitive_instantiation_and_instances.rs index 1a3f9c6..d3987c7 100644 --- a/sv-parser-parser/src/primitive_instances/primitive_instantiation_and_instances.rs +++ b/sv-parser-parser/src/primitive_instances/primitive_instantiation_and_instances.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn gate_instantiation(s: Span) -> IResult { alt(( gate_instantiation_cmos, @@ -17,7 +17,7 @@ pub(crate) fn gate_instantiation(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult { let (s, a) = cmos_switchtype(s)?; let (s, b) = opt(delay3)(s)?; @@ -31,7 +31,7 @@ pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult IResult { let (s, a) = enable_gatetype(s)?; let (s, b) = opt(drive_strength)(s)?; @@ -46,7 +46,7 @@ pub(crate) fn gate_instantiation_enable(s: Span) -> IResult IResult { let (s, a) = mos_switchtype(s)?; let (s, b) = opt(delay3)(s)?; @@ -60,7 +60,7 @@ pub(crate) fn gate_instantiation_mos(s: Span) -> IResult IResult { let (s, a) = n_input_gatetype(s)?; let (s, b) = opt(drive_strength)(s)?; @@ -75,7 +75,7 @@ pub(crate) fn gate_instantiation_n_input(s: Span) -> IResult IResult { let (s, a) = n_output_gatetype(s)?; let (s, b) = opt(drive_strength)(s)?; @@ -90,7 +90,7 @@ pub(crate) fn gate_instantiation_n_output(s: Span) -> IResult IResult { let (s, a) = pass_en_switchtype(s)?; let (s, b) = opt(delay2)(s)?; @@ -104,7 +104,7 @@ pub(crate) fn gate_instantiation_pass_en(s: Span) -> IResult IResult { let (s, a) = pass_switchtype(s)?; let (s, b) = list(symbol(","), pass_switch_instance)(s)?; @@ -115,7 +115,7 @@ pub(crate) fn gate_instantiation_pass(s: Span) -> IResult IResult { let (s, a) = keyword("pulldown")(s)?; let (s, b) = opt(pulldown_strength)(s)?; @@ -129,7 +129,7 @@ pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult IResult { let (s, a) = keyword("pullup")(s)?; let (s, b) = opt(pullup_strength)(s)?; @@ -143,7 +143,7 @@ pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -158,7 +158,7 @@ pub(crate) fn cmos_switch_instance(s: Span) -> IResult Ok((s, CmosSwitchInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn enable_gate_instance(s: Span) -> IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -171,7 +171,7 @@ pub(crate) fn enable_gate_instance(s: Span) -> IResult Ok((s, EnableGateInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn mos_switch_instance(s: Span) -> IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -184,7 +184,7 @@ pub(crate) fn mos_switch_instance(s: Span) -> IResult { Ok((s, MosSwitchInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn n_input_gate_instance(s: Span) -> IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -195,7 +195,7 @@ pub(crate) fn n_input_gate_instance(s: Span) -> IResult IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -206,14 +206,14 @@ pub(crate) fn n_output_gate_instance(s: Span) -> IResult IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple((inout_terminal, symbol(","), inout_terminal)))(s)?; Ok((s, PassSwitchInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn pass_enable_switch_instance(s: Span) -> IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( @@ -226,7 +226,7 @@ pub(crate) fn pass_enable_switch_instance(s: Span) -> IResult IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(output_terminal)(s)?; diff --git a/sv-parser-parser/src/primitive_instances/primitive_strengths.rs b/sv-parser-parser/src/primitive_instances/primitive_strengths.rs index 833f853..778c7c0 100644 --- a/sv-parser-parser/src/primitive_instances/primitive_strengths.rs +++ b/sv-parser-parser/src/primitive_instances/primitive_strengths.rs @@ -2,12 +2,12 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn pulldown_strength(s: Span) -> IResult { alt((pulldown_strength01, pulldown_strength10, pulldown_strength0))(s) } -#[parser] +#[tracable_parser] pub(crate) fn pulldown_strength01(s: Span) -> IResult { let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?; Ok(( @@ -16,7 +16,7 @@ pub(crate) fn pulldown_strength01(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pulldown_strength10(s: Span) -> IResult { let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?; Ok(( @@ -25,7 +25,7 @@ pub(crate) fn pulldown_strength10(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pulldown_strength0(s: Span) -> IResult { let (s, a) = paren(strength0)(s)?; Ok(( @@ -34,12 +34,12 @@ pub(crate) fn pulldown_strength0(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pullup_strength(s: Span) -> IResult { alt((pullup_strength01, pullup_strength10, pullup_strength1))(s) } -#[parser] +#[tracable_parser] pub(crate) fn pullup_strength01(s: Span) -> IResult { let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?; Ok(( @@ -48,7 +48,7 @@ pub(crate) fn pullup_strength01(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pullup_strength10(s: Span) -> IResult { let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?; Ok(( @@ -57,7 +57,7 @@ pub(crate) fn pullup_strength10(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn pullup_strength1(s: Span) -> IResult { let (s, a) = paren(strength1)(s)?; Ok(( diff --git a/sv-parser-parser/src/primitive_instances/primitive_terminals.rs b/sv-parser-parser/src/primitive_instances/primitive_terminals.rs index 3c1a396..117cf2c 100644 --- a/sv-parser-parser/src/primitive_instances/primitive_terminals.rs +++ b/sv-parser-parser/src/primitive_instances/primitive_terminals.rs @@ -2,37 +2,37 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn enable_terminal(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, EnableTerminal { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn inout_terminal(s: Span) -> IResult { let (s, a) = net_lvalue(s)?; Ok((s, InoutTerminal { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn input_terminal(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, InputTerminal { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn ncontrol_terminal(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, NcontrolTerminal { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn output_terminal(s: Span) -> IResult { let (s, a) = net_lvalue(s)?; Ok((s, OutputTerminal { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn pcontrol_terminal(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, PcontrolTerminal { nodes: (a,) })) diff --git a/sv-parser-parser/src/source_text/checker_items.rs b/sv-parser-parser/src/source_text/checker_items.rs index 8d2af48..2b8a2b4 100644 --- a/sv-parser-parser/src/source_text/checker_items.rs +++ b/sv-parser-parser/src/source_text/checker_items.rs @@ -2,13 +2,13 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn checker_port_list(s: Span) -> IResult { let (s, a) = list(symbol(","), checker_port_item)(s)?; Ok((s, CheckerPortList { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn checker_port_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = opt(checker_port_direction)(s)?; @@ -24,7 +24,7 @@ pub(crate) fn checker_port_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn checker_port_direction(s: Span) -> IResult { alt(( map(keyword("input"), |x| { @@ -36,7 +36,7 @@ pub(crate) fn checker_port_direction(s: Span) -> IResult IResult { alt(( map(checker_or_generate_item_declaration, |x| { @@ -63,7 +63,7 @@ pub(crate) fn checker_or_generate_item(s: Span) -> IResult IResult { @@ -95,7 +95,7 @@ pub(crate) fn checker_or_generate_item_declaration( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn checker_or_generate_item_declaration_data( s: Span, ) -> IResult { @@ -109,13 +109,13 @@ pub(crate) fn checker_or_generate_item_declaration_data( )) } -#[parser] +#[tracable_parser] pub(crate) fn rand(s: Span) -> IResult { let (s, a) = keyword("rand")(s)?; Ok((s, Rand { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn checker_or_generate_item_declaration_clocking( s: Span, ) -> IResult { @@ -133,7 +133,7 @@ pub(crate) fn checker_or_generate_item_declaration_clocking( )) } -#[parser] +#[tracable_parser] pub(crate) fn checker_or_generate_item_declaration_disable( s: Span, ) -> IResult { @@ -152,7 +152,7 @@ pub(crate) fn checker_or_generate_item_declaration_disable( )) } -#[parser] +#[tracable_parser] pub(crate) fn checker_generate_item(s: Span) -> IResult { alt(( map(loop_generate_construct, |x| { diff --git a/sv-parser-parser/src/source_text/class_items.rs b/sv-parser-parser/src/source_text/class_items.rs index 42c6f6f..7a38300 100644 --- a/sv-parser-parser/src/source_text/class_items.rs +++ b/sv-parser-parser/src/source_text/class_items.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn class_item(s: Span) -> IResult { alt(( class_item_property, @@ -20,7 +20,7 @@ pub(crate) fn class_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_property(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = class_property(s)?; @@ -30,7 +30,7 @@ pub(crate) fn class_item_property(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_method(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = class_method(s)?; @@ -40,7 +40,7 @@ pub(crate) fn class_item_method(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_constraint(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = class_constraint(s)?; @@ -50,7 +50,7 @@ pub(crate) fn class_item_constraint(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_declaration(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = class_declaration(s)?; @@ -60,7 +60,7 @@ pub(crate) fn class_item_declaration(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_covergroup(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = covergroup_declaration(s)?; @@ -70,12 +70,12 @@ pub(crate) fn class_item_covergroup(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_property(s: Span) -> IResult { alt((class_property_non_const, class_property_const))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_property_non_const(s: Span) -> IResult { let (s, a) = many0(property_qualifier)(s)?; let (s, b) = data_declaration(s)?; @@ -85,7 +85,7 @@ pub(crate) fn class_property_non_const(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn class_property_const(s: Span) -> IResult { let (s, a) = keyword("const")(s)?; let (s, b) = many0(class_item_qualifier)(s)?; @@ -101,7 +101,7 @@ pub(crate) fn class_property_const(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method(s: Span) -> IResult { alt(( class_method_task, @@ -113,7 +113,7 @@ pub(crate) fn class_method(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_task(s: Span) -> IResult { let (s, a) = many0(method_qualifier)(s)?; let (s, b) = task_declaration(s)?; @@ -123,7 +123,7 @@ pub(crate) fn class_method_task(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_function(s: Span) -> IResult { let (s, a) = many0(method_qualifier)(s)?; let (s, b) = function_declaration(s)?; @@ -133,7 +133,7 @@ pub(crate) fn class_method_function(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_pure_virtual(s: Span) -> IResult { let (s, a) = keyword("pure")(s)?; let (s, b) = keyword("virtual")(s)?; @@ -148,7 +148,7 @@ pub(crate) fn class_method_pure_virtual(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_extern_method(s: Span) -> IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = many0(method_qualifier)(s)?; @@ -162,7 +162,7 @@ pub(crate) fn class_method_extern_method(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_constructor(s: Span) -> IResult { let (s, a) = many0(method_qualifier)(s)?; let (s, b) = class_constructor_declaration(s)?; @@ -172,7 +172,7 @@ pub(crate) fn class_method_constructor(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn class_method_extern_constructor(s: Span) -> IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = many0(method_qualifier)(s)?; @@ -183,7 +183,7 @@ pub(crate) fn class_method_extern_constructor(s: Span) -> IResult IResult { let (s, a) = keyword("function")(s)?; let (s, b) = keyword("new")(s)?; @@ -197,7 +197,7 @@ pub(crate) fn class_constructor_prototype(s: Span) -> IResult IResult { alt(( map(constraint_prototype, |x| { @@ -209,7 +209,7 @@ pub(crate) fn class_constraint(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_item_qualifier(s: Span) -> IResult { alt(( map(keyword("static"), |x| { @@ -222,7 +222,7 @@ pub(crate) fn class_item_qualifier(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn property_qualifier(s: Span) -> IResult { alt(( map(random_qualifier, |x| { @@ -234,7 +234,7 @@ pub(crate) fn property_qualifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn random_qualifier(s: Span) -> IResult { alt(( map(keyword("randc"), |x| RandomQualifier::Randc(Box::new(x))), @@ -242,7 +242,7 @@ pub(crate) fn random_qualifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn method_qualifier(s: Span) -> IResult { alt(( map(pair(keyword("pure"), keyword("virtual")), |x| { @@ -257,7 +257,7 @@ pub(crate) fn method_qualifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn method_prototype(s: Span) -> IResult { alt(( map(task_prototype, |x| { @@ -269,7 +269,7 @@ pub(crate) fn method_prototype(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn class_constructor_declaration(s: Span) -> IResult { let (s, a) = keyword("function")(s)?; let (s, b) = opt(class_scope)(s)?; @@ -295,7 +295,7 @@ pub(crate) fn class_constructor_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("new")(s)?; Ok((s, New { nodes: (a,) })) diff --git a/sv-parser-parser/src/source_text/configuration_source_text.rs b/sv-parser-parser/src/source_text/configuration_source_text.rs index b4b3059..f63cee9 100644 --- a/sv-parser-parser/src/source_text/configuration_source_text.rs +++ b/sv-parser-parser/src/source_text/configuration_source_text.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn config_declaration(s: Span) -> IResult { let (s, a) = keyword("config")(s)?; let (s, b) = config_identifier(s)?; @@ -20,7 +20,7 @@ pub(crate) fn config_declaration(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn design_statement(s: Span) -> IResult { let (s, a) = keyword("design")(s)?; let (s, b) = many0(pair( @@ -31,7 +31,7 @@ pub(crate) fn design_statement(s: Span) -> IResult { Ok((s, DesignStatement { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn config_rule_statement(s: Span) -> IResult { alt(( config_rule_statement_default, @@ -42,7 +42,7 @@ pub(crate) fn config_rule_statement(s: Span) -> IResult IResult { let (s, a) = default_clause(s)?; let (s, b) = liblist_clause(s)?; @@ -53,7 +53,7 @@ pub(crate) fn config_rule_statement_default(s: Span) -> IResult IResult { let (s, a) = inst_clause(s)?; let (s, b) = liblist_clause(s)?; @@ -64,7 +64,7 @@ pub(crate) fn config_rule_statement_inst_lib(s: Span) -> IResult IResult { let (s, a) = inst_clause(s)?; let (s, b) = use_clause(s)?; @@ -75,7 +75,7 @@ pub(crate) fn config_rule_statement_inst_use(s: Span) -> IResult IResult { let (s, a) = cell_clause(s)?; let (s, b) = liblist_clause(s)?; @@ -86,7 +86,7 @@ pub(crate) fn config_rule_statement_cell_lib(s: Span) -> IResult IResult { let (s, a) = cell_clause(s)?; let (s, b) = use_clause(s)?; @@ -97,27 +97,27 @@ pub(crate) fn config_rule_statement_cell_use(s: Span) -> IResult IResult { let (s, a) = keyword("default")(s)?; Ok((s, DefaultClause { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn inst_clause(s: Span) -> IResult { let (s, a) = keyword("instance")(s)?; let (s, b) = inst_name(s)?; Ok((s, InstClause { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn inst_name(s: Span) -> IResult { let (s, a) = topmodule_identifier(s)?; let (s, b) = many0(pair(symbol("."), instance_identifier))(s)?; Ok((s, InstName { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn cell_clause(s: Span) -> IResult { let (s, a) = keyword("cell")(s)?; let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?; @@ -125,19 +125,19 @@ pub(crate) fn cell_clause(s: Span) -> IResult { Ok((s, CellClause { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn liblist_clause(s: Span) -> IResult { let (s, a) = keyword("liblist")(s)?; let (s, b) = many0(library_identifier)(s)?; Ok((s, LiblistClause { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn use_clause(s: Span) -> IResult { alt((use_clause_cell, use_clause_named, use_clause_cell_named))(s) } -#[parser] +#[tracable_parser] pub(crate) fn use_clause_cell(s: Span) -> IResult { let (s, a) = keyword("use")(s)?; let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?; @@ -151,7 +151,7 @@ pub(crate) fn use_clause_cell(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn use_clause_named(s: Span) -> IResult { let (s, a) = keyword("use")(s)?; let (s, b) = list(symbol(","), named_parameter_assignment)(s)?; @@ -162,7 +162,7 @@ pub(crate) fn use_clause_named(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn use_clause_cell_named(s: Span) -> IResult { let (s, a) = keyword("use")(s)?; let (s, b) = opt(pair(library_identifier, symbol(".")))(s)?; @@ -177,7 +177,7 @@ pub(crate) fn use_clause_cell_named(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn config(s: Span) -> IResult { let (s, a) = keyword("config")(s)?; Ok((s, Config { nodes: (a,) })) diff --git a/sv-parser-parser/src/source_text/constraints.rs b/sv-parser-parser/src/source_text/constraints.rs index cc458b6..8c96863 100644 --- a/sv-parser-parser/src/source_text/constraints.rs +++ b/sv-parser-parser/src/source_text/constraints.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn constraint_declaration(s: Span) -> IResult { let (s, a) = opt(r#static)(s)?; let (s, b) = keyword("constraint")(s)?; @@ -16,19 +16,19 @@ pub(crate) fn constraint_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("static")(s)?; Ok((s, Static { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_block(s: Span) -> IResult { let (s, a) = brace(many0(constraint_block_item))(s)?; Ok((s, ConstraintBlock { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_block_item(s: Span) -> IResult { alt(( constraint_block_item_solve, @@ -38,7 +38,7 @@ pub(crate) fn constraint_block_item(s: Span) -> IResult IResult { let (s, a) = keyword("solve")(s)?; let (s, b) = solve_before_list(s)?; @@ -53,13 +53,13 @@ pub(crate) fn constraint_block_item_solve(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), constraint_primary)(s)?; Ok((s, SolveBeforeList { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_primary(s: Span) -> IResult { let (s, a) = opt(implicit_class_handle_or_class_scope)(s)?; let (s, b) = hierarchical_identifier(s)?; @@ -67,7 +67,7 @@ pub(crate) fn constraint_primary(s: Span) -> IResult { Ok((s, ConstraintPrimary { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_expression(s: Span) -> IResult { alt(( constraint_expression_expression, @@ -82,7 +82,7 @@ pub(crate) fn constraint_expression(s: Span) -> IResult IResult { let (s, a) = opt(soft)(s)?; let (s, b) = expression_or_dist(s)?; @@ -95,14 +95,14 @@ pub(crate) fn constraint_expression_expression(s: Span) -> IResult IResult { let (s, a) = keyword("soft")(s)?; Ok((s, Soft { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn constraint_expression_arrow(s: Span) -> IResult { let (s, a) = expression(s)?; let (s, b) = symbol("->")(s)?; @@ -113,7 +113,7 @@ pub(crate) fn constraint_expression_arrow(s: Span) -> IResult IResult { let (s, a) = keyword("if")(s)?; let (s, b) = paren(expression)(s)?; @@ -127,7 +127,7 @@ pub(crate) fn constraint_expression_if(s: Span) -> IResult IResult { let (s, a) = keyword("foreach")(s)?; let (s, b) = paren(pair( @@ -141,7 +141,7 @@ pub(crate) fn constraint_expression_foreach(s: Span) -> IResult IResult { let (s, a) = keyword("disable")(s)?; let (s, b) = keyword("soft")(s)?; @@ -155,14 +155,14 @@ pub(crate) fn constraint_expression_disable(s: Span) -> IResult IResult { let (s, a) = keyword("unique")(s)?; let (s, b) = brace(open_range_list)(s)?; Ok((s, UniquenessConstraint { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_set(s: Span) -> IResult { alt(( map(constraint_expression, |x| { @@ -172,7 +172,7 @@ pub(crate) fn constraint_set(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_set_brace(s: Span) -> IResult { let (s, a) = brace(many0(constraint_expression))(s)?; Ok(( @@ -182,26 +182,26 @@ pub(crate) fn constraint_set_brace(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn dist_list(s: Span) -> IResult { let (s, a) = list(symbol(","), dist_item)(s)?; Ok((s, DistList { nodes: (a,) })) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn dist_item(s: Span) -> IResult { let (s, a) = value_range(s)?; let (s, b) = opt(dist_weight)(s)?; Ok((s, DistItem { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn dist_weight(s: Span) -> IResult { alt((dist_weight_equal, dist_weight_divide))(s) } -#[parser] +#[tracable_parser] pub(crate) fn dist_weight_equal(s: Span) -> IResult { let (s, a) = symbol(":=")(s)?; let (s, b) = expression(s)?; @@ -211,7 +211,7 @@ pub(crate) fn dist_weight_equal(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn dist_weight_divide(s: Span) -> IResult { let (s, a) = symbol(":/")(s)?; let (s, b) = expression(s)?; @@ -221,7 +221,7 @@ pub(crate) fn dist_weight_divide(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn constraint_prototype(s: Span) -> IResult { let (s, a) = opt(constraint_prototype_qualifier)(s)?; let (s, b) = opt(r#static)(s)?; @@ -236,7 +236,7 @@ pub(crate) fn constraint_prototype(s: Span) -> IResult IResult { @@ -250,7 +250,7 @@ pub(crate) fn constraint_prototype_qualifier( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn extern_constraint_declaration(s: Span) -> IResult { let (s, a) = opt(r#static)(s)?; let (s, b) = keyword("constraint")(s)?; @@ -265,7 +265,7 @@ pub(crate) fn extern_constraint_declaration(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), identifier)(s)?; Ok((s, IdentifierList { nodes: (a,) })) diff --git a/sv-parser-parser/src/source_text/interface_items.rs b/sv-parser-parser/src/source_text/interface_items.rs index ce83325..13503ba 100644 --- a/sv-parser-parser/src/source_text/interface_items.rs +++ b/sv-parser-parser/src/source_text/interface_items.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn interface_or_generate_item(s: Span) -> IResult { alt(( interface_or_generate_item_module, @@ -11,7 +11,7 @@ pub(crate) fn interface_or_generate_item(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_common_item(s)?; @@ -21,7 +21,7 @@ pub(crate) fn interface_or_generate_item_module(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = extern_tf_declaration(s)?; @@ -31,12 +31,12 @@ pub(crate) fn interface_or_generate_item_extern(s: Span) -> IResult IResult { alt((extern_tf_declaration_method, extern_tf_declaration_task))(s) } -#[parser] +#[tracable_parser] pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = method_prototype(s)?; @@ -47,7 +47,7 @@ pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = keyword("forkjoin")(s)?; @@ -61,7 +61,7 @@ pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult IResult { alt(( map(pair(port_declaration, symbol(";")), |x| { @@ -73,7 +73,7 @@ pub(crate) fn interface_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn non_port_interface_item(s: Span) -> IResult { alt(( map(generate_region, |x| { diff --git a/sv-parser-parser/src/source_text/library_source_text.rs b/sv-parser-parser/src/source_text/library_source_text.rs index 086abaf..c87337a 100644 --- a/sv-parser-parser/src/source_text/library_source_text.rs +++ b/sv-parser-parser/src/source_text/library_source_text.rs @@ -2,13 +2,13 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn library_text(s: Span) -> IResult { let (s, a) = many0(library_description)(s)?; Ok((s, LibraryText { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn library_description(s: Span) -> IResult { alt(( map(library_declaration, |x| { @@ -24,7 +24,7 @@ pub(crate) fn library_description(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn library_declaration(s: Span) -> IResult { let (s, a) = keyword("library")(s)?; let (s, b) = library_identifier(s)?; @@ -39,7 +39,7 @@ pub(crate) fn library_declaration(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn include_statement(s: Span) -> IResult { let (s, a) = keyword("include")(s)?; let (s, b) = file_path_spec(s)?; @@ -48,7 +48,7 @@ pub(crate) fn include_statement(s: Span) -> IResult { } //TODO support non literal path -#[parser] +#[tracable_parser] pub(crate) fn file_path_spec(s: Span) -> IResult { let (s, a) = string_literal(s)?; Ok((s, FilePathSpec { nodes: (a,) })) diff --git a/sv-parser-parser/src/source_text/module_items.rs b/sv-parser-parser/src/source_text/module_items.rs index a534ce0..6129e6c 100644 --- a/sv-parser-parser/src/source_text/module_items.rs +++ b/sv-parser-parser/src/source_text/module_items.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn elaboration_system_task(s: Span) -> IResult { alt(( elaboration_system_task_fatal, @@ -12,7 +12,7 @@ pub(crate) fn elaboration_system_task(s: Span) -> IResult IResult { let (s, a) = keyword("$fatal")(s)?; let (s, b) = opt(paren(pair( @@ -26,7 +26,7 @@ pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult IResult { let (s, a) = keyword("$error")(s)?; let (s, b) = opt(paren(opt(list_of_arguments)))(s)?; @@ -37,7 +37,7 @@ pub(crate) fn elaboration_system_task_error(s: Span) -> IResult IResult { let (s, a) = keyword("$warning")(s)?; let (s, b) = opt(paren(opt(list_of_arguments)))(s)?; @@ -50,7 +50,7 @@ pub(crate) fn elaboration_system_task_warning(s: Span) -> IResult IResult { let (s, a) = keyword("$info")(s)?; let (s, b) = opt(paren(opt(list_of_arguments)))(s)?; @@ -61,7 +61,7 @@ pub(crate) fn elaboration_system_task_info(s: Span) -> IResult IResult { alt(( map(symbol("0"), |x| FinishNumber::Zero(Box::new(x))), @@ -70,7 +70,7 @@ pub(crate) fn finish_number(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_common_item(s: Span) -> IResult { alt(( map(module_or_generate_item_declaration, |x| { @@ -113,7 +113,7 @@ pub(crate) fn module_common_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_item(s: Span) -> IResult { alt(( map(pair(port_declaration, symbol(";")), |x| { @@ -125,7 +125,7 @@ pub(crate) fn module_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_or_generate_item(s: Span) -> IResult { alt(( module_or_generate_item_parameter, @@ -136,7 +136,7 @@ pub(crate) fn module_or_generate_item(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = parameter_override(s)?; @@ -146,7 +146,7 @@ pub(crate) fn module_or_generate_item_parameter(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = gate_instantiation(s)?; @@ -156,7 +156,7 @@ pub(crate) fn module_or_generate_item_gate(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = udp_instantiation(s)?; @@ -166,7 +166,7 @@ pub(crate) fn module_or_generate_item_udp(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_instantiation(s)?; @@ -177,7 +177,7 @@ pub(crate) fn module_or_generate_item_module(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_common_item(s)?; @@ -189,7 +189,7 @@ pub(crate) fn module_or_generate_item_module_item(s: Span) -> IResult IResult { @@ -208,7 +208,7 @@ pub(crate) fn module_or_generate_item_declaration( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_or_generate_item_declaration_clocking( s: Span, ) -> IResult { @@ -226,7 +226,7 @@ pub(crate) fn module_or_generate_item_declaration_clocking( )) } -#[parser] +#[tracable_parser] pub(crate) fn module_or_generate_item_declaration_disable( s: Span, ) -> IResult { @@ -245,7 +245,7 @@ pub(crate) fn module_or_generate_item_declaration_disable( )) } -#[parser] +#[tracable_parser] pub(crate) fn non_port_module_item(s: Span) -> IResult { alt(( map(generate_region, |x| { @@ -273,7 +273,7 @@ pub(crate) fn non_port_module_item(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = specparam_declaration(s)?; @@ -283,7 +283,7 @@ pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult IResult { let (s, a) = keyword("defparam")(s)?; let (s, b) = list_of_defparam_assignments(s)?; @@ -291,12 +291,12 @@ pub(crate) fn parameter_override(s: Span) -> IResult { Ok((s, ParameterOverride { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn bind_directive(s: Span) -> IResult { alt((bind_directive_scope, bind_directive_instance))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bind_directive_scope(s: Span) -> IResult { let (s, a) = keyword("bind")(s)?; let (s, b) = bind_target_scope(s)?; @@ -311,7 +311,7 @@ pub(crate) fn bind_directive_scope(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn bind_directive_instance(s: Span) -> IResult { let (s, a) = keyword("bind")(s)?; let (s, b) = bind_target_instance(s)?; @@ -325,7 +325,7 @@ pub(crate) fn bind_directive_instance(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn bind_target_scope(s: Span) -> IResult { alt(( map(module_identifier, |x| { @@ -337,20 +337,20 @@ pub(crate) fn bind_target_scope(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn bind_target_instance(s: Span) -> IResult { let (s, a) = hierarchical_identifier(s)?; let (s, b) = constant_bit_select(s)?; Ok((s, BindTargetInstance { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn bind_target_instance_list(s: Span) -> IResult { let (s, a) = list(symbol(","), bind_target_instance)(s)?; Ok((s, BindTargetInstanceList { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn bind_instantiation(s: Span) -> IResult { alt(( map(program_instantiation, |x| { diff --git a/sv-parser-parser/src/source_text/module_parameters_and_ports.rs b/sv-parser-parser/src/source_text/module_parameters_and_ports.rs index a815046..2dc45a0 100644 --- a/sv-parser-parser/src/source_text/module_parameters_and_ports.rs +++ b/sv-parser-parser/src/source_text/module_parameters_and_ports.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn parameter_port_list(s: Span) -> IResult { alt(( parameter_port_list_assignment, @@ -11,7 +11,7 @@ pub(crate) fn parameter_port_list(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(pair( @@ -24,7 +24,7 @@ pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult IResult { let (s, a) = symbol("#")(s)?; let (s, b) = paren(list(symbol(","), parameter_port_declaration))(s)?; @@ -34,7 +34,7 @@ pub(crate) fn parameter_port_list_declaration(s: Span) -> IResult IResult { let (s, a) = symbol("#")(s)?; let (s, b) = symbol("(")(s)?; @@ -42,7 +42,7 @@ pub(crate) fn parameter_port_list_empty(s: Span) -> IResult IResult { alt(( map(parameter_declaration, |x| { @@ -56,7 +56,7 @@ pub(crate) fn parameter_port_declaration(s: Span) -> IResult IResult { @@ -70,7 +70,7 @@ pub(crate) fn parameter_port_declaration_param_list( )) } -#[parser] +#[tracable_parser] pub(crate) fn parameter_port_declaration_type_list( s: Span, ) -> IResult { @@ -84,13 +84,13 @@ pub(crate) fn parameter_port_declaration_type_list( )) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_ports(s: Span) -> IResult { let (s, a) = paren(list(symbol(","), port))(s)?; Ok((s, ListOfPorts { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_port_declarations(s: Span) -> IResult { let (s, a) = paren(opt(list( symbol(","), @@ -99,7 +99,7 @@ pub(crate) fn list_of_port_declarations(s: Span) -> IResult IResult { alt(( port_declaration_inout, @@ -110,7 +110,7 @@ pub(crate) fn port_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn port_declaration_inout(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = inout_declaration(s)?; @@ -120,7 +120,7 @@ pub(crate) fn port_declaration_inout(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn port_declaration_input(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = input_declaration(s)?; @@ -130,7 +130,7 @@ pub(crate) fn port_declaration_input(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn port_declaration_output(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = output_declaration(s)?; @@ -140,7 +140,7 @@ pub(crate) fn port_declaration_output(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn port_declaration_ref(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = ref_declaration(s)?; @@ -150,7 +150,7 @@ pub(crate) fn port_declaration_ref(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn port_declaration_interface(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = interface_port_declaration(s)?; @@ -160,19 +160,19 @@ pub(crate) fn port_declaration_interface(s: Span) -> IResult IResult { alt((port_non_named, port_named))(s) } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn port_non_named(s: Span) -> IResult { let (s, a) = opt(port_expression)(s)?; Ok((s, Port::NonNamed(Box::new(PortNonNamed { nodes: (a,) })))) } -#[parser] +#[tracable_parser] pub(crate) fn port_named(s: Span) -> IResult { let (s, a) = symbol(".")(s)?; let (s, b) = port_identifier(s)?; @@ -180,7 +180,7 @@ pub(crate) fn port_named(s: Span) -> IResult { Ok((s, Port::Named(Box::new(PortNamed { nodes: (a, b, c) })))) } -#[parser] +#[tracable_parser] pub(crate) fn port_expression(s: Span) -> IResult { alt(( map(port_reference, |x| { @@ -190,7 +190,7 @@ pub(crate) fn port_expression(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn port_expressio_named(s: Span) -> IResult { let (s, a) = brace(list(symbol(","), port_reference))(s)?; Ok(( @@ -199,14 +199,14 @@ pub(crate) fn port_expressio_named(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn port_reference(s: Span) -> IResult { let (s, a) = port_identifier(s)?; let (s, b) = constant_select(s)?; Ok((s, PortReference { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn port_direction(s: Span) -> IResult { alt(( map(keyword("input"), |x| PortDirection::Input(Box::new(x))), @@ -216,21 +216,21 @@ pub(crate) fn port_direction(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn net_port_header(s: Span) -> IResult { let (s, a) = opt(port_direction)(s)?; let (s, b) = net_port_type(s)?; Ok((s, NetPortHeader { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn variable_port_header(s: Span) -> IResult { let (s, a) = opt(port_direction)(s)?; let (s, b) = variable_port_type(s)?; Ok((s, VariablePortHeader { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn interface_port_header(s: Span) -> IResult { alt(( interface_port_header_identifier, @@ -238,7 +238,7 @@ pub(crate) fn interface_port_header(s: Span) -> IResult IResult { let (s, a) = interface_identifier(s)?; let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?; @@ -248,7 +248,7 @@ pub(crate) fn interface_port_header_identifier(s: Span) -> IResult IResult { let (s, a) = keyword("interface")(s)?; let (s, b) = opt(pair(symbol("."), modport_identifier))(s)?; @@ -258,7 +258,7 @@ pub(crate) fn interface_port_header_interface(s: Span) -> IResult IResult { alt(( ansi_port_declaration_net, @@ -267,7 +267,7 @@ pub(crate) fn ansi_port_declaration(s: Span) -> IResult IResult { let (s, a) = opt(net_port_header_or_interface_port_header)(s)?; let (s, b) = port_identifier(s)?; @@ -281,7 +281,7 @@ pub(crate) fn ansi_port_declaration_net(s: Span) -> IResult IResult { @@ -295,7 +295,7 @@ pub(crate) fn net_port_header_or_interface_port_header( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn ansi_port_declaration_port(s: Span) -> IResult { let (s, a) = opt(variable_port_header)(s)?; let (s, b) = port_identifier(s)?; @@ -309,7 +309,7 @@ pub(crate) fn ansi_port_declaration_port(s: Span) -> IResult IResult { let (s, a) = opt(port_direction)(s)?; let (s, b) = symbol(".")(s)?; diff --git a/sv-parser-parser/src/source_text/package_items.rs b/sv-parser-parser/src/source_text/package_items.rs index 616c73d..a8cf40c 100644 --- a/sv-parser-parser/src/source_text/package_items.rs +++ b/sv-parser-parser/src/source_text/package_items.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn package_item(s: Span) -> IResult { alt(( map(package_or_generate_item_declaration, |x| { @@ -20,7 +20,7 @@ pub(crate) fn package_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn package_or_generate_item_declaration( s: Span, ) -> IResult { @@ -70,7 +70,7 @@ pub(crate) fn package_or_generate_item_declaration( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn anonymous_program(s: Span) -> IResult { let (s, a) = keyword("program")(s)?; let (s, b) = symbol(";")(s)?; @@ -84,7 +84,7 @@ pub(crate) fn anonymous_program(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn anonymous_program_item(s: Span) -> IResult { alt(( map(task_declaration, |x| { diff --git a/sv-parser-parser/src/source_text/program_items.rs b/sv-parser-parser/src/source_text/program_items.rs index 46c21e9..3830704 100644 --- a/sv-parser-parser/src/source_text/program_items.rs +++ b/sv-parser-parser/src/source_text/program_items.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn program_item(s: Span) -> IResult { alt(( map(pair(port_declaration, symbol(";")), |x| { @@ -14,7 +14,7 @@ pub(crate) fn program_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn non_port_program_item(s: Span) -> IResult { alt(( non_port_program_item_assign, @@ -31,7 +31,7 @@ pub(crate) fn non_port_program_item(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = continuous_assign(s)?; @@ -42,7 +42,7 @@ pub(crate) fn non_port_program_item_assign(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_or_generate_item_declaration(s)?; @@ -52,7 +52,7 @@ pub(crate) fn non_port_program_item_module(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = initial_construct(s)?; @@ -62,7 +62,7 @@ pub(crate) fn non_port_program_item_initial(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = final_construct(s)?; @@ -72,7 +72,7 @@ pub(crate) fn non_port_program_item_final(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = concurrent_assertion_item(s)?; @@ -82,7 +82,7 @@ pub(crate) fn non_port_program_item_assertion(s: Span) -> IResult IResult { alt(( map(loop_generate_construct, |x| { diff --git a/sv-parser-parser/src/source_text/system_verilog_source_text.rs b/sv-parser-parser/src/source_text/system_verilog_source_text.rs index e2efb49..6794f2c 100644 --- a/sv-parser-parser/src/source_text/system_verilog_source_text.rs +++ b/sv-parser-parser/src/source_text/system_verilog_source_text.rs @@ -2,14 +2,14 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn source_text(s: Span) -> IResult { let (s, a) = opt(timeunits_declaration)(s)?; let (s, b) = many0(description)(s)?; Ok((s, SourceText { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn description(s: Span) -> IResult { alt(( map(module_declaration, |x| { @@ -39,7 +39,7 @@ pub(crate) fn description(s: Span) -> IResult { } #[recursive_parser] -#[parser] +#[tracable_parser] pub(crate) fn description_package_item(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = package_item(s)?; @@ -49,7 +49,7 @@ pub(crate) fn description_package_item(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn description_bind_directive(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = bind_directive(s)?; @@ -59,7 +59,7 @@ pub(crate) fn description_bind_directive(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn module_nonansi_header(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_keyword(s)?; @@ -77,7 +77,7 @@ pub(crate) fn module_nonansi_header(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_keyword(s)?; @@ -95,7 +95,7 @@ pub(crate) fn module_ansi_header(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn module_declaration(s: Span) -> IResult { alt(( module_declaration_nonansi, @@ -106,7 +106,7 @@ pub(crate) fn module_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn module_declaration_nonansi(s: Span) -> IResult { let (s, a) = module_nonansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -121,7 +121,7 @@ pub(crate) fn module_declaration_nonansi(s: Span) -> IResult IResult { let (s, a) = module_ansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -136,7 +136,7 @@ pub(crate) fn module_declaration_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = module_keyword(s)?; @@ -156,7 +156,7 @@ pub(crate) fn module_declaration_wildcard(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = module_nonansi_header(s)?; @@ -168,7 +168,7 @@ pub(crate) fn module_declaration_extern_nonansi(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = module_ansi_header(s)?; @@ -178,7 +178,7 @@ pub(crate) fn module_declaration_extern_ansi(s: Span) -> IResult IResult { alt(( map(keyword("module"), |x| ModuleKeyword::Module(Box::new(x))), @@ -188,7 +188,7 @@ pub(crate) fn module_keyword(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn interface_declaration(s: Span) -> IResult { alt(( interface_declaration_nonansi, @@ -199,7 +199,7 @@ pub(crate) fn interface_declaration(s: Span) -> IResult IResult { let (s, a) = interface_nonansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -214,7 +214,7 @@ pub(crate) fn interface_declaration_nonansi(s: Span) -> IResult IResult { let (s, a) = interface_ansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -229,7 +229,7 @@ pub(crate) fn interface_declaration_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("interface")(s)?; @@ -249,7 +249,7 @@ pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = interface_nonansi_header(s)?; @@ -261,7 +261,7 @@ pub(crate) fn interface_declaration_extern_nonansi(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = interface_ansi_header(s)?; @@ -273,7 +273,7 @@ pub(crate) fn interface_declaration_extern_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("interface")(s)?; @@ -291,7 +291,7 @@ pub(crate) fn interface_nonansi_header(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("interface")(s)?; @@ -309,7 +309,7 @@ pub(crate) fn interface_ansi_header(s: Span) -> IResult IResult { alt(( program_declaration_nonansi, @@ -320,7 +320,7 @@ pub(crate) fn program_declaration(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn program_declaration_nonansi(s: Span) -> IResult { let (s, a) = program_nonansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -335,7 +335,7 @@ pub(crate) fn program_declaration_nonansi(s: Span) -> IResult IResult { let (s, a) = program_ansi_header(s)?; let (s, b) = opt(timeunits_declaration)(s)?; @@ -350,7 +350,7 @@ pub(crate) fn program_declaration_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("program")(s)?; @@ -369,7 +369,7 @@ pub(crate) fn program_declaration_wildcard(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = program_nonansi_header(s)?; @@ -381,7 +381,7 @@ pub(crate) fn program_declaration_extern_nonansi(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = program_ansi_header(s)?; @@ -391,7 +391,7 @@ pub(crate) fn program_declaration_extern_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("prgogram")(s)?; @@ -409,7 +409,7 @@ pub(crate) fn program_nonansi_header(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("program")(s)?; @@ -427,7 +427,7 @@ pub(crate) fn program_ansi_header(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn checker_declaration(s: Span) -> IResult { let (s, a) = keyword("checker")(s)?; let (s, b) = checker_identifier(s)?; @@ -444,7 +444,7 @@ pub(crate) fn checker_declaration(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn class_declaration(s: Span) -> IResult { let (s, a) = opt(map(keyword("virtual"), |x| Virtual { nodes: (x,) }))(s)?; let (s, b) = keyword("class")(s)?; @@ -472,14 +472,14 @@ pub(crate) fn class_declaration(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn interface_class_type(s: Span) -> IResult { let (s, a) = ps_class_identifier(s)?; let (s, b) = opt(parameter_value_assignment)(s)?; Ok((s, InterfaceClassType { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn interface_class_declaration(s: Span) -> IResult { let (s, a) = keyword("interface")(s)?; let (s, b) = keyword("class")(s)?; @@ -501,7 +501,7 @@ pub(crate) fn interface_class_declaration(s: Span) -> IResult IResult { alt(( map(type_declaration, |x| { @@ -518,7 +518,7 @@ pub(crate) fn interface_class_item(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn interface_class_item_method(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = interface_class_method(s)?; @@ -528,7 +528,7 @@ pub(crate) fn interface_class_item_method(s: Span) -> IResult IResult { let (s, a) = keyword("pure")(s)?; let (s, b) = keyword("virtual")(s)?; @@ -542,7 +542,7 @@ pub(crate) fn interface_class_method(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("package")(s)?; @@ -561,7 +561,7 @@ pub(crate) fn package_declaration(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn timeunits_declaration(s: Span) -> IResult { alt(( timeunits_declaration_timeunit_timeprecision, @@ -571,7 +571,7 @@ pub(crate) fn timeunits_declaration(s: Span) -> IResult IResult { let (s, a) = keyword("timeunit")(s)?; let (s, b) = time_literal(s)?; @@ -585,7 +585,7 @@ pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult IResult { let (s, a) = keyword("timeprecision")(s)?; let (s, b) = time_literal(s)?; @@ -598,7 +598,7 @@ pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult IResult { @@ -618,7 +618,7 @@ pub(crate) fn timeunits_declaration_timeunit_timeprecision( )) } -#[parser] +#[tracable_parser] pub(crate) fn timeunits_declaration_timeprecision_timeunit( s: Span, ) -> IResult { diff --git a/sv-parser-parser/src/specify_section/specify_block_declaration.rs b/sv-parser-parser/src/specify_section/specify_block_declaration.rs index e27b55c..532aaa0 100644 --- a/sv-parser-parser/src/specify_section/specify_block_declaration.rs +++ b/sv-parser-parser/src/specify_section/specify_block_declaration.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn specify_block(s: Span) -> IResult { let (s, a) = keyword("specify")(s)?; let (s, b) = many0(specify_item)(s)?; @@ -10,7 +10,7 @@ pub(crate) fn specify_block(s: Span) -> IResult { Ok((s, SpecifyBlock { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn specify_item(s: Span) -> IResult { alt(( map(specparam_declaration, |x| { @@ -31,7 +31,7 @@ pub(crate) fn specify_item(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn pulsestyle_declaration(s: Span) -> IResult { let (s, a) = alt(( keyword("pulsestyle_onevent"), @@ -42,7 +42,7 @@ pub(crate) fn pulsestyle_declaration(s: Span) -> IResult IResult { let (s, a) = alt((keyword("showcalcelled"), keyword("noshowcancelled")))(s)?; let (s, b) = list_of_path_outputs(s)?; diff --git a/sv-parser-parser/src/specify_section/specify_block_terminals.rs b/sv-parser-parser/src/specify_section/specify_block_terminals.rs index 001776c..b609a5a 100644 --- a/sv-parser-parser/src/specify_section/specify_block_terminals.rs +++ b/sv-parser-parser/src/specify_section/specify_block_terminals.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn specify_input_terminal_descriptor( s: Span, ) -> IResult { @@ -11,7 +11,7 @@ pub(crate) fn specify_input_terminal_descriptor( Ok((s, SpecifyInputTerminalDescriptor { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn specify_output_terminal_descriptor( s: Span, ) -> IResult { @@ -20,7 +20,7 @@ pub(crate) fn specify_output_terminal_descriptor( Ok((s, SpecifyOutputTerminalDescriptor { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn input_identifier(s: Span) -> IResult { alt(( map(input_port_identifier, |x| { @@ -33,7 +33,7 @@ pub(crate) fn input_identifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn input_identifier_interface(s: Span) -> IResult { let (s, a) = interface_identifier(s)?; let (s, b) = symbol(".")(s)?; @@ -44,7 +44,7 @@ pub(crate) fn input_identifier_interface(s: Span) -> IResult IResult { alt(( map(output_port_identifier, |x| { @@ -57,7 +57,7 @@ pub(crate) fn output_identifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn output_identifier_interface(s: Span) -> IResult { let (s, a) = interface_identifier(s)?; let (s, b) = symbol(".")(s)?; diff --git a/sv-parser-parser/src/specify_section/specify_path_declarations.rs b/sv-parser-parser/src/specify_section/specify_path_declarations.rs index 6276fa4..6065b0b 100644 --- a/sv-parser-parser/src/specify_section/specify_path_declarations.rs +++ b/sv-parser-parser/src/specify_section/specify_path_declarations.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn path_declaration(s: Span) -> IResult { alt(( map(pair(simple_path_declaration, symbol(";")), |x| { @@ -17,7 +17,7 @@ pub(crate) fn path_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn simple_path_declaration(s: Span) -> IResult { alt(( simple_path_declaration_parallel, @@ -25,7 +25,7 @@ pub(crate) fn simple_path_declaration(s: Span) -> IResult IResult { let (s, a) = parallel_path_description(s)?; let (s, b) = symbol("=")(s)?; @@ -38,7 +38,7 @@ pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult IResult { let (s, a) = full_path_description(s)?; let (s, b) = symbol("=")(s)?; @@ -49,7 +49,7 @@ pub(crate) fn simple_path_declaration_full(s: Span) -> IResult IResult { let (s, a) = paren(tuple(( specify_input_terminal_descriptor, @@ -60,7 +60,7 @@ pub(crate) fn parallel_path_description(s: Span) -> IResult IResult { let (s, a) = paren(tuple(( list_of_path_inputs, @@ -71,13 +71,13 @@ pub(crate) fn full_path_description(s: Span) -> IResult IResult { let (s, a) = list(symbol(","), specify_input_terminal_descriptor)(s)?; Ok((s, ListOfPathInputs { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_path_outputs(s: Span) -> IResult { let (s, a) = list(symbol(","), specify_output_terminal_descriptor)(s)?; Ok((s, ListOfPathOutputs { nodes: (a,) })) diff --git a/sv-parser-parser/src/specify_section/specify_path_delays.rs b/sv-parser-parser/src/specify_section/specify_path_delays.rs index 0bcb5c7..7574da5 100644 --- a/sv-parser-parser/src/specify_section/specify_path_delays.rs +++ b/sv-parser-parser/src/specify_section/specify_path_delays.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn path_delay_value(s: Span) -> IResult { alt(( map(list_of_path_delay_expressions, |x| { @@ -12,7 +12,7 @@ pub(crate) fn path_delay_value(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn path_delay_value_paren(s: Span) -> IResult { let (s, a) = paren(list_of_path_delay_expressions)(s)?; Ok(( @@ -21,25 +21,25 @@ pub(crate) fn path_delay_value_paren(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn list_of_path_delay_expressions(s: Span) -> IResult { let (s, a) = list(symbol(","), t_path_delay_expression)(s)?; Ok((s, ListOfPathDelayExpressions { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn t_path_delay_expression(s: Span) -> IResult { let (s, a) = path_delay_expression(s)?; Ok((s, TPathDelayExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn path_delay_expression(s: Span) -> IResult { let (s, a) = constant_mintypmax_expression(s)?; Ok((s, PathDelayExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn edge_sensitive_path_declaration( s: Span, ) -> IResult { @@ -49,7 +49,7 @@ pub(crate) fn edge_sensitive_path_declaration( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn edge_sensitive_path_declaration_parallel( s: Span, ) -> IResult { @@ -64,7 +64,7 @@ pub(crate) fn edge_sensitive_path_declaration_parallel( )) } -#[parser] +#[tracable_parser] pub(crate) fn edge_sensitive_path_declaration_full( s: Span, ) -> IResult { @@ -79,7 +79,7 @@ pub(crate) fn edge_sensitive_path_declaration_full( )) } -#[parser] +#[tracable_parser] pub(crate) fn parallel_edge_sensitive_path_description( s: Span, ) -> IResult { @@ -98,7 +98,7 @@ pub(crate) fn parallel_edge_sensitive_path_description( Ok((s, ParallelEdgeSensitivePathDescription { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn full_edge_sensitive_path_description( s: Span, ) -> IResult { @@ -117,13 +117,13 @@ pub(crate) fn full_edge_sensitive_path_description( Ok((s, FullEdgeSensitivePathDescription { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn data_source_expression(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, DataSourceExpression { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn edge_identifier(s: Span) -> IResult { alt(( map(keyword("posedge"), |x| EdgeIdentifier::Posedge(Box::new(x))), @@ -132,7 +132,7 @@ pub(crate) fn edge_identifier(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn state_dependent_path_declaration( s: Span, ) -> IResult { @@ -143,7 +143,7 @@ pub(crate) fn state_dependent_path_declaration( ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn state_dependent_path_declaration_if_simple( s: Span, ) -> IResult { @@ -158,7 +158,7 @@ pub(crate) fn state_dependent_path_declaration_if_simple( )) } -#[parser] +#[tracable_parser] pub(crate) fn state_dependent_path_declaration_if_edge_sensitive( s: Span, ) -> IResult { @@ -173,7 +173,7 @@ pub(crate) fn state_dependent_path_declaration_if_edge_sensitive( )) } -#[parser] +#[tracable_parser] pub(crate) fn state_dependent_path_declaration_if_none( s: Span, ) -> IResult { @@ -187,7 +187,7 @@ pub(crate) fn state_dependent_path_declaration_if_none( )) } -#[parser] +#[tracable_parser] pub(crate) fn polarity_operator(s: Span) -> IResult { alt(( map(symbol("+"), |x| PolarityOperator { nodes: (x,) }), diff --git a/sv-parser-parser/src/specify_section/system_timing_check_command_arguments.rs b/sv-parser-parser/src/specify_section/system_timing_check_command_arguments.rs index bf92151..e501686 100644 --- a/sv-parser-parser/src/specify_section/system_timing_check_command_arguments.rs +++ b/sv-parser-parser/src/specify_section/system_timing_check_command_arguments.rs @@ -2,25 +2,25 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn timecheck_condition(s: Span) -> IResult { let (s, a) = mintypmax_expression(s)?; Ok((s, TimecheckCondition { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn controlled_referecne_event(s: Span) -> IResult { let (s, a) = controlled_timing_check_event(s)?; Ok((s, ControlledReferenceEvent { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn data_event(s: Span) -> IResult { let (s, a) = timing_check_event(s)?; Ok((s, DataEvent { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn delayed_data(s: Span) -> IResult { alt(( map(terminal_identifier, |x| { @@ -30,7 +30,7 @@ pub(crate) fn delayed_data(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult { let (s, a) = terminal_identifier(s)?; let (s, b) = bracket(constant_mintypmax_expression)(s)?; @@ -40,7 +40,7 @@ pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn delayed_reference(s: Span) -> IResult { alt(( map(terminal_identifier, |x| { @@ -50,7 +50,7 @@ pub(crate) fn delayed_reference(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult { let (s, a) = terminal_identifier(s)?; let (s, b) = bracket(constant_mintypmax_expression)(s)?; @@ -60,55 +60,55 @@ pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult IResult { let (s, a) = mintypmax_expression(s)?; Ok((s, EndEdgeOffset { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn event_based_flag(s: Span) -> IResult { let (s, a) = constant_expression(s)?; Ok((s, EventBasedFlag { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn notifier(s: Span) -> IResult { let (s, a) = variable_identifier(s)?; Ok((s, Notifier { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn referecne_event(s: Span) -> IResult { let (s, a) = timing_check_event(s)?; Ok((s, ReferenceEvent { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn remain_active_flag(s: Span) -> IResult { let (s, a) = constant_mintypmax_expression(s)?; Ok((s, RemainActiveFlag { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn timestamp_condition(s: Span) -> IResult { let (s, a) = mintypmax_expression(s)?; Ok((s, TimestampCondition { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn start_edge_offset(s: Span) -> IResult { let (s, a) = mintypmax_expression(s)?; Ok((s, StartEdgeOffset { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn threshold(s: Span) -> IResult { let (s, a) = constant_expression(s)?; Ok((s, Threshold { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn timing_check_limit(s: Span) -> IResult { let (s, a) = expression(s)?; Ok((s, TimingCheckLimit { nodes: (a,) })) diff --git a/sv-parser-parser/src/specify_section/system_timing_check_commands.rs b/sv-parser-parser/src/specify_section/system_timing_check_commands.rs index fee248b..b0a92af 100644 --- a/sv-parser-parser/src/specify_section/system_timing_check_commands.rs +++ b/sv-parser-parser/src/specify_section/system_timing_check_commands.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn system_timing_check(s: Span) -> IResult { alt(( map(setup_timing_check, |x| { @@ -44,7 +44,7 @@ pub(crate) fn system_timing_check(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn setup_timing_check(s: Span) -> IResult { let (s, a) = keyword("$setup")(s)?; let (s, b) = paren(tuple(( @@ -59,7 +59,7 @@ pub(crate) fn setup_timing_check(s: Span) -> IResult { Ok((s, SetupTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn hold_timing_check(s: Span) -> IResult { let (s, a) = keyword("$setup")(s)?; let (s, b) = paren(tuple(( @@ -74,7 +74,7 @@ pub(crate) fn hold_timing_check(s: Span) -> IResult { Ok((s, HoldTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn setuphold_timing_check(s: Span) -> IResult { let (s, a) = keyword("$setuphold")(s)?; let (s, b) = paren(tuple(( @@ -107,7 +107,7 @@ pub(crate) fn setuphold_timing_check(s: Span) -> IResult IResult { let (s, a) = keyword("$recovery")(s)?; let (s, b) = paren(tuple(( @@ -122,7 +122,7 @@ pub(crate) fn recovery_timing_check(s: Span) -> IResult IResult { let (s, a) = keyword("$removal")(s)?; let (s, b) = paren(tuple(( @@ -137,7 +137,7 @@ pub(crate) fn removal_timing_check(s: Span) -> IResult Ok((s, RemovalTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn recrem_timing_check(s: Span) -> IResult { let (s, a) = keyword("$recrem")(s)?; let (s, b) = paren(tuple(( @@ -170,7 +170,7 @@ pub(crate) fn recrem_timing_check(s: Span) -> IResult { Ok((s, RecremTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn skew_timing_check(s: Span) -> IResult { let (s, a) = keyword("$skew")(s)?; let (s, b) = paren(tuple(( @@ -185,7 +185,7 @@ pub(crate) fn skew_timing_check(s: Span) -> IResult { Ok((s, SkewTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn timeskew_timing_check(s: Span) -> IResult { let (s, a) = keyword("$timeskew")(s)?; let (s, b) = paren(tuple(( @@ -208,7 +208,7 @@ pub(crate) fn timeskew_timing_check(s: Span) -> IResult IResult { let (s, a) = keyword("$fullskew")(s)?; let (s, b) = paren(tuple(( @@ -233,7 +233,7 @@ pub(crate) fn fullskew_timing_check(s: Span) -> IResult IResult { let (s, a) = keyword("$period")(s)?; let (s, b) = paren(tuple(( @@ -246,7 +246,7 @@ pub(crate) fn period_timing_check(s: Span) -> IResult { Ok((s, PeriodTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn width_timing_check(s: Span) -> IResult { let (s, a) = keyword("$width")(s)?; let (s, b) = paren(tuple(( @@ -261,7 +261,7 @@ pub(crate) fn width_timing_check(s: Span) -> IResult { Ok((s, WidthTimingCheck { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn nocharge_timing_check(s: Span) -> IResult { let (s, a) = keyword("$nocharge")(s)?; let (s, b) = paren(tuple(( diff --git a/sv-parser-parser/src/specify_section/system_timing_check_event_definitions.rs b/sv-parser-parser/src/specify_section/system_timing_check_event_definitions.rs index 38f028a..ec5a284 100644 --- a/sv-parser-parser/src/specify_section/system_timing_check_event_definitions.rs +++ b/sv-parser-parser/src/specify_section/system_timing_check_event_definitions.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn timing_check_event(s: Span) -> IResult { let (s, a) = opt(timing_check_event_control)(s)?; let (s, b) = specify_terminal_descriptor(s)?; @@ -10,7 +10,7 @@ pub(crate) fn timing_check_event(s: Span) -> IResult { Ok((s, TimingCheckEvent { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn controlled_timing_check_event(s: Span) -> IResult { let (s, a) = timing_check_event_control(s)?; let (s, b) = specify_terminal_descriptor(s)?; @@ -18,7 +18,7 @@ pub(crate) fn controlled_timing_check_event(s: Span) -> IResult IResult { alt(( map(keyword("posedge"), |x| { @@ -36,7 +36,7 @@ pub(crate) fn timing_check_event_control(s: Span) -> IResult IResult { alt(( map(specify_input_terminal_descriptor, |x| { @@ -48,14 +48,14 @@ pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult IResult { let (s, a) = keyword("edge")(s)?; let (s, b) = bracket(list(symbol(","), edge_descriptor))(s)?; Ok((s, EdgeControlSpecifier { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn edge_descriptor(s: Span) -> IResult { alt(( map(keyword("01"), |x| EdgeDescriptor { nodes: (x,) }), @@ -79,7 +79,7 @@ pub(crate) fn edge_descriptor(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn timing_check_condition(s: Span) -> IResult { alt(( map(scalar_timing_check_condition, |x| { @@ -89,7 +89,7 @@ pub(crate) fn timing_check_condition(s: Span) -> IResult IResult { let (s, a) = paren(scalar_timing_check_condition)(s)?; Ok(( @@ -98,7 +98,7 @@ pub(crate) fn timing_check_condition_paren(s: Span) -> IResult IResult { alt(( map(expression, |x| { @@ -109,7 +109,7 @@ pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult IResult { @@ -123,7 +123,7 @@ pub(crate) fn scalar_timing_check_condition_unary( )) } -#[parser] +#[tracable_parser] pub(crate) fn scalar_timing_check_condition_binary( s: Span, ) -> IResult { @@ -138,7 +138,7 @@ pub(crate) fn scalar_timing_check_condition_binary( )) } -#[parser] +#[tracable_parser] pub(crate) fn scalar_constant(s: Span) -> IResult { alt(( map(keyword("1'b0"), |x| ScalarConstant { nodes: (x,) }), diff --git a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_body.rs b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_body.rs index bb689ed..8590017 100644 --- a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_body.rs +++ b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_body.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn udp_body(s: Span) -> IResult { alt(( map(combinational_body, |x| { @@ -12,7 +12,7 @@ pub(crate) fn udp_body(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn combinational_body(s: Span) -> IResult { let (s, a) = keyword("table")(s)?; let (s, b) = combinational_entry(s)?; @@ -26,7 +26,7 @@ pub(crate) fn combinational_body(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn combinational_entry(s: Span) -> IResult { let (s, a) = level_input_list(s)?; let (s, b) = symbol(":")(s)?; @@ -40,7 +40,7 @@ pub(crate) fn combinational_entry(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn sequential_body(s: Span) -> IResult { let (s, a) = opt(udp_initial_statement)(s)?; let (s, b) = keyword("table")(s)?; @@ -55,7 +55,7 @@ pub(crate) fn sequential_body(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn udp_initial_statement(s: Span) -> IResult { let (s, a) = keyword("initial")(s)?; let (s, b) = output_port_identifier(s)?; @@ -70,7 +70,7 @@ pub(crate) fn udp_initial_statement(s: Span) -> IResult IResult { alt(( map(keyword("1'b0"), |x| InitVal { nodes: (x,) }), @@ -86,7 +86,7 @@ pub(crate) fn init_val(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn sequential_entry(s: Span) -> IResult { let (s, a) = seq_input_list(s)?; let (s, b) = symbol(":")(s)?; @@ -102,7 +102,7 @@ pub(crate) fn sequential_entry(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn seq_input_list(s: Span) -> IResult { alt(( map(level_input_list, |x| { @@ -114,14 +114,14 @@ pub(crate) fn seq_input_list(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn level_input_list(s: Span) -> IResult { let (s, a) = level_symbol(s)?; let (s, b) = many0(level_symbol)(s)?; Ok((s, LevelInputList { nodes: (a, b) })) } -#[parser] +#[tracable_parser] pub(crate) fn edge_input_list(s: Span) -> IResult { let (s, a) = many0(level_symbol)(s)?; let (s, b) = edge_indicator(s)?; @@ -129,7 +129,7 @@ pub(crate) fn edge_input_list(s: Span) -> IResult { Ok((s, EdgeInputList { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn edge_indicator(s: Span) -> IResult { alt(( edge_indicator_paren, @@ -137,7 +137,7 @@ pub(crate) fn edge_indicator(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn edge_indicator_paren(s: Span) -> IResult { let (s, a) = paren(pair(level_symbol, level_symbol))(s)?; Ok(( @@ -146,13 +146,13 @@ pub(crate) fn edge_indicator_paren(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn current_state(s: Span) -> IResult { let (s, a) = level_symbol(s)?; Ok((s, CurrentState { nodes: (a,) })) } -#[parser] +#[tracable_parser] pub(crate) fn next_state(s: Span) -> IResult { alt(( map(output_symbol, |x| NextState::OutputSymbol(Box::new(x))), @@ -160,7 +160,7 @@ pub(crate) fn next_state(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn output_symbol(s: Span) -> IResult { alt(( map(keyword("0"), |x| OutputSymbol { nodes: (x,) }), @@ -170,7 +170,7 @@ pub(crate) fn output_symbol(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn level_symbol(s: Span) -> IResult { alt(( map(keyword("0"), |x| LevelSymbol { nodes: (x,) }), @@ -183,7 +183,7 @@ pub(crate) fn level_symbol(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn edge_symbol(s: Span) -> IResult { alt(( map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }), diff --git a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_declaration.rs b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_declaration.rs index 61c2970..e022fb9 100644 --- a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_declaration.rs +++ b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_declaration.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("primitive")(s)?; @@ -17,7 +17,7 @@ pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("primitive")(s)?; @@ -32,7 +32,7 @@ pub(crate) fn udp_ansi_declaration(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn udp_declaration(s: Span) -> IResult { alt(( udp_declaration_nonansi, @@ -43,7 +43,7 @@ pub(crate) fn udp_declaration(s: Span) -> IResult { ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult { let (s, a) = udp_nonansi_declaration(s)?; let (s, b) = udp_port_declaration(s)?; @@ -59,7 +59,7 @@ pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult )) } -#[parser] +#[tracable_parser] pub(crate) fn udp_declaration_ansi(s: Span) -> IResult { let (s, a) = udp_ansi_declaration(s)?; let (s, b) = udp_body(s)?; @@ -73,7 +73,7 @@ pub(crate) fn udp_declaration_ansi(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = udp_nonansi_declaration(s)?; @@ -83,7 +83,7 @@ pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult IResult { let (s, a) = keyword("extern")(s)?; let (s, b) = udp_ansi_declaration(s)?; @@ -93,7 +93,7 @@ pub(crate) fn udp_declaration_extern_ansi(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("primitive")(s)?; diff --git a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_instantiation.rs b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_instantiation.rs index 41263af..86e1275 100644 --- a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_instantiation.rs +++ b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_instantiation.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn udp_instantiation(s: Span) -> IResult { let (s, a) = udp_identifier(s)?; let (s, b) = opt(drive_strength)(s)?; @@ -17,7 +17,7 @@ pub(crate) fn udp_instantiation(s: Span) -> IResult { )) } -#[parser] +#[tracable_parser] pub(crate) fn udp_instance(s: Span) -> IResult { let (s, a) = opt(name_of_instance)(s)?; let (s, b) = paren(tuple(( diff --git a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_ports.rs b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_ports.rs index aeaca23..23daf7d 100644 --- a/sv-parser-parser/src/udp_declaration_and_instantiation/udp_ports.rs +++ b/sv-parser-parser/src/udp_declaration_and_instantiation/udp_ports.rs @@ -2,7 +2,7 @@ use crate::*; // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn udp_port_list(s: Span) -> IResult { let (s, a) = output_port_identifier(s)?; let (s, b) = symbol(",")(s)?; @@ -10,7 +10,7 @@ pub(crate) fn udp_port_list(s: Span) -> IResult { Ok((s, UdpPortList { nodes: (a, b, c) })) } -#[parser] +#[tracable_parser] pub(crate) fn udp_declaration_port_list(s: Span) -> IResult { let (s, a) = udp_output_declaration(s)?; let (s, b) = symbol(",")(s)?; @@ -18,7 +18,7 @@ pub(crate) fn udp_declaration_port_list(s: Span) -> IResult IResult { alt(( map(pair(udp_output_declaration, symbol(";")), |x| { @@ -33,12 +33,12 @@ pub(crate) fn udp_port_declaration(s: Span) -> IResult ))(s) } -#[parser] +#[tracable_parser] pub(crate) fn udp_output_declaration(s: Span) -> IResult { alt((udp_output_declaration_nonreg, udp_output_declaration_reg))(s) } -#[parser] +#[tracable_parser] pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("output")(s)?; @@ -49,7 +49,7 @@ pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("output")(s)?; @@ -64,7 +64,7 @@ pub(crate) fn udp_output_declaration_reg(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("input")(s)?; @@ -72,7 +72,7 @@ pub(crate) fn udp_input_declaration(s: Span) -> IResult IResult { let (s, a) = many0(attribute_instance)(s)?; let (s, b) = keyword("reg")(s)?; diff --git a/sv-parser-parser/src/utils.rs b/sv-parser-parser/src/utils.rs index a6a32b1..9a0a9b3 100644 --- a/sv-parser-parser/src/utils.rs +++ b/sv-parser-parser/src/utils.rs @@ -266,10 +266,9 @@ where } } +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol> { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, &format!("symbol(\"{}\")", t)); let (s, x) = map(ws(map(tag(t.clone()), |x: Span| into_locate(x))), |x| { Symbol { nodes: x } })(s)?; @@ -277,10 +276,24 @@ pub(crate) fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, S } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol> { + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, &format!("symbol(\"{}\")", t)); + let body = || { + let (s, x) = map(ws(map(tag(t.clone()), |x: Span| into_locate(x))), |x| { + Symbol { nodes: x } + })(s)?; + Ok((s, x)) + }; + let ret = body(); + backward_trace(ret, &format!("symbol(\"{}\")", t), depth) + } +} + +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Keyword> { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, &format!("keyword(\"{}\")", t)); let (s, x) = map( ws(terminated( map(tag(t.clone()), |x: Span| into_locate(x)), @@ -292,13 +305,31 @@ pub(crate) fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Keyword> { + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, &format!("keyword(\"{}\")", t)); + let body = || { + let (s, x) = map( + ws(terminated( + map(tag(t.clone()), |x: Span| into_locate(x)), + peek(none_of(AZ09_)), + )), + |x| Keyword { nodes: x }, + )(s)?; + Ok((s, x)) + }; + let ret = body(); + backward_trace(ret, &format!("keyword(\"{}\")", t), depth) + } +} + +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn paren<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Paren> where F: Fn(Span<'a>) -> IResult, O>, { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, "paren"); let (s, a) = symbol("(")(s)?; let (s, b) = f(s)?; let (s, c) = symbol(")")(s)?; @@ -306,13 +337,30 @@ where } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn paren<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Paren> +where + F: Fn(Span<'a>) -> IResult, O>, +{ + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, "paren"); + let body = || { + let (s, a) = symbol("(")(s)?; + let (s, b) = f(s)?; + let (s, c) = symbol(")")(s)?; + Ok((s, Paren { nodes: (a, b, c) })) + }; + let ret = body(); + backward_trace(ret, "paren", depth) + } +} + +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn bracket<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Bracket> where F: Fn(Span<'a>) -> IResult, O>, { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, "bracket"); let (s, a) = symbol("[")(s)?; let (s, b) = f(s)?; let (s, c) = symbol("]")(s)?; @@ -320,13 +368,30 @@ where } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn bracket<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Bracket> +where + F: Fn(Span<'a>) -> IResult, O>, +{ + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, "bracket"); + let body = || { + let (s, a) = symbol("[")(s)?; + let (s, b) = f(s)?; + let (s, c) = symbol("]")(s)?; + Ok((s, Bracket { nodes: (a, b, c) })) + }; + let ret = body(); + backward_trace(ret, "bracket", depth) + } +} + +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn brace<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Brace> where F: Fn(Span<'a>) -> IResult, O>, { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, "brace"); let (s, a) = symbol("{")(s)?; let (s, b) = f(s)?; let (s, c) = symbol("}")(s)?; @@ -334,6 +399,25 @@ where } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn brace<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, Brace> +where + F: Fn(Span<'a>) -> IResult, O>, +{ + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, "brace"); + let body = || { + let (s, a) = symbol("{")(s)?; + let (s, b) = f(s)?; + let (s, c) = symbol("}")(s)?; + Ok((s, Brace { nodes: (a, b, c) })) + }; + let ret = body(); + backward_trace(ret, "brace", depth) + } +} + +#[cfg(not(any(feature = "forward_trace", feature = "backward_trace")))] pub(crate) fn apostrophe_brace<'a, O, F>( f: F, ) -> impl Fn(Span<'a>) -> IResult, ApostropheBrace> @@ -341,8 +425,6 @@ where F: Fn(Span<'a>) -> IResult, O>, { move |s: Span<'a>| { - #[cfg(feature = "trace")] - let s = trace(s, "apostrophe_brace"); let (s, a) = symbol("'{")(s)?; let (s, b) = f(s)?; let (s, c) = symbol("}")(s)?; @@ -350,6 +432,26 @@ where } } +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn apostrophe_brace<'a, O, F>( + f: F, +) -> impl Fn(Span<'a>) -> IResult, ApostropheBrace> +where + F: Fn(Span<'a>) -> IResult, O>, +{ + move |s: Span<'a>| { + let (depth, s) = forward_trace(s, "apostrophe_brace"); + let body = || { + let (s, a) = symbol("'{")(s)?; + let (s, b) = f(s)?; + let (s, c) = symbol("}")(s)?; + Ok((s, ApostropheBrace { nodes: (a, b, c) })) + }; + let ret = body(); + backward_trace(ret, "apostrophe_brace", depth) + } +} + pub(crate) fn list<'a, O1, O2, F, G>( f: F, g: G, @@ -424,7 +526,7 @@ where // ----------------------------------------------------------------------------- -#[parser] +#[tracable_parser] pub(crate) fn white_space(s: Span) -> IResult { alt(( map(multispace1, |x: Span| { @@ -467,16 +569,59 @@ pub(crate) fn into_locate(s: Span) -> Locate { } } -#[cfg(feature = "trace")] -pub(crate) fn trace<'a>(mut s: Span<'a>, name: &str) -> Span<'a> { +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn forward_trace<'a>(s: Span<'a>, name: &str) -> (usize, Span<'a>) { + let depth = s.get_depth(); + #[cfg(feature = "forward_trace")] println!( - //"{:<128} : {:<4},{:>032x} : {}", - "{:<128} : {:<4} : {}", - format!("{}{}", " ".repeat(s.extra.depth), name), - s.offset, - //s.extra.recursive_flag[0], - s.fragment + "{:<128} : {}", + format!( + "{}{}-> {}{}", + "\u{001b}[1;37m", + " ".repeat(depth), + name, + "\u{001b}[0m" + ), + s.format(), ); - s.extra.depth += 1; - s + (depth, s.inc_depth()) +} + +#[cfg(any(feature = "forward_trace", feature = "backward_trace"))] +pub(crate) fn backward_trace<'a, O>( + ret: IResult, O>, + name: &str, + depth: usize, +) -> IResult, O> { + match ret { + Ok((s, x)) => { + #[cfg(feature = "backward_trace")] + println!( + "{:<128} : {}", + format!( + "{}{}<- {}{}", + "\u{001b}[1;32m", + " ".repeat(depth), + name, + "\u{001b}[0m" + ), + s.format(), + ); + Ok((s.dec_depth(), x)) + } + Err(x) => { + #[cfg(feature = "backward_trace")] + println!( + "{:<128}", + format!( + "{}{}<- {}{}", + "\u{001b}[1;31m", + " ".repeat(depth), + name, + "\u{001b}[0m" + ), + ); + Err(x) + } + } } diff --git a/sv-parser-syntaxtree/Cargo.toml b/sv-parser-syntaxtree/Cargo.toml index e92e3b1..7781f6b 100644 --- a/sv-parser-syntaxtree/Cargo.toml +++ b/sv-parser-syntaxtree/Cargo.toml @@ -9,5 +9,5 @@ build = "build.rs" sv-parser-macros = { path = "../sv-parser-macros" } [build-dependencies] +regex = "1" walkdir = "2" -regex = "1" diff --git a/sv-parser/Cargo.toml b/sv-parser/Cargo.toml index 5bdf61a..46e282c 100644 --- a/sv-parser/Cargo.toml +++ b/sv-parser/Cargo.toml @@ -11,8 +11,9 @@ description = "" edition = "2018" [features] -default = [] -trace = ["sv-parser-parser/trace"] +default = [] +forward_trace = ["sv-parser-parser/forward_trace"] +backward_trace = ["sv-parser-parser/backward_trace"] [dependencies] sv-parser-parser = { path = "../sv-parser-parser" }