Apply tracable_parser

This commit is contained in:
dalance 2019-07-26 20:13:57 +09:00
parent 94d29828a5
commit 4b2430ceef
77 changed files with 1410 additions and 1229 deletions

View File

@ -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"] }

View File

@ -6,13 +6,15 @@ edition = "2018"
[features]
default = []
trace = []
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" }

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
alt((
map(concurrent_assertion_item, |x| {
@ -14,7 +14,7 @@ pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn deferred_immediate_assertion_item(
s: Span,
) -> IResult<Span, DeferredImmediateAssetionItem> {
@ -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<Span, ProceduralAssertionStatement> {
@ -40,7 +40,7 @@ pub(crate) fn procedural_assertion_statement(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetionStatement> {
alt((
map(simple_immediate_assertion_statement, |x| {
@ -52,7 +52,7 @@ pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateA
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn simple_immediate_assertion_statement(
s: Span,
) -> IResult<Span, SimpleImmediateAssertionStatement> {
@ -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<Span, SimpleImmediateAssertStatement> {
@ -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<Span, SimpleImmediateAssumeStatement> {
@ -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<Span, SimpleImmediateCoverStatement> {
@ -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<Span, DeferredImmediateAssertionStatement> {
@ -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<Span, DeferredImmediateAssertStatement> {
@ -132,7 +132,7 @@ pub(crate) fn deferred_immediate_assert_statement(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn deferred_immediate_assume_statement(
s: Span,
) -> IResult<Span, DeferredImmediateAssumeStatement> {
@ -148,7 +148,7 @@ pub(crate) fn deferred_immediate_assume_statement(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn deferred_immediate_cover_statement(
s: Span,
) -> IResult<Span, DeferredImmediateCoverStatement> {
@ -164,7 +164,7 @@ pub(crate) fn deferred_immediate_cover_statement(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assert_timing(s: Span) -> IResult<Span, AssertTiming> {
alt((
map(symbol("#0"), |x| AssertTiming::Zero(Box::new(x))),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
alt((
case_statement_normal,
@ -11,7 +11,7 @@ pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
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<Span, CaseStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
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<Span, CaseStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
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<Span, CaseStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
alt((
map(keyword("casez"), |x| CaseKeyword::Casez(Box::new(x))),
@ -70,13 +70,13 @@ pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn case_expression(s: Span) -> IResult<Span, CaseExpression> {
let (s, a) = expression(s)?;
Ok((s, CaseExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
alt((
case_item_nondefault,
@ -85,7 +85,7 @@ pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
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<Span, CaseItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
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<Span, CaseItemDefault> {
Ok((s, CaseItemDefault { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
alt((
case_pattern_item_nondefault,
@ -113,7 +113,7 @@ pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePatternItem> {
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<Span, CasePattern
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
alt((
case_inside_item_nondefault,
@ -136,7 +136,7 @@ pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
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<Span, CaseInsideIt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_item_expression(s: Span) -> IResult<Span, CaseItemExpression> {
let (s, a) = expression(s)?;
Ok((s, CaseItemExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
let (s, a) = keyword("randcase")(s)?;
let (s, b) = randcase_item(s)?;
@ -168,7 +168,7 @@ pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
@ -177,13 +177,13 @@ pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn open_range_list(s: Span) -> IResult<Span, OpenRangeList> {
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<Span, OpenValueRange> {
let (s, a) = value_range(s)?;
Ok((s, OpenValueRange { nodes: (a,) }))

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn clocking_declaration(s: Span) -> IResult<Span, ClockingDeclaration> {
alt((clocking_declaration_local, clocking_declaration_global))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration> {
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<Span, ClockingDecla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn default(s: Span) -> IResult<Span, Default> {
let (s, a) = keyword("default")(s)?;
Ok((s, Default { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration> {
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<Span, ClockingDecl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_event(s: Span) -> IResult<Span, ClockingEvent> {
alt((clocking_event_identifier, clocking_event_expression))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
let (s, a) = symbol("@")(s)?;
let (s, b) = identifier(s)?;
@ -63,7 +63,7 @@ pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
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<Span, ClockingEvent>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
alt((
clocking_item_default,
@ -82,7 +82,7 @@ pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
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<Span, ClockingItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
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<Span, ClockingItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
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<Span, ClockingItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
alt((
default_skew_input,
@ -123,7 +123,7 @@ pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
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<Span, DefaultSkew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
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<Span, DefaultSkew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
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<Span, DefaultSkew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
alt((
clocking_direction_input,
@ -167,7 +167,7 @@ pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
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<Span, ClockingDirecti
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
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<Span, ClockingDirect
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_direction_input_output(s: Span) -> IResult<Span, ClockingDirection> {
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<Span, Clocking
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_direction_inout(s: Span) -> IResult<Span, ClockingDirection> {
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<Span, ListOfClockingDeclAssign> {
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<Span, ClockingDeclAssign> {
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<Span, ClockingSkew> {
alt((
clocking_skew_edge,
@ -228,7 +228,7 @@ pub(crate) fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
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<Span, ClockingSkew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
let (s, a) = clockvar_expression(s)?;
let (s, b) = symbol("<=")(s)?;
@ -252,7 +252,7 @@ pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
alt((
cycle_delay_integral,
@ -261,7 +261,7 @@ pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = integral_number(s)?;
@ -271,7 +271,7 @@ pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = identifier(s)?;
@ -281,7 +281,7 @@ pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = paren(expression)(s)?;
@ -291,13 +291,13 @@ pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn clockvar(s: Span) -> IResult<Span, Clockvar> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, Clockvar { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn clockvar_expression(s: Span) -> IResult<Span, ClockvarExpression> {
let (s, a) = clockvar(s)?;
let (s, b) = select(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
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<Span, ConditionalStateme
))
}
#[parser]
#[tracable_parser]
pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
alt((
map(keyword("unique0"), |x| UniquePriority::Unique0(Box::new(x))),
@ -36,13 +36,13 @@ pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn cond_predicate(s: Span) -> IResult<Span, CondPredicate> {
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<Span, ExpressionOrCondPattern> {
alt((
map(expression, |x| {
@ -55,7 +55,7 @@ pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrC
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn cond_pattern(s: Span) -> IResult<Span, CondPattern> {
let (s, a) = expression(s)?;
let (s, b) = keyword("matches")(s)?;

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn continuous_assign(s: Span) -> IResult<Span, ContinuousAssign> {
alt((continuous_assign_net, continuous_assign_variable))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
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<Span, ContinuousAssign>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
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<Span, ContinuousAss
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn list_of_net_assignments(s: Span) -> IResult<Span, ListOfNetAssignments> {
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<Span, ListOfVariableAssignments> {
let (s, a) = list(symbol(","), variable_assignment)(s)?;
Ok((s, ListOfVariableAssignments { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
let (s, a) = keyword("alias")(s)?;
let (s, b) = net_lvalue(s)?;
@ -69,7 +69,7 @@ pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn net_assignment(s: Span) -> IResult<Span, NetAssignment> {
let (s, a) = net_lvalue(s)?;
let (s, b) = symbol("=")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
alt((
loop_statement_forever,
@ -14,7 +14,7 @@ pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
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<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
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<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
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<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("for")(s)?;
let (s, b) = paren(tuple((
@ -63,7 +63,7 @@ pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
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<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("foreach")(s)?;
let (s, b) = paren(pair(
@ -92,7 +92,7 @@ pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
alt((
map(list_of_variable_assignments, |x| {
@ -103,7 +103,7 @@ pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitialization> {
let (s, a) = list(symbol(","), for_variable_declaration)(s)?;
Ok((
@ -112,7 +112,7 @@ pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitia
))
}
#[parser]
#[tracable_parser]
pub(crate) fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration> {
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<Span, ForVariableDecl
Ok((s, ForVariableDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn var(s: Span) -> IResult<Span, Var> {
let (s, a) = keyword("var")(s)?;
Ok((s, Var { nodes: (a,) }))
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn for_step(s: Span) -> IResult<Span, ForStep> {
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<Span, ForStepAssignment> {
alt((
map(operator_assignment, |x| {
@ -151,7 +151,7 @@ pub(crate) fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_variables(s: Span) -> IResult<Span, LoopVariables> {
let (s, a) = list(symbol(","), opt(index_variable_identifier))(s)?;
Ok((s, LoopVariables { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
alt((
map(statement_or_null, |x| {
@ -12,7 +12,7 @@ pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
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<Span, ActionBlock> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
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<Span, SeqBlock> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn par_block(s: Span) -> IResult<Span, ParBlock> {
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<Span, ParBlock> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn join_keyword(s: Span) -> IResult<Span, JoinKeyword> {
alt((
map(keyword("join_any"), |x| JoinKeyword::JoinAny(Box::new(x))),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
alt((
pattern_variable,
@ -16,7 +16,7 @@ pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
let (s, a) = symbol(".")(s)?;
let (s, b) = variable_identifier(s)?;
@ -26,7 +26,7 @@ pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
let (s, a) = keyword("tagged")(s)?;
let (s, b) = member_identifier(s)?;
@ -37,13 +37,13 @@ pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pattern_list(s: Span) -> IResult<Span, Pattern> {
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<Span, Pattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
@ -55,7 +55,7 @@ pub(crate) fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
alt((
assignment_pattern_list,
@ -65,7 +65,7 @@ pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(symbol(","), expression))(s)?;
Ok((
@ -74,7 +74,7 @@ pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPatter
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
@ -86,7 +86,7 @@ pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
@ -98,7 +98,7 @@ pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPatte
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(pair(
constant_expression,
@ -110,7 +110,7 @@ pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPatt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
alt((
map(member_identifier, |x| {
@ -122,7 +122,7 @@ pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKe
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
alt((
map(constant_expression, |x| {
@ -134,7 +134,7 @@ pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
alt((
map(simple_type, |x| {
@ -147,14 +147,14 @@ pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPattern
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn assignment_pattern_expression(s: Span) -> IResult<Span, AssignmentPatternExpression> {
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<Span, AssignmentPatternExpressionType> {
@ -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<Span, ConstantAssignmentPatternExpression> {
@ -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<Span, AssignmentPatternNetLvalue> {
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<Span, AssignmentPatternVariableLvalue> {

View File

@ -2,21 +2,21 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn initial_construct(s: Span) -> IResult<Span, InitialConstruct> {
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<Span, AlwaysConstruct> {
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<Span, AlwaysKeyword> {
alt((
map(keyword("always_comb"), |x| {
@ -32,14 +32,14 @@ pub(crate) fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn final_construct(s: Span) -> IResult<Span, FinalConstruct> {
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<Span, BlockingAssignment> {
alt((
blocking_assignment_variable,
@ -52,7 +52,7 @@ pub(crate) fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("=")(s)?;
@ -67,7 +67,7 @@ pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAss
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingAssignment> {
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<Span, Bl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn blocking_assignment_hierarchical_variable(
s: Span,
) -> IResult<Span, BlockingAssignment> {
@ -100,7 +100,7 @@ pub(crate) fn blocking_assignment_hierarchical_variable(
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = assignment_operator(s)?;
@ -108,7 +108,7 @@ pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment>
Ok((s, OperatorAssignment { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
alt((
map(symbol("="), |x| AssignmentOperator { nodes: (x,) }),
@ -128,7 +128,7 @@ pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("<=")(s)?;
@ -142,7 +142,7 @@ pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssign
))
}
#[parser]
#[tracable_parser]
pub(crate) fn procedural_continuous_assignment(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
@ -156,7 +156,7 @@ pub(crate) fn procedural_continuous_assignment(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn procedural_continuous_assignment_assign(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
@ -170,7 +170,7 @@ pub(crate) fn procedural_continuous_assignment_assign(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn procedural_continuous_assignment_deassign(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
@ -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<Span, ProceduralContinuousAssignment> {
@ -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<Span, ProceduralContinuousAssignment> {
@ -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<Span, ProceduralContinuousAssignment> {
@ -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<Span, ProceduralContinuousAssignment> {
@ -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<Span, VariableAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("=")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
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<Span, RandsequenceState
))
}
#[parser]
#[tracable_parser]
pub(crate) fn production(s: Span) -> IResult<Span, Production> {
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<Span, Production> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
let (s, a) = rs_production_list(s)?;
let (s, b) = opt(triple(
@ -44,12 +44,12 @@ pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
Ok((s, RsRule { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_production_list(s: Span) -> IResult<Span, RsProductionList> {
alt((rs_production_list_prod, rs_production_list_join))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList> {
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<Span, RsProductionList
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
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<Span, RsProductionList
))
}
#[parser]
#[tracable_parser]
pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
alt((
map(integral_number, |x| {
@ -88,7 +88,7 @@ pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecification> {
let (s, a) = paren(expression)(s)?;
Ok((
@ -97,13 +97,13 @@ pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_code_block(s: Span) -> IResult<Span, RsCodeBlock> {
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<Span, RsProd> {
alt((
map(production_item, |x| RsProd::ProductionItem(Box::new(x))),
@ -114,14 +114,14 @@ pub(crate) fn rs_prod(s: Span) -> IResult<Span, RsProd> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn production_item(s: Span) -> IResult<Span, ProductionItem> {
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<Span, RsIfElse> {
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<Span, RsIfElse> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
let (s, a) = keyword("repeat")(s)?;
let (s, b) = paren(expression)(s)?;
@ -143,7 +143,7 @@ pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
Ok((s, RsRepeat { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_case(s: Span) -> IResult<Span, RsCase> {
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<Span, RsCase> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_case_item(s: Span) -> IResult<Span, RsCaseItem> {
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<Span, RsCaseItem> {
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<Span, RsCaseItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rs_case_item_default(s: Span) -> IResult<Span, RsCaseItem> {
let (s, a) = keyword("default")(s)?;
let (s, b) = opt(symbol(":"))(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
alt((
map(statement, |x| StatementOrNull::Statement(Box::new(x))),
@ -10,7 +10,7 @@ pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
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<Span, StatementOrN
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn statement(s: Span) -> IResult<Span, Statement> {
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<Span, Statement> {
Ok((s, Statement { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
alt((
map(pair(blocking_assignment, symbol(";")), |x| {
@ -89,13 +89,13 @@ pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn function_statement(s: Span) -> IResult<Span, FunctionStatement> {
let (s, a) = statement(s)?;
Ok((s, FunctionStatement { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrNull> {
alt((
map(function_statement, |x| {
@ -105,7 +105,7 @@ pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionState
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn function_statement_or_null_attribute(
s: Span,
) -> IResult<Span, FunctionStatementOrNull> {
@ -119,7 +119,7 @@ pub(crate) fn function_statement_or_null_attribute(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_identifier_list(s: Span) -> IResult<Span, VariableIdentifierList> {
let (s, a) = list(symbol(","), variable_identifier)(s)?;
Ok((s, VariableIdentifierList { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStatement> {
alt((
map(pair(subroutine_call, symbol(";")), |x| {
@ -12,7 +12,7 @@ pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCall
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn subroutine_call_statement_function(
s: Span,
) -> IResult<Span, SubroutineCallStatement> {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn procedural_timing_control_statement(
s: Span,
) -> IResult<Span, ProceduralTimingControlStatement> {
@ -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<Span, DelayOrEventControl> {
alt((
map(delay_control, |x| DelayOrEventControl::Delay(Box::new(x))),
@ -20,7 +20,7 @@ pub(crate) fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventContr
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEventControl> {
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<Span, DelayOrEve
))
}
#[parser]
#[tracable_parser]
pub(crate) fn delay_control(s: Span) -> IResult<Span, DelayControl> {
alt((delay_control_delay, delay_control_mintypmax))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
let (s, a) = symbol("#")(s)?;
let (s, b) = delay_value(s)?;
@ -46,7 +46,7 @@ pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
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<Span, DelayControl> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
alt((
event_control_event_identifier,
@ -67,7 +67,7 @@ pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
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<Span, EventCont
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
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<Span, EventCont
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
let (s, a) = symbol("@*")(s)?;
Ok((
@ -96,7 +96,7 @@ pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
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<Span, EventContro
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventControl> {
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<Span, EventC
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
alt((
event_expression_expression,
@ -130,7 +130,7 @@ pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
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<Span, EventExpress
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_expression_sequence(s: Span) -> IResult<Span, EventExpression> {
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<Span, EventExpressio
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
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<Span, EventExpression> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = event_expression(s)?;
let (s, b) = symbol(",")(s)?;
@ -175,7 +175,7 @@ pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = paren(event_expression)(s)?;
Ok((
@ -184,7 +184,7 @@ pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingControl> {
alt((
map(delay_control, |x| {
@ -199,7 +199,7 @@ pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimi
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
alt((
jump_statement_return,
@ -208,7 +208,7 @@ pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
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<Span, JumpStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
let (s, a) = keyword("break")(s)?;
let (s, b) = symbol(";")(s)?;
@ -229,7 +229,7 @@ pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
let (s, a) = keyword("continue")(s)?;
let (s, b) = symbol(";")(s)?;
@ -239,7 +239,7 @@ pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
alt((
wait_statement_wait,
@ -248,7 +248,7 @@ pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
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<Span, WaitStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
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<Span, WaitStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
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<Span, WaitStatement> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_trigger(s: Span) -> IResult<Span, EventTrigger> {
alt((event_trigger_named, event_trigger_nonblocking))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
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<Span, EventTrigger> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger> {
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<Span, EventTrigger>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
alt((
disable_statement_task,
@ -320,7 +320,7 @@ pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
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<Span, DisableStatement>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
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<Span, DisableStatement
))
}
#[parser]
#[tracable_parser]
pub(crate) fn disable_statement_fork(s: Span) -> IResult<Span, DisableStatement> {
let (s, a) = keyword("disable")(s)?;
let (s, b) = keyword("fork")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
alt((
concurrent_assertion_item_statement,
@ -12,7 +12,7 @@ pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAsse
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn concurrent_assertion_item_statement(
s: Span,
) -> IResult<Span, ConcurrentAssertionItem> {
@ -26,7 +26,7 @@ pub(crate) fn concurrent_assertion_item_statement(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn concurrent_assertion_statement(
s: Span,
) -> IResult<Span, ConcurrentAssertionStatement> {
@ -49,7 +49,7 @@ pub(crate) fn concurrent_assertion_statement(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStatement> {
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<Span, AssertProperty
))
}
#[parser]
#[tracable_parser]
pub(crate) fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStatement> {
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<Span, AssumeProperty
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement> {
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<Span, CoverPropertySt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStatement> {
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<Span, ExpectProperty
Ok((s, ExpectPropertyStatement { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement> {
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<Span, CoverSequenceSt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertyStatement> {
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<Span, RestrictProp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_instance(s: Span) -> IResult<Span, PropertyInstance> {
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<Span, PropertyListOfArguments> {
alt((
property_list_of_arguments_ordered,
@ -151,7 +151,7 @@ pub(crate) fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListO
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_list_of_arguments_ordered(
s: Span,
) -> IResult<Span, PropertyListOfArguments> {
@ -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<Span, PropertyListOfArguments> {
let (s, a) = list(
symbol(","),
@ -182,7 +182,7 @@ pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult<Span, Propert
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
alt((
map(property_expr, |x| {
@ -194,7 +194,7 @@ pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclaration> {
alt((
map(property_declaration, |x| {
@ -209,7 +209,7 @@ pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItem
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
let (s, a) = keyword("property")(s)?;
let (s, b) = property_identifier(s)?;
@ -228,13 +228,14 @@ pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_port_list(s: Span) -> IResult<Span, PropertyPortList> {
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<Span, PropertyPortItem> {
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<Span, PropertyPortItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_lvar_port_direction(s: Span) -> IResult<Span, PropertyLvarPortDirection> {
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<Span, PropertyFormalType> {
alt((
map(sequence_formal_type, |x| {
@ -269,7 +270,7 @@ pub(crate) fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
let (s, a) = opt(clocking_event)(s)?;
let (s, b) = opt(triple(
@ -281,7 +282,7 @@ pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
Ok((s, PropertySpec { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
alt((
alt((
@ -324,7 +325,7 @@ pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = paren(sequence_expr)(s)?;
Ok((
@ -353,7 +354,7 @@ pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, Pro
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
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<Span,
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, Pro
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
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<Span,
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
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<Span, PropertyExp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_case_item(s: Span) -> IResult<Span, PropertyCaseItem> {
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<Span, PropertyCaseItem> {
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<Span, PropertyCa
))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
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<Span, PropertyCaseI
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
let (s, a) = keyword("sequence")(s)?;
let (s, b) = sequence_identifier(s)?;
@ -717,13 +718,14 @@ pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_port_list(s: Span) -> IResult<Span, SequencePortList> {
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<Span, SequencePortItem> {
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<Span, SequencePortItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDirection> {
alt((
map(keyword("input"), |x| {
@ -754,7 +756,7 @@ pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLva
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
alt((
map(data_type_or_implicit, |x| {
@ -769,7 +771,7 @@ pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
alt((
sequence_expr_cycle_delay_expr,
@ -787,7 +789,7 @@ pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceE
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, Sequ
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = paren(pair(
sequence_expr,
@ -848,7 +850,7 @@ pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExpr> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
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<Span, SequenceExp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
alt((
cycle_delay_range_primary,
@ -940,7 +942,7 @@ pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
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<Span, CycleDelayRang
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayRange> {
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<Span, CycleDelayR
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
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<Span, CycleDelayRan
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
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<Span, CycleDelayRange>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
let (s, a) = sequence_instance(s)?;
let (s, b) = symbol(".")(s)?;
@ -988,7 +990,7 @@ pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall>
Ok((s, SequenceMethodCall { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
alt((
map(operator_assignment, |x| {
@ -1003,14 +1005,14 @@ pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_instance(s: Span) -> IResult<Span, SequenceInstance> {
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<Span, SequenceListOfArguments> {
alt((
sequence_list_of_arguments_ordered,
@ -1019,7 +1021,7 @@ pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListO
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn sequence_list_of_arguments_ordered(
s: Span,
) -> IResult<Span, SequenceListOfArguments> {
@ -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<Span, SequenceListOfArguments> {
let (s, a) = list(
symbol(","),
@ -1050,7 +1052,7 @@ pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, Sequenc
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
alt((
map(event_expression, |x| {
@ -1062,7 +1064,7 @@ pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
alt((
map(consecutive_repetition, |x| {
@ -1077,13 +1079,13 @@ pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequence_abbrev(s: Span) -> IResult<Span, SequenceAbbrev> {
let (s, a) = consecutive_repetition(s)?;
Ok((s, SequenceAbbrev { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
alt((
consecutive_repetition_expression,
@ -1092,7 +1094,7 @@ pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepeti
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRepetition> {
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<Span, Consec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepetition> {
let (s, a) = bracket(symbol("*"))(s)?;
Ok((
@ -1112,7 +1114,7 @@ pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, Consecut
))
}
#[parser]
#[tracable_parser]
pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetition> {
let (s, a) = bracket(symbol("+"))(s)?;
Ok((
@ -1121,19 +1123,19 @@ pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveR
))
}
#[parser]
#[tracable_parser]
pub(crate) fn non_consecutive_repetition(s: Span) -> IResult<Span, NonConsecutiveRepetition> {
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<Span, GotoRepetition> {
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<Span, ConstOrRangeExpression> {
alt((
map(constant_expression, |x| {
@ -1145,7 +1147,7 @@ pub(crate) fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeEx
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn cycle_delay_const_range_expression(
s: Span,
) -> IResult<Span, CycleDelayConstRangeExpression> {
@ -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<Span, CycleDelayConstRangeExpression> {
@ -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<Span, CycleDelayConstRangeExpression> {
@ -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<Span, ExpressionOrDist> {
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<Span, AssertionVariableDeclaration> {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
alt((
block_item_declaration_data,
@ -13,7 +13,7 @@ pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclarat
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDeclaration> {
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<Span, BlockItemDec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_item_declaration_local_parameter(
s: Span,
) -> IResult<Span, BlockItemDeclaration> {
@ -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<Span, BlockItemDeclaration> {
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<Span, BlockIt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_item_declaration_let(s: Span) -> IResult<Span, BlockItemDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = let_declaration(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
let (s, a) = keyword("covergroup")(s)?;
let (s, b) = covergroup_identifier(s)?;
@ -20,12 +20,12 @@ pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclara
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_spec_or_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
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<Span, CoverageSpecOrOption> {
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<Span, CoverageSpe
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
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<Span, CoverageS
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_option(s: Span) -> IResult<Span, CoverageOption> {
alt((coverage_option_option, coverage_option_type_option))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
let (s, a) = keyword("option")(s)?;
let (s, b) = symbol(".")(s)?;
@ -66,7 +66,7 @@ pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
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<Span, CoverageOpti
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
alt((
map(cover_point, |x| CoverageSpec::CoverPoint(Box::new(x))),
@ -89,7 +89,7 @@ pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
alt((
map(clocking_event, |x| {
@ -100,7 +100,7 @@ pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
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<Span, CoverageEvent> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
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<Span, CoverageEvent> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
alt((
block_event_expression_or,
@ -134,7 +134,7 @@ pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpress
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpression> {
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<Span, BlockEventExpr
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventExpression> {
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<Span, BlockEventE
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExpression> {
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<Span, BlockEventExp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
alt((
map(hierarchical_tf_identifier, |x| {
@ -178,7 +178,7 @@ pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, Hierarchical
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_btf_identifier_method(
s: Span,
) -> IResult<Span, HierarchicalBtfIdentifier> {
@ -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<Span, HierarchicalIdentifierOrClassScope> {
@ -207,6 +207,7 @@ pub(crate) fn hierarchical_identifier_or_class_scope(
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
let (s, a) = opt(triple(
ambiguous_opt(data_type_or_implicit),
@ -225,7 +226,7 @@ pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
alt((
bins_or_empty_non_empty,
@ -233,7 +234,7 @@ pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
let (s, a) = brace(pair(
many0(attribute_instance),
@ -245,7 +246,7 @@ pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
alt((
map(coverage_option, |x| {
@ -260,7 +261,7 @@ pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
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<Span, BinsOrOptions
))
}
#[parser]
#[tracable_parser]
pub(crate) fn wildcard(s: Span) -> IResult<Span, Wildcard> {
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<Span, BinsOrOptions> {
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<Span, BinsOrOption
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
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<Span, BinsOrOpt
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions> {
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<Span, BinsOrOptions
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
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<Span, BinsOrOptions> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrOptions> {
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<Span, BinsOrO
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
alt((
map(keyword("bins"), |x| BinsKeyword::Bins(Box::new(x))),
@ -382,20 +383,20 @@ pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn trans_list(s: Span) -> IResult<Span, TransList> {
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<Span, TransSet> {
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<Span, TransRangeList> {
alt((
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
@ -406,7 +407,7 @@ pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList> {
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<Span, TransRangeList
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
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<Span, TransRangeList> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
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<Span, TransRangeList> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn trans_item(s: Span) -> IResult<Span, TransItem> {
let (s, a) = covergroup_range_list(s)?;
Ok((s, TransItem { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
alt((
map(covergroup_expression, |x| {
@ -455,7 +456,7 @@ pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
let (s, a) = covergroup_expression(s)?;
let (s, b) = symbol(":")(s)?;
@ -466,7 +467,7 @@ pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
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<Span, CoverCross> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
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<Span, CrossItem> {
alt((
map(cover_point_identifier, |x| {
@ -500,7 +501,7 @@ pub(crate) fn cross_item(s: Span) -> IResult<Span, CrossItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
alt((
cross_body_non_empty,
@ -508,7 +509,7 @@ pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
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<Span, CrossBody> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
alt((
map(function_declaration, |x| {
@ -529,7 +530,7 @@ pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption> {
alt((
bins_selection_or_option_coverage,
@ -537,7 +538,7 @@ pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOr
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSelectionOrOption> {
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<Span, BinsSe
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelectionOrOption> {
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<Span, BinsSelect
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
let (s, a) = bins_keyword(s)?;
let (s, b) = bin_identifier(s)?;
@ -572,7 +573,7 @@ pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
alt((
map(select_condition, |x| {
@ -590,7 +591,7 @@ pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = symbol("!")(s)?;
let (s, b) = select_condition(s)?;
@ -601,7 +602,7 @@ pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = select_expression(s)?;
let (s, b) = symbol("&&")(s)?;
@ -613,7 +614,7 @@ pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = select_expression(s)?;
let (s, b) = symbol("||")(s)?;
@ -624,7 +625,7 @@ pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = paren(select_expression)(s)?;
Ok((
@ -634,7 +635,7 @@ pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
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<Span, SelectExpression>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpression> {
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<Span, SelectExpres
))
}
#[parser]
#[tracable_parser]
pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
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<Span, SelectCondition> {
Ok((s, SelectCondition { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
alt((
map(variable_identifier, |x| {
@ -677,7 +678,7 @@ pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpression> {
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<Span, BinsExpressi
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn covergroup_range_list(s: Span) -> IResult<Span, CovergroupRangeList> {
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<Span, CovergroupValueRange> {
alt((
map(covergroup_expression, |x| {
@ -704,7 +705,7 @@ pub(crate) fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRa
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRange> {
let (s, a) = bracket(triple(
covergroup_expression,
@ -717,31 +718,31 @@ pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, Covergroup
))
}
#[parser]
#[tracable_parser]
pub(crate) fn with_covergroup_expression(s: Span) -> IResult<Span, WithCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, WithCovergroupExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn set_covergroup_expression(s: Span) -> IResult<Span, SetCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, SetCovergroupExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn integer_covergroup_expression(s: Span) -> IResult<Span, IntegerCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, IntegerCovergroupExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn cross_set_expression(s: Span) -> IResult<Span, CrossSetExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, CrossSetExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn covergroup_expression(s: Span) -> IResult<Span, CovergroupExpression> {
let (s, a) = expression(s)?;
Ok((s, CovergroupExpression { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
let (s, a) = hierarchical_parameter_identifier(s)?;
let (s, b) = symbol("=")(s)?;
@ -10,7 +10,7 @@ pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment>
Ok((s, DefparamAssignment { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
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<Span, NetDeclAssignment> {
Ok((s, NetDeclAssignment { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
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<Span, ParamAssignment> {
Ok((s, ParamAssignment { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
alt((
specparam_assignment_mintypmax,
@ -36,7 +36,7 @@ pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignment> {
let (s, a) = specparam_identifier(s)?;
let (s, b) = symbol("=")(s)?;
@ -47,14 +47,14 @@ pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, Specparam
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_assignment(s: Span) -> IResult<Span, TypeAssignment> {
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<Span, PulseControlSpecparam> {
alt((
pulse_control_specparam_without_descriptor,
@ -62,7 +62,7 @@ pub(crate) fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpec
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn pulse_control_specparam_without_descriptor(
s: Span,
) -> IResult<Span, PulseControlSpecparam> {
@ -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<Span, PulseControlSpecparam> {
@ -101,25 +101,25 @@ pub(crate) fn pulse_control_specparam_with_descriptor(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn error_limit_value(s: Span) -> IResult<Span, ErrorLimitValue> {
let (s, a) = limit_value(s)?;
Ok((s, ErrorLimitValue { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn reject_limit_value(s: Span) -> IResult<Span, RejectLimitValue> {
let (s, a) = limit_value(s)?;
Ok((s, RejectLimitValue { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn limit_value(s: Span) -> IResult<Span, LimitValue> {
let (s, a) = constant_mintypmax_expression(s)?;
Ok((s, LimitValue { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment> {
alt((
variable_decl_assignment_variable,
@ -128,7 +128,7 @@ pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAss
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_decl_assignment_variable(s: Span) -> IResult<Span, VariableDeclAssignment> {
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<Span, Variab
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_decl_assignment_dynamic_array(
s: Span,
) -> IResult<Span, VariableDeclAssignment> {
@ -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<Span, VariableDeclAssignment> {
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<Span, VariableD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_new(s: Span) -> IResult<Span, ClassNew> {
alt((class_new_argument, class_new_expression))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
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<Span, ClassNew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
let (s, a) = keyword("new")(s)?;
let (s, b) = expression(s)?;
@ -193,7 +193,7 @@ pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dynamic_array_new(s: Span) -> IResult<Span, DynamicArrayNew> {
let (s, a) = keyword("new")(s)?;
let (s, b) = bracket(expression)(s)?;

View File

@ -2,19 +2,19 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn list_of_defparam_assignments(s: Span) -> IResult<Span, ListOfDefparamAssignments> {
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<Span, ListOfGenvarIdentifiers> {
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<Span, ListOfInterfaceIdentifiers> {
let (s, a) = list(
symbol(","),
@ -23,19 +23,19 @@ pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInte
Ok((s, ListOfInterfaceIdentifiers { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_net_decl_assignments(s: Span) -> IResult<Span, ListOfNetDeclAssignments> {
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<Span, ListOfParamAssignments> {
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<Span, ListOfPortIdentifiers> {
let (s, a) = list(
symbol(","),
@ -44,19 +44,19 @@ pub(crate) fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdent
Ok((s, ListOfPortIdentifiers { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_udp_port_identifiers(s: Span) -> IResult<Span, ListOfUdpPortIdentifiers> {
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<Span, ListOfSpecparamAssignments> {
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<Span, ListOfTfVariableIdentifiers> {
@ -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<Span, ListOfTypeAssignments> {
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<Span, ListOfVariableDeclAssignments> {
@ -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<Span, ListOfVariableIdentifiers> {
let (s, a) = list(
symbol(","),
@ -94,7 +94,7 @@ pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVaria
Ok((s, ListOfVariableIdentifiers { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_variable_port_identifiers(
s: Span,
) -> IResult<Span, ListOfVariablePortIdentifiers> {

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn unpacked_dimension(s: Span) -> IResult<Span, UnpackedDimension> {
alt((unpacked_dimension_range, unpacked_dimension_expression))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
let (s, a) = bracket(constant_range)(s)?;
Ok((
@ -16,7 +16,7 @@ pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimensi
))
}
#[parser]
#[tracable_parser]
pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension> {
let (s, a) = bracket(constant_expression)(s)?;
Ok((
@ -25,7 +25,7 @@ pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDi
))
}
#[parser]
#[tracable_parser]
pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
alt((
packed_dimension_range,
@ -35,7 +35,7 @@ pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
let (s, a) = bracket(constant_range)(s)?;
Ok((
@ -44,7 +44,7 @@ pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
alt((
associative_dimension_data_type,
@ -52,7 +52,7 @@ pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimensi
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDimension> {
let (s, a) = bracket(data_type)(s)?;
Ok((
@ -61,7 +61,7 @@ pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, Associat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimension> {
let (s, a) = bracket(symbol("*"))(s)?;
Ok((
@ -70,7 +70,7 @@ pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, Associati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
alt((
map(unsized_dimension, |x| {
@ -88,7 +88,7 @@ pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
let (s, a) = bracket(pair(
symbol("$"),
@ -97,7 +97,7 @@ pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
Ok((s, QueueDimension { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn unsized_dimension(s: Span) -> IResult<Span, UnsizedDimension> {
let (s, a) = symbol("[")(s)?;
let (s, b) = symbol("]")(s)?;

View File

@ -2,19 +2,19 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn delay3(s: Span) -> IResult<Span, Delay3> {
alt((delay3_single, delay3_mintypmax))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delay3_single(s: Span) -> IResult<Span, Delay3> {
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<Span, Delay3> {
let (s, a) = symbol("#")(s)?;
let (s, b) = paren(pair(
@ -31,19 +31,19 @@ pub(crate) fn delay3_mintypmax(s: Span) -> IResult<Span, Delay3> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn delay2(s: Span) -> IResult<Span, Delay2> {
alt((delay2_single, delay2_mintypmax))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delay2_single(s: Span) -> IResult<Span, Delay2> {
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<Span, Delay2> {
let (s, a) = symbol("#")(s)?;
let (s, b) = paren(pair(
@ -56,7 +56,7 @@ pub(crate) fn delay2_mintypmax(s: Span) -> IResult<Span, Delay2> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn delay_value(s: Span) -> IResult<Span, DelayValue> {
alt((
map(unsigned_number, |x| DelayValue::UnsignedNumber(Box::new(x))),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataTypeOrImplicit> {
alt((
map(data_type_or_void, |x| {
@ -14,7 +14,7 @@ pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionD
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
let (s, a) = keyword("function")(s)?;
let (s, b) = opt(lifetime)(s)?;
@ -22,7 +22,7 @@ pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration
Ok((s, FunctionDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
alt((
function_body_declaration_without_port,
@ -31,6 +31,7 @@ pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDe
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn function_body_declaration_without_port(
s: Span,
) -> IResult<Span, FunctionBodyDeclaration> {
@ -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<Span, FunctionBodyDeclaration> {
@ -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<Span, InterfaceIdentifierOrClassScope> {
@ -85,7 +87,7 @@ pub(crate) fn interface_identifier_or_class_scope(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
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<Span, FunctionPrototype> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
alt((
dpi_import_export_import_function,
@ -109,7 +111,7 @@ pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImportExport> {
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<Span, DpiImp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportExport> {
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<Span, DpiImportE
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImportExport> {
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<Span, DpiImp
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportExport> {
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<Span, DpiImportE
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
alt((
map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))),
@ -181,7 +183,7 @@ pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportProperty> {
alt((
map(keyword("context"), |x| {
@ -193,19 +195,19 @@ pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunction
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_task_import_property(s: Span) -> IResult<Span, DpiTaskImportProperty> {
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<Span, DpiFunctionProto> {
let (s, a) = function_prototype(s)?;
Ok((s, DpiFunctionProto { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn dpi_task_proto(s: Span) -> IResult<Span, DpiTaskProto> {
let (s, a) = task_prototype(s)?;
Ok((s, DpiTaskProto { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
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<Span, ModportDeclaration>
Ok((s, ModportDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_item(s: Span) -> IResult<Span, ModportItem> {
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<Span, ModportPortsDeclaraton> {
alt((
modport_ports_declaration_simple,
@ -26,7 +26,7 @@ pub(crate) fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDe
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_ports_declaration_simple(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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<Span, Modport
))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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<Span, ModportPort
))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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<Span, Modpo
))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_clocking_declaration(s: Span) -> IResult<Span, ModportClockingDeclaration> {
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<Span, ModportSimplePortsDeclaration> {
@ -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<Span, ModportSimplePort> {
alt((modport_simple_port_ordered, modport_simple_port_named))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort> {
let (s, a) = port_identifier(s)?;
Ok((
@ -88,7 +88,7 @@ pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimpl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
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<Span, ModportSimpleP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_tf_ports_declaration(s: Span) -> IResult<Span, ModportTfPortsDeclaration> {
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<Span, ModportTfPort> {
alt((
map(method_prototype, |x| {
@ -116,7 +116,7 @@ pub(crate) fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn import_export(s: Span) -> IResult<Span, ImportExport> {
alt((
map(keyword("import"), |x| ImportExport::Import(Box::new(x))),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
let (s, a) = keyword("let")(s)?;
let (s, b) = let_identifier(s)?;
@ -18,19 +18,20 @@ pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_identifier(s: Span) -> IResult<Span, LetIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, LetIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_port_list(s: Span) -> IResult<Span, LetPortList> {
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<Span, LetPortItem> {
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<Span, LetPortItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
alt((
map(data_type_or_implicit, |x| {
@ -55,7 +56,7 @@ pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn let_expression(s: Span) -> IResult<Span, LetExpression> {
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<Span, LetExpression> {
Ok((s, LetExpression { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_list_of_arguments(s: Span) -> IResult<Span, LetListOfArguments> {
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<Span, LetListOfArguments> {
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<Span, LetListOfA
))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments> {
let (s, a) = list(
symbol(","),
@ -96,7 +97,7 @@ pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArg
))
}
#[parser]
#[tracable_parser]
pub(crate) fn let_actual_arg(s: Span) -> IResult<Span, LetActualArg> {
let (s, a) = expression(s)?;
Ok((s, LetActualArg { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDeclaration> {
alt((
local_parameter_declaration_param,
@ -11,6 +11,7 @@ pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParamet
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn local_parameter_declaration_param(
s: Span,
) -> IResult<Span, LocalParameterDeclaration> {
@ -25,7 +26,7 @@ pub(crate) fn local_parameter_declaration_param(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn local_parameter_declaration_type(
s: Span,
) -> IResult<Span, LocalParameterDeclaration> {
@ -40,12 +41,13 @@ pub(crate) fn local_parameter_declaration_type(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclaration> {
alt((parameter_declaration_param, parameter_declaration_type))(s)
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDeclaration> {
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<Span, ParameterDec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration> {
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<Span, ParameterDecl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn specparam_declaration(s: Span) -> IResult<Span, SpecparamDeclaration> {
let (s, a) = keyword("specparam")(s)?;
let (s, b) = opt(packed_dimension)(s)?;

View File

@ -3,7 +3,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
alt((
map(simple_type, |x| CastingType::SimpleType(Box::new(x))),
@ -16,7 +16,7 @@ pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
alt((
data_type_vector,
@ -37,7 +37,7 @@ pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_vector(s: Span) -> IResult<Span, DataType> {
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<Span, DataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_atom(s: Span) -> IResult<Span, DataType> {
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<Span, DataType> {
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<Span, DataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn packed(s: Span) -> IResult<Span, Packed> {
let (s, a) = keyword("packed")(s)?;
Ok((s, Packed { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_enum(s: Span) -> IResult<Span, DataType> {
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<Span, DataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
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<Span, DataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface(s: Span) -> IResult<Span, Interface> {
let (s, a) = keyword("interface")(s)?;
Ok((s, Interface { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_type(s: Span) -> IResult<Span, DataType> {
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<Span, DataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
alt((
map(data_type, |x| DataTypeOrImplicit::DataType(Box::new(x))),
@ -131,14 +131,14 @@ pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn implicit_data_type(s: Span) -> IResult<Span, ImplicitDataType> {
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<Span, EnumBaseType> {
alt((
enum_base_type_atom,
@ -147,7 +147,7 @@ pub(crate) fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
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<Span, EnumBaseType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
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<Span, EnumBaseType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
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<Span, EnumBaseType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
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<Span, EnumNameDeclaratio
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn class_scope(s: Span) -> IResult<Span, ClassScope> {
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<Span, ClassType> {
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<Span, ClassType> {
Ok((s, ClassType { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
alt((
map(integer_vector_type, |x| {
@ -221,7 +221,7 @@ pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
alt((
map(keyword("byte"), |x| IntegerAtomType::Byte(Box::new(x))),
@ -239,7 +239,7 @@ pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
alt((
map(keyword("bit"), |x| IntegerVectorType::Bit(Box::new(x))),
@ -248,7 +248,7 @@ pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
alt((
map(keyword("shortreal"), |x| {
@ -261,7 +261,7 @@ pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
alt((
map(keyword("supply0"), |x| NetType::Supply0(Box::new(x))),
@ -279,7 +279,7 @@ pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
alt((
net_port_type_data_type,
@ -290,7 +290,7 @@ pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
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<Span, NetPortType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType> {
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<Span, NetPortType>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
let (s, a) = var_data_type(s)?;
Ok((s, VariablePortType { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
alt((
map(data_type, |x| VarDataType::DataType(Box::new(x))),
@ -324,7 +324,7 @@ pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
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<Span, VarDataType> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
alt((
map(keyword("signed"), |x| Signing::Signed(Box::new(x))),
@ -343,7 +343,7 @@ pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
alt((
map(integer_type, |x| SimpleType::IntegerType(Box::new(x))),
@ -359,7 +359,7 @@ pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
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<Span, StructUnionMember> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
alt((
map(data_type, |x| DataTypeOrVoid::DataType(Box::new(x))),
@ -382,7 +382,7 @@ pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
alt((
map(keyword("struct"), |x| StructUnion::Struct(Box::new(x))),
@ -393,12 +393,12 @@ pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn type_reference(s: Span) -> IResult<Span, TypeReference> {
alt((type_reference_expression, type_reference_data_type))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
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<Span, TypeReference>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_reference_data_type(s: Span) -> IResult<Span, TypeReference> {
let (s, a) = keyword("type")(s)?;
let (s, b) = paren(data_type)(s)?;

View File

@ -3,6 +3,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
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<Span, InoutDeclaration> {
Ok((s, InoutDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn input_declaration(s: Span) -> IResult<Span, InputDeclaration> {
alt((input_declaration_net, input_declaration_variable))(s)
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration> {
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<Span, InputDeclaration>
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclaration> {
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<Span, InputDeclarat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn output_declaration(s: Span) -> IResult<Span, OutputDeclaration> {
alt((output_declaration_net, output_declaration_variable))(s)
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration> {
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<Span, OutputDeclaration
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclaration> {
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<Span, OutputDeclar
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePortDeclaration> {
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<Span, InterfacePort
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn ref_declaration(s: Span) -> IResult<Span, RefDeclaration> {
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<Span, RefDeclaration> {
Ok((s, RefDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn implicit_var(s: Span) -> IResult<Span, VariablePortType> {
let (s, a) = keyword("var")(s)?;
Ok((

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
alt((
drive_strength01,
@ -14,7 +14,7 @@ pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
@ -23,7 +23,7 @@ pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
@ -32,7 +32,7 @@ pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength0, symbol(","), keyword("highz1")))(s)?;
Ok((
@ -41,7 +41,7 @@ pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength1, symbol(","), keyword("highz0")))(s)?;
Ok((
@ -50,7 +50,7 @@ pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(keyword("highz0"), symbol(","), strength1))(s)?;
Ok((
@ -59,7 +59,7 @@ pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(keyword("highz1"), symbol(","), strength0))(s)?;
Ok((
@ -68,7 +68,7 @@ pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
alt((
map(keyword("supply0"), |x| Strength0::Supply0(Box::new(x))),
@ -78,7 +78,7 @@ pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
alt((
map(keyword("supply1"), |x| Strength1::Supply1(Box::new(x))),
@ -88,7 +88,7 @@ pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
alt((
charge_strength_small,
@ -97,7 +97,7 @@ pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("small"))(s)?;
Ok((
@ -106,7 +106,7 @@ pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("medium"))(s)?;
Ok((
@ -115,7 +115,7 @@ pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn charge_strength_large(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("large"))(s)?;
Ok((

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
let (s, a) = keyword("task")(s)?;
let (s, b) = opt(lifetime)(s)?;
@ -10,7 +10,7 @@ pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
Ok((s, TaskDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
alt((
task_body_declaration_without_port,
@ -18,7 +18,7 @@ pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaratio
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
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<Span, TaskB
))
}
#[parser]
#[tracable_parser]
pub(crate) fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
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<Span, TaskBody
))
}
#[parser]
#[tracable_parser]
pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
alt((
map(block_item_declaration, |x| {
@ -65,13 +65,14 @@ pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn tf_port_list(s: Span) -> IResult<Span, TfPortList> {
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<Span, TfPortItem> {
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<Span, TfPortItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
alt((
map(port_direction, |x| {
@ -103,6 +104,7 @@ pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
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<Span, TfPortDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn task_prototype(s: Span) -> IResult<Span, TaskPrototype> {
let (s, a) = keyword("task")(s)?;
let (s, b) = task_identifier(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
alt((
data_declaration_variable,
@ -19,6 +19,7 @@ pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
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<Span, DataDeclaratio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn r#const(s: Span) -> IResult<Span, Const> {
let (s, a) = keyword("const")(s)?;
Ok((s, Const { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_import_declaration(s: Span) -> IResult<Span, PackageImportDeclaration> {
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<Span, PackageImport
Ok((s, PackageImportDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_import_item(s: Span) -> IResult<Span, PackageImportItem> {
alt((package_import_item_identifier, package_import_item_asterisk))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportItem> {
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<Span, PackageIm
))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem> {
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<Span, PackageImpo
))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclaration> {
alt((
package_export_declaration_asterisk,
@ -83,7 +84,7 @@ pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExport
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn package_export_declaration_asterisk(
s: Span,
) -> IResult<Span, PackageExportDeclaration> {
@ -98,7 +99,7 @@ pub(crate) fn package_export_declaration_asterisk(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_export_declaration_item(s: Span) -> IResult<Span, PackageExportDeclaration> {
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<Span, PackageE
))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
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<Span, GenvarDeclaration> {
Ok((s, GenvarDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
alt((
net_declaration_interconnect,
@ -127,6 +128,7 @@ pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
}
#[parser(Ambiguous)]
#[tracable_parser]
pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
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<Span, NetDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
alt((
map(drive_strength, |x| Strength::Drive(Box::new(x))),
@ -151,7 +153,7 @@ pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
alt((
map(keyword("vectored"), |x| VectorScalar::Vectored(Box::new(x))),
@ -159,7 +161,7 @@ pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetDeclaration> {
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<Span, NetD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
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<Span, NetDeclarat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
alt((
type_declaration_data_type,
@ -203,7 +205,7 @@ pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
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<Span, TypeDeclarati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
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<Span, TypeDeclarati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaration> {
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<Span, TypeDeclaratio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword> {
alt((
map(keyword("enum"), |x| {
@ -270,7 +272,7 @@ pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclaration
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
alt((
net_type_declaration_data_type,
@ -278,7 +280,7 @@ pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
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<Span, NetTypeDe
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
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<Span, NetTypeDec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn lifetime(s: Span) -> IResult<Span, Lifetime> {
alt((
map(keyword("static"), |x| Lifetime::Static(Box::new(x))),

View File

@ -2,19 +2,19 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn concatenation(s: Span) -> IResult<Span, Concatenation> {
let (s, a) = brace(list(symbol(","), expression))(s)?;
Ok((s, Concatenation { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_concatenation(s: Span) -> IResult<Span, ConstantConcatenation> {
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<Span, ConstantMultipleConcatenation> {
@ -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<Span, ModulePathConcatenation> {
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<Span, ModulePathMultipleConcatenation> {
@ -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<Span, MultipleConcatenation> {
let (s, a) = brace(pair(expression, concatenation))(s)?;
Ok((s, MultipleConcatenation { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
let (s, a) = brace(triple(
stream_operator,
@ -52,7 +52,7 @@ pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcate
Ok((s, StreamingConcatenation { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
alt((
map(symbol(">>"), |x| StreamOperator { nodes: (x,) }),
@ -60,7 +60,7 @@ pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
alt((
map(simple_type, |x| SliceSize::SimpleType(Box::new(x))),
@ -70,21 +70,21 @@ pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation> {
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<Span, StreamExpression> {
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<Span, ArrayRangeExpression> {
alt((
map(expression, |x| {
@ -97,7 +97,7 @@ pub(crate) fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpress
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
@ -109,7 +109,7 @@ pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeE
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
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<Span, ArrayR
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
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<Span, Array
))
}
#[parser]
#[tracable_parser]
pub(crate) fn empty_unpacked_array_concatenation(
s: Span,
) -> IResult<Span, EmptyUnpackedArrayConcatenation> {

View File

@ -3,12 +3,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn net_lvalue(s: Span) -> IResult<Span, NetLvalue> {
alt((net_lvalue_identifier, net_lvalue_lvalue, net_lvalue_pattern))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
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<Span, NetLvalue> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
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<Span, NetLvalue> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
let (s, a) = brace(list(symbol(","), net_lvalue))(s)?;
Ok((
@ -38,7 +38,7 @@ pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
alt((
variable_lvalue_identifier,
@ -50,7 +50,7 @@ pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalue> {
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<Span, VariableLvalu
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue> {
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<Span, VariableLvalue>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
let (s, a) = brace(list(symbol(","), variable_lvalue))(s)?;
Ok((
@ -80,7 +80,7 @@ pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn nonrange_variable_lvalue(s: Span) -> IResult<Span, NonrangeVariableLvalue> {
let (s, a) = opt(implicit_class_handle_or_package_scope)(s)?;
let (s, b) = hierarchical_variable_identifier(s)?;

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn inc_or_dec_expression(s: Span) -> IResult<Span, IncOrDecExpression> {
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<Span, IncOrDecExpression> {
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<Span, IncOrDecExp
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression> {
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<Span, IncOrDecExp
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
let (s, a) = cond_predicate(s)?;
let (s, b) = symbol("?")(s)?;
@ -48,7 +48,7 @@ pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpres
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
alt((
constant_expression_unary,
@ -60,7 +60,7 @@ pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
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<Span, ConstantExpres
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
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<Span, ConstantExpre
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
let (s, a) = constant_expression(s)?;
let (s, b) = symbol("?")(s)?;
@ -103,7 +103,7 @@ pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpr
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmaxExpression> {
alt((
constant_mintypmax_expression_ternary,
@ -114,7 +114,7 @@ pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMi
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_mintypmax_expression_ternary(
s: Span,
) -> IResult<Span, ConstantMintypmaxExpression> {
@ -131,7 +131,7 @@ pub(crate) fn constant_mintypmax_expression_ternary(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpression> {
alt((
map(symbol("$"), |x| {
@ -146,7 +146,7 @@ pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamE
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
alt((
map(symbol("$"), |x| ParamExpression::Dollar(Box::new(x))),
@ -157,7 +157,7 @@ pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpression> {
alt((
map(constant_part_select_range, |x| {
@ -169,7 +169,7 @@ pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeE
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRange> {
alt((
map(constant_range, |x| {
@ -182,7 +182,7 @@ pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartS
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
let (s, a) = constant_expression(s)?;
let (s, b) = symbol(":")(s)?;
@ -191,7 +191,7 @@ pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
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<Span, ConstantIndexedRa
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
alt((
expression_unary,
@ -222,7 +222,7 @@ pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn expression_unary(s: Span) -> IResult<Span, Expression> {
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<Span, Expression> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
let (s, a) = paren(operator_assignment)(s)?;
Ok((
@ -243,7 +243,7 @@ pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expressio
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
let (s, a) = expression(s)?;
let (s, b) = binary_operator(s)?;
@ -257,7 +257,7 @@ pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
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<Span, TaggedUnionExpre
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
let (s, a) = expression(s)?;
let (s, b) = keyword("inside")(s)?;
@ -274,7 +274,7 @@ pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
Ok((s, InsideExpression { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
alt((
value_range_binary,
@ -282,7 +282,7 @@ pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
let (s, a) = bracket(triple(expression, symbol(":"), expression))(s)?;
Ok((
@ -291,7 +291,7 @@ pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
alt((
mintypmax_expression_ternary,
@ -300,7 +300,7 @@ pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
@ -316,7 +316,7 @@ pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxEx
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn module_path_conditional_expression(
s: Span,
) -> IResult<Span, ModulePathConditionalExpression> {
@ -334,7 +334,7 @@ pub(crate) fn module_path_conditional_expression(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
alt((
map(module_path_primary, |x| {
@ -348,7 +348,7 @@ pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpress
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathExpression> {
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<Span, ModulePathE
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePathExpression> {
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<Span, ModulePath
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_path_mintypmax_expression(
s: Span,
) -> IResult<Span, ModulePathMintypmaxExpression> {
@ -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<Span, ModulePathMintypmaxExpression> {
@ -404,7 +404,7 @@ pub(crate) fn module_path_mintypmax_expression_ternary(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
alt((
map(constant_range, |x| {
@ -417,7 +417,7 @@ pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
let (s, a) = expression(s)?;
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
@ -425,7 +425,7 @@ pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
Ok((s, IndexedRange { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_expression(s: Span) -> IResult<Span, GenvarExpression> {
let (s, a) = constant_expression(s)?;
Ok((s, GenvarExpression { nodes: (a,) }))

View File

@ -3,7 +3,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn number(s: Span) -> IResult<Span, Number> {
alt((
map(real_number, |x| Number::RealNumber(Box::new(x))),
@ -11,7 +11,7 @@ pub(crate) fn number(s: Span) -> IResult<Span, Number> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
alt((
map(octal_number, |x| IntegralNumber::OctalNumber(Box::new(x))),
@ -23,7 +23,7 @@ pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
alt((
decimal_number_base_unsigned,
@ -35,7 +35,7 @@ pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
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<Span, DecimalNumb
))
}
#[parser]
#[tracable_parser]
pub(crate) fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumber> {
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<Span, DecimalNumb
))
}
#[parser]
#[tracable_parser]
pub(crate) fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumber> {
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<Span, DecimalNumb
))
}
#[parser]
#[tracable_parser]
pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = binary_base(s)?;
@ -76,7 +76,7 @@ pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
Ok((s, BinaryNumber { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = octal_base(s)?;
@ -84,7 +84,7 @@ pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
Ok((s, OctalNumber { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = hex_base(s)?;
@ -92,7 +92,7 @@ pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
Ok((s, HexNumber { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
alt((
map(symbol("+"), |x| Sign::Plus(Box::new(x))),
@ -100,19 +100,19 @@ pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn size(s: Span) -> IResult<Span, Size> {
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<Span, NonZeroUnsignedNumber> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
alt((
real_number_floating,
@ -131,7 +131,7 @@ pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
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<Span, RealNumber> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
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<Span, FixedPointNumber> {
Ok((s, FixedPointNumber { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn exp(s: Span) -> IResult<Span, Exp> {
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<Span, UnsignedNumber> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn octal_value(s: Span) -> IResult<Span, OctalValue> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn hex_value(s: Span) -> IResult<Span, HexValue> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
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<Span, Locate> {
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<Span, BinaryBase> {
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<Span, Locate> {
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<Span, OctalBase> {
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<Span, Locate> {
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<Span, HexBase> {
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<Span, Locate> {
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<Span, XNumber> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn z_number(s: Span) -> IResult<Span, ZNumber> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn unbased_unsized_literal(s: Span) -> IResult<Span, UnbasedUnsizedLiteral> {
let (s, a) = alt((symbol("'0"), symbol("'1"), symbol("'z"), symbol("'x")))(s)?;
Ok((s, UnbasedUnsizedLiteral { nodes: (a,) }))

View File

@ -3,7 +3,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
let (s, a) = alt((
symbol("+"),
@ -21,7 +21,7 @@ pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
Ok((s, UnaryOperator { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
let (s, a) = alt((
alt((
@ -61,13 +61,13 @@ pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
Ok((s, BinaryOperator { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn inc_or_dec_operator(s: Span) -> IResult<Span, IncOrDecOperator> {
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<Span, UnaryModulePathOperator> {
let (s, a) = alt((
symbol("!"),
@ -83,7 +83,7 @@ pub(crate) fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePa
Ok((s, UnaryModulePathOperator { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn binary_module_path_operator(s: Span) -> IResult<Span, BinaryModulePathOperator> {
let (s, a) = alt((
symbol("=="),

View File

@ -3,7 +3,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
alt((
map(keyword("null"), |x| ConstantPrimary::Null(Box::new(x))),
@ -38,7 +38,7 @@ pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span, ConstantPr
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span, ConstantPrima
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span, ConstantPri
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span, ConstantPrimary> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span, ConstantP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
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<Span,
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
let (s, a) = paren(constant_mintypmax_expression)(s)?;
Ok((
@ -111,7 +111,7 @@ pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, Co
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
alt((
map(number, |x| ModulePathPrimary::Number(Box::new(x))),
@ -129,7 +129,7 @@ pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_path_primary_mintypmax_expression(
s: Span,
) -> IResult<Span, ModulePathPrimary> {
@ -141,7 +141,7 @@ pub(crate) fn module_path_primary_mintypmax_expression(
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
alt((
map(keyword("this"), |x| Primary::This(Box::new(x))),
@ -172,7 +172,7 @@ pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
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<Span, Primary> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
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<Span, Primary> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
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<Span, Primary>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
let (s, a) = paren(mintypmax_expression)(s)?;
Ok((
@ -212,7 +212,7 @@ pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_qualifier_or_package_scope(
s: Span,
) -> IResult<Span, ClassQualifierOrPackageScope> {
@ -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<Span, ClassQualifier> {
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<Span, RangeExpression> {
alt((
map(expression, |x| RangeExpression::Expression(Box::new(x))),
@ -245,7 +245,7 @@ pub(crate) fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
alt((
map(time_literal, |x| PrimaryLiteral::TimeLiteral(Box::new(x))),
@ -259,12 +259,12 @@ pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn time_literal(s: Span) -> IResult<Span, TimeLiteral> {
alt((time_literal_unsigned, time_literal_fixed_point))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
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<Span, TimeLiteral> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
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<Span, TimeLiteral> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
alt((
map(keyword("s"), |x| TimeUnit::S(Box::new(x))),
@ -296,7 +296,7 @@ pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
alt((
map(
@ -310,13 +310,13 @@ pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandl
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bit_select(s: Span) -> IResult<Span, BitSelect> {
let (s, a) = many0(bracket(expression))(s)?;
Ok((s, BitSelect { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn select(s: Span) -> IResult<Span, Select> {
let (s, a) = opt(triple(
many0(triple(symbol("."), member_identifier, bit_select)),
@ -328,7 +328,7 @@ pub(crate) fn select(s: Span) -> IResult<Span, Select> {
Ok((s, Select { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
let (s, a) = opt(triple(
many0(triple(symbol("."), member_identifier, bit_select)),
@ -339,13 +339,13 @@ pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
Ok((s, NonrangeSelect { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_bit_select(s: Span) -> IResult<Span, ConstantBitSelect> {
let (s, a) = many0(bracket(constant_expression))(s)?;
Ok((s, ConstantBitSelect { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
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<Span, ConstantSelect> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
let (s, a) = casting_type(s)?;
let (s, b) = symbol("'")(s)?;
@ -366,14 +366,14 @@ pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
Ok((s, ConstantCast { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
let (s, a) = let_expression(s)?;
Ok((s, ConstantLetExpression { nodes: (a,) }))
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn cast(s: Span) -> IResult<Span, Cast> {
let (s, a) = casting_type(s)?;
let (s, b) = symbol("'")(s)?;

View File

@ -2,13 +2,13 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
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<Span, Locate> {
let (s, a) = tag("\"")(s)?;
let (s, b) = many1(pair(is_not("\\\""), opt(pair(tag("\\"), take(1usize)))))(s)?;

View File

@ -2,13 +2,13 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn constant_function_call(s: Span) -> IResult<Span, ConstantFunctionCall> {
let (s, a) = function_subroutine_call(s)?;
Ok((s, ConstantFunctionCall { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn tf_call(s: Span) -> IResult<Span, TfCall> {
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<Span, TfCall> {
Ok((s, TfCall { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
alt((
system_tf_call_arg_optional,
@ -25,7 +25,7 @@ pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall> {
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<Span, SystemTfCall
))
}
#[parser]
#[tracable_parser]
pub(crate) fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCall> {
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<Span, SystemTfCal
))
}
#[parser]
#[tracable_parser]
pub(crate) fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCall> {
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<Span, SystemTfCa
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
alt((
map(tf_call, |x| SubroutineCall::TfCall(Box::new(x))),
@ -71,7 +71,7 @@ pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
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<Span, SubroutineCall
))
}
#[parser]
#[tracable_parser]
pub(crate) fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_arguments(s: Span) -> IResult<Span, ListOfArguments> {
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<Span, ListOfArguments> {
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<Span, ListOfArgument
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
let (s, a) = symbol(".")(s)?;
let (s, b) = identifier(s)?;
@ -127,7 +127,7 @@ pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments>
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
let (s, a) = method_call_root(s)?;
let (s, b) = symbol(".")(s)?;
@ -136,7 +136,7 @@ pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
Ok((s, MethodCall { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
alt((
method_call_body_user,
@ -146,7 +146,7 @@ pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
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<Span, MethodCallBody> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
alt((
map(array_manipulation_call, |x| {
@ -169,7 +169,7 @@ pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulationCall> {
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<Span, ArrayManipulatio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
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<Span, RandomizeCall> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn variable_identifier_list_or_null(
s: Span,
) -> IResult<Span, VariableIdentifierListOrNull> {
@ -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<Span, MethodCallRoot> {
alt((
map(primary, |x| MethodCallRoot::Primary(Box::new(x))),
@ -225,7 +225,7 @@ pub(crate) fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn array_method_name(s: Span) -> IResult<Span, ArrayMethodName> {
alt((
map(keyword("unique"), |x| ArrayMethodName::Unique(Box::new(x))),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
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<Span, AttributeInstance> {
Ok((s, AttributeInstance { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn attr_spec(s: Span) -> IResult<Span, AttrSpec> {
let (s, a) = identifier(s)?;
let (s, b) = opt(pair(symbol("="), constant_expression))(s)?;

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn comment(s: Span) -> IResult<Span, Comment> {
alt((one_line_comment, block_comment))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
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<Span, Comment> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_comment(s: Span) -> IResult<Span, Comment> {
let (s, a) = tag("/*")(s)?;
let (s, b) = is_not("*/")(s)?;

View File

@ -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<Span, ArrayIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ArrayIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn block_identifier(s: Span) -> IResult<Span, BlockIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, BlockIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn bin_identifier(s: Span) -> IResult<Span, BinIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, BinIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
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<Span, Locate> {
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<Span, Locate> {
}
}
#[parser]
#[tracable_parser]
pub(crate) fn cell_identifier(s: Span) -> IResult<Span, CellIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CellIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn checker_identifier(s: Span) -> IResult<Span, CheckerIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CheckerIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_identifier(s: Span) -> IResult<Span, ClassIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ClassIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_variable_identifier(s: Span) -> IResult<Span, ClassVariableIdentifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, ClassVariableIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn clocking_identifier(s: Span) -> IResult<Span, ClockingIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ClockingIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_identifier(s: Span) -> IResult<Span, ConfigIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConfigIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn const_identifier(s: Span) -> IResult<Span, ConstIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConstIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_identifier(s: Span) -> IResult<Span, ConstraintIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConstraintIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn covergroup_identifier(s: Span) -> IResult<Span, CovergroupIdentifier> {
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<Span, CovergroupVariableIdentifier> {
@ -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<Span, CoverPointIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CoverPointIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn cross_identifier(s: Span) -> IResult<Span, CrossIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CrossIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn dynamic_array_variable_identifier(
s: Span,
) -> IResult<Span, DynamicArrayVariableIdentifier> {
@ -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<Span, EnumIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, EnumIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn escaped_identifier(s: Span) -> IResult<Span, EscapedIdentifier> {
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<Span, Locate> {
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<Span, Locate> {
}
#[allow(dead_code)]
#[parser]
#[tracable_parser]
pub(crate) fn formal_identifier(s: Span) -> IResult<Span, FormalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FormalIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn formal_port_identifier(s: Span) -> IResult<Span, FormalPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FormalPortIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn function_identifier(s: Span) -> IResult<Span, FunctionIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FunctionIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn generate_block_identifier(s: Span) -> IResult<Span, GenerateBlockIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, GenerateBlockIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_identifier(s: Span) -> IResult<Span, GenvarIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, GenvarIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_array_identifier(s: Span) -> IResult<Span, HierarchicalArrayIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalArrayIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_block_identifier(s: Span) -> IResult<Span, HierarchicalBlockIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalBlockIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_event_identifier(s: Span) -> IResult<Span, HierarchicalEventIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalEventIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier> {
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<Span, HierarchicalIden
Ok((s, HierarchicalIdentifier { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn root(s: Span) -> IResult<Span, Root> {
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<Span, HierarchicalNetIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalNetIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_parameter_identifier(
s: Span,
) -> IResult<Span, HierarchicalParameterIdentifier> {
@ -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<Span, HierarchicalPropertyIdentifier> {
@ -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<Span, HierarchicalSequenceIdentifier> {
@ -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<Span, HierarchicalTaskIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalTaskIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_tf_identifier(s: Span) -> IResult<Span, HierarchicalTfIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalTfIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_variable_identifier(
s: Span,
) -> IResult<Span, HierarchicalVariableIdentifier> {
@ -267,7 +267,7 @@ pub(crate) fn hierarchical_variable_identifier(
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn identifier(s: Span) -> IResult<Span, Identifier> {
alt((
map(escaped_identifier, |x| {
@ -279,98 +279,98 @@ pub(crate) fn identifier(s: Span) -> IResult<Span, Identifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn index_variable_identifier(s: Span) -> IResult<Span, IndexVariableIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, IndexVariableIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_identifier(s: Span) -> IResult<Span, InterfaceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InterfaceIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_instance_identifier(s: Span) -> IResult<Span, InterfaceInstanceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InterfaceInstanceIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn inout_port_identifier(s: Span) -> IResult<Span, InoutPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InoutPortIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn input_port_identifier(s: Span) -> IResult<Span, InputPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InputPortIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn instance_identifier(s: Span) -> IResult<Span, InstanceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InstanceIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn library_identifier(s: Span) -> IResult<Span, LibraryIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, LibraryIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn member_identifier(s: Span) -> IResult<Span, MemberIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, MemberIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn method_identifier(s: Span) -> IResult<Span, MethodIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, MethodIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn modport_identifier(s: Span) -> IResult<Span, ModportIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ModportIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_identifier(s: Span) -> IResult<Span, ModuleIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ModuleIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_identifier(s: Span) -> IResult<Span, NetIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, NetIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_type_identifier(s: Span) -> IResult<Span, NetTypeIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, NetTypeIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn output_port_identifier(s: Span) -> IResult<Span, OutputPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, OutputPortIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_identifier(s: Span) -> IResult<Span, PackageIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PackageIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
alt((
package_scope_package,
@ -378,7 +378,7 @@ pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
let (s, a) = package_identifier(s)?;
let (s, b) = symbol("::")(s)?;
@ -388,72 +388,72 @@ pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn unit(s: Span) -> IResult<Span, Unit> {
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<Span, ParameterIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ParameterIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_identifier(s: Span) -> IResult<Span, PortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PortIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn production_identifier(s: Span) -> IResult<Span, ProductionIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ProductionIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_identifier(s: Span) -> IResult<Span, ProgramIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ProgramIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn property_identifier(s: Span) -> IResult<Span, PropertyIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PropertyIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn ps_class_identifier(s: Span) -> IResult<Span, PsClassIdentifier> {
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<Span, PsCovergroupIdentifier> {
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<Span, PsCheckerIdentifier> {
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<Span, PsIdentifier> {
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<Span, PsOrHierarchicalArrayIdentifier> {
@ -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<Span, PsOrHierarchicalNetIdentifier> {
@ -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<Span, PsOrHierarchicalNetIdentifier> {
@ -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<Span, PsOrHierarchicalPropertyIdentifier> {
@ -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<Span, PsOrHierarchicalPropertyIdentifier> {
@ -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<Span, PsOrHierarchicalSequenceIdentifier> {
@ -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<Span, PsOrHierarchicalSequenceIdentifier> {
@ -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<Span, PsOrHierarchicalTfIdentifier> {
@ -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<Span, PsOrHierarchicalTfIdentifier> {
@ -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<Span, PsParameterIdentifier> {
alt((
ps_parameter_identifier_scope,
@ -575,7 +575,7 @@ pub(crate) fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdent
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParameterIdentifier> {
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<Span, PsParamete
))
}
#[parser]
#[tracable_parser]
pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIdentifier> {
let (s, a) = many0(triple(
generate_block_identifier,
@ -600,32 +600,32 @@ pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParam
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn ps_type_identifier(s: Span) -> IResult<Span, PsTypeIdentifier> {
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<Span, SequenceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SequenceIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn signal_identifier(s: Span) -> IResult<Span, SignalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SignalIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
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<Span, Locate> {
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<Span, Locate> {
}
}
#[parser]
#[tracable_parser]
pub(crate) fn specparam_identifier(s: Span) -> IResult<Span, SpecparamIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SpecparamIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn system_tf_identifier(s: Span) -> IResult<Span, SystemTfIdentifier> {
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<Span, Locate> {
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<Span, Locate> {
Ok((s, into_locate(a)))
}
#[parser]
#[tracable_parser]
pub(crate) fn task_identifier(s: Span) -> IResult<Span, TaskIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TaskIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn tf_identifier(s: Span) -> IResult<Span, TfIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TfIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn terminal_identifier(s: Span) -> IResult<Span, TerminalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TerminalIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn topmodule_identifier(s: Span) -> IResult<Span, TopmoduleIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TopmoduleIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn type_identifier(s: Span) -> IResult<Span, TypeIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TypeIdentifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_identifier(s: Span) -> IResult<Span, UdpIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, UdpIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
#[tracable_parser]
pub(crate) fn variable_identifier(s: Span) -> IResult<Span, VariableIdentifier> {
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<Span, ImplicitClassHandleOrClassScopeOrPackageScope> {
@ -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<Span, ImplicitClassHandleOrPackageScope> {
@ -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<Span, ImplicitClassHandleOrClassScope> {
@ -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<Span, PackageScopeOrClassScope> {
alt((
map(package_scope, |x| {
@ -761,7 +761,7 @@ pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScop
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn local_or_package_scope_or_class_scope(
s: Span,
) -> IResult<Span, LocalOrPackageScopeOrClassScope> {
@ -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<Span, Local> {
let (s, a) = keyword("local")(s)?;
let (s, b) = symbol("::")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
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<Span, CheckerInstantiati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_checker_port_connections(
s: Span,
) -> IResult<Span, ListOfCheckerPortConnections> {
@ -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<Span, ListOfCheckerPortConnections> {
@ -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<Span, ListOfCheckerPortConnections> {
@ -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<Span, OrderedCheckerPortConnection> {
@ -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<Span, NamedCheckerPortConnection> {
alt((
named_checker_port_connection_identifier,
@ -71,7 +71,7 @@ pub(crate) fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheck
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn named_checker_port_connection_identifier(
s: Span,
) -> IResult<Span, NamedCheckerPortConnection> {
@ -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<Span, NamedCheckerPortConnection> {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
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<Span, GenerateRegion> {
Ok((s, GenerateRegion { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct> {
let (s, a) = keyword("for")(s)?;
let (s, b) = paren(tuple((
@ -24,7 +24,7 @@ pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateCons
Ok((s, LoopGenerateConstruct { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn generate_initialization(s: Span) -> IResult<Span, GenvarInitialization> {
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<Span, GenvarInitializa
))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
alt((
genvar_iteration_assignment,
@ -47,7 +47,7 @@ pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
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<Span, GenvarIterat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration> {
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<Span, GenvarIteration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration> {
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<Span, GenvarIteration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn conditional_generate_construct(
s: Span,
) -> IResult<Span, ConditionalGenerateConstruct> {
@ -92,7 +92,7 @@ pub(crate) fn conditional_generate_construct(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
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<Span, IfGenerateConstruc
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct> {
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<Span, CaseGenerateCons
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_generate_item(s: Span) -> IResult<Span, CaseGenerateItem> {
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<Span, CaseGenerateItem> {
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<Span, CaseGenera
))
}
#[parser]
#[tracable_parser]
pub(crate) fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
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<Span, CaseGenerateI
))
}
#[parser]
#[tracable_parser]
pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
alt((
map(generate_item, |x| GenerateBlock::GenerateItem(Box::new(x))),
@ -156,7 +156,7 @@ pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
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<Span, GenerateBlock> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn generate_item(s: Span) -> IResult<Span, GenerateItem> {
alt((
map(module_or_generate_item, |x| {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn interface_instantiation(s: Span) -> IResult<Span, InterfaceInstantiation> {
let (s, a) = interface_identifier(s)?;
let (s, b) = opt(parameter_value_assignment)(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
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<Span, ModuleInstantiation
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_value_assignment(s: Span) -> IResult<Span, ParameterValueAssignment> {
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<Span, ListOfParameterAssignments> {
alt((
list_of_parameter_assignments_ordered,
@ -32,7 +32,7 @@ pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfPara
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn list_of_parameter_assignments_ordered(
s: Span,
) -> IResult<Span, ListOfParameterAssignments> {
@ -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<Span, ListOfParameterAssignments> {
@ -58,13 +58,13 @@ pub(crate) fn list_of_parameter_assignments_named(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn ordered_parameter_assignment(s: Span) -> IResult<Span, OrderedParameterAssignment> {
let (s, x) = param_expression(s)?;
Ok((s, OrderedParameterAssignment { nodes: (x,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssignment> {
let (s, a) = symbol(".")(s)?;
let (s, b) = parameter_identifier(s)?;
@ -72,21 +72,21 @@ pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParamete
Ok((s, NamedParameterAssignment { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hierarchical_instance(s: Span) -> IResult<Span, HierarchicalInstance> {
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<Span, NameOfInstance> {
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<Span, ListOfPortConnections> {
alt((
list_of_port_connections_ordered,
@ -95,7 +95,7 @@ pub(crate) fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConne
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConnections> {
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<Span, ListOfP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnections> {
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<Span, ListOfPor
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn ordered_port_connection(s: Span) -> IResult<Span, OrderedPortConnection> {
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<Span, NamedPortConnection> {
alt((
named_port_connection_identifier,
@ -129,7 +129,7 @@ pub(crate) fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnectio
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConnection> {
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<Span, NamedPo
))
}
#[parser]
#[tracable_parser]
pub(crate) fn named_port_connection_asterisk(s: Span) -> IResult<Span, NamedPortConnection> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = symbol(".*")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn program_instantiation(s: Span) -> IResult<Span, ProgramInstantiation> {
let (s, a) = program_identifier(s)?;
let (s, b) = opt(parameter_value_assignment)(s)?;

View File

@ -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);

View File

@ -2,13 +2,13 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn cmos_switchtype(s: Span) -> IResult<Span, CmosSwitchtype> {
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<Span, EnableGatetype> {
let (s, a) = alt((
keyword("bufif0"),
@ -19,7 +19,7 @@ pub(crate) fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
Ok((s, EnableGatetype { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
let (s, a) = alt((
keyword("nmos"),
@ -30,7 +30,7 @@ pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
Ok((s, MosSwitchtype { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
let (s, a) = alt((
keyword("and"),
@ -43,13 +43,13 @@ pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
Ok((s, NInputGatetype { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn n_output_gatetype(s: Span) -> IResult<Span, NOutputGatetype> {
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<Span, PassEnSwitchtype> {
let (s, a) = alt((
keyword("tranif0"),
@ -60,7 +60,7 @@ pub(crate) fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
Ok((s, PassEnSwitchtype { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn pass_switchtype(s: Span) -> IResult<Span, PassSwitchtype> {
let (s, a) = alt((keyword("tran"), keyword("rtran")))(s)?;
Ok((s, PassSwitchtype { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
alt((
gate_instantiation_cmos,
@ -17,7 +17,7 @@ pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantiatio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantiat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantiation
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantia
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstanti
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantia
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantiatio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstanti
))
}
#[parser]
#[tracable_parser]
pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
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<Span, GateInstantiat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
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<Span, CmosSwitchInstance>
Ok((s, CmosSwitchInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
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<Span, EnableGateInstance>
Ok((s, EnableGateInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
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<Span, MosSwitchInstance> {
Ok((s, MosSwitchInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance> {
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<Span, NInputGateInstance
Ok((s, NInputGateInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstance> {
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<Span, NOutputGateInstan
Ok((s, NOutputGateInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn pass_switch_instance(s: Span) -> IResult<Span, PassSwitchInstance> {
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<Span, PassEnableSwitchInstance> {
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<Span, PassEnableSw
Ok((s, PassEnableSwitchInstance { nodes: (a, b) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn pull_gate_instance(s: Span) -> IResult<Span, PullGateInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(output_terminal)(s)?;

View File

@ -2,12 +2,12 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn pulldown_strength(s: Span) -> IResult<Span, PulldownStrength> {
alt((pulldown_strength01, pulldown_strength10, pulldown_strength0))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
@ -16,7 +16,7 @@ pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
@ -25,7 +25,7 @@ pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(strength0)(s)?;
Ok((
@ -34,12 +34,12 @@ pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pullup_strength(s: Span) -> IResult<Span, PullupStrength> {
alt((pullup_strength01, pullup_strength10, pullup_strength1))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
@ -48,7 +48,7 @@ pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
@ -57,7 +57,7 @@ pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn pullup_strength1(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(strength1)(s)?;
Ok((

View File

@ -2,37 +2,37 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn enable_terminal(s: Span) -> IResult<Span, EnableTerminal> {
let (s, a) = expression(s)?;
Ok((s, EnableTerminal { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn inout_terminal(s: Span) -> IResult<Span, InoutTerminal> {
let (s, a) = net_lvalue(s)?;
Ok((s, InoutTerminal { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn input_terminal(s: Span) -> IResult<Span, InputTerminal> {
let (s, a) = expression(s)?;
Ok((s, InputTerminal { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn ncontrol_terminal(s: Span) -> IResult<Span, NcontrolTerminal> {
let (s, a) = expression(s)?;
Ok((s, NcontrolTerminal { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn output_terminal(s: Span) -> IResult<Span, OutputTerminal> {
let (s, a) = net_lvalue(s)?;
Ok((s, OutputTerminal { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn pcontrol_terminal(s: Span) -> IResult<Span, PcontrolTerminal> {
let (s, a) = expression(s)?;
Ok((s, PcontrolTerminal { nodes: (a,) }))

View File

@ -2,13 +2,13 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn checker_port_list(s: Span) -> IResult<Span, CheckerPortList> {
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<Span, CheckerPortItem> {
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<Span, CheckerPortItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
alt((
map(keyword("input"), |x| {
@ -36,7 +36,7 @@ pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirect
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem> {
alt((
map(checker_or_generate_item_declaration, |x| {
@ -63,7 +63,7 @@ pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenera
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn checker_or_generate_item_declaration(
s: Span,
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
@ -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<Span, CheckerOrGenerateItemDeclaration> {
@ -109,13 +109,13 @@ pub(crate) fn checker_or_generate_item_declaration_data(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn rand(s: Span) -> IResult<Span, Rand> {
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<Span, CheckerOrGenerateItemDeclaration> {
@ -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<Span, CheckerOrGenerateItemDeclaration> {
@ -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<Span, CheckerGenerateItem> {
alt((
map(loop_generate_construct, |x| {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
alt((
class_item_property,
@ -20,7 +20,7 @@ pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
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<Span, ClassItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
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<Span, ClassItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
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<Span, ClassItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
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<Span, ClassItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
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<Span, ClassItem> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_property(s: Span) -> IResult<Span, ClassProperty> {
alt((class_property_non_const, class_property_const))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty> {
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<Span, ClassProperty>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
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<Span, ClassProperty> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
alt((
class_method_task,
@ -113,7 +113,7 @@ pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMethod> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMethod> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMethod> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMethod>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMethod> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMethod> {
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<Span, ClassMet
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPrototype> {
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<Span, ClassConstru
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
alt((
map(constraint_prototype, |x| {
@ -209,7 +209,7 @@ pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
alt((
map(keyword("static"), |x| {
@ -222,7 +222,7 @@ pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
alt((
map(random_qualifier, |x| {
@ -234,7 +234,7 @@ pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
alt((
map(keyword("randc"), |x| RandomQualifier::Randc(Box::new(x))),
@ -242,7 +242,7 @@ pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
alt((
map(pair(keyword("pure"), keyword("virtual")), |x| {
@ -257,7 +257,7 @@ pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
alt((
map(task_prototype, |x| {
@ -269,7 +269,7 @@ pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorDeclaration> {
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<Span, ClassConst
))
}
#[parser]
#[tracable_parser]
pub(crate) fn new(s: Span) -> IResult<Span, New> {
let (s, a) = keyword("new")(s)?;
Ok((s, New { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
let (s, a) = keyword("config")(s)?;
let (s, b) = config_identifier(s)?;
@ -20,7 +20,7 @@ pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
let (s, a) = keyword("design")(s)?;
let (s, b) = many0(pair(
@ -31,7 +31,7 @@ pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
Ok((s, DesignStatement { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
alt((
config_rule_statement_default,
@ -42,7 +42,7 @@ pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatemen
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStatement> {
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<Span, ConfigRule
))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
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<Span, ConfigRul
))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
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<Span, ConfigRul
))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
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<Span, ConfigRul
))
}
#[parser]
#[tracable_parser]
pub(crate) fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
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<Span, ConfigRul
))
}
#[parser]
#[tracable_parser]
pub(crate) fn default_clause(s: Span) -> IResult<Span, DefaultClause> {
let (s, a) = keyword("default")(s)?;
Ok((s, DefaultClause { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn inst_clause(s: Span) -> IResult<Span, InstClause> {
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<Span, InstName> {
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<Span, CellClause> {
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<Span, CellClause> {
Ok((s, CellClause { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn liblist_clause(s: Span) -> IResult<Span, LiblistClause> {
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<Span, UseClause> {
alt((use_clause_cell, use_clause_named, use_clause_cell_named))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
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<Span, UseClause> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
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<Span, UseClause> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
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<Span, UseClause> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn config(s: Span) -> IResult<Span, Config> {
let (s, a) = keyword("config")(s)?;
Ok((s, Config { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
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<Span, ConstraintDeclara
))
}
#[parser]
#[tracable_parser]
pub(crate) fn r#static(s: Span) -> IResult<Span, Static> {
let (s, a) = keyword("static")(s)?;
Ok((s, Static { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_block(s: Span) -> IResult<Span, ConstraintBlock> {
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<Span, ConstraintBlockItem> {
alt((
constraint_block_item_solve,
@ -38,7 +38,7 @@ pub(crate) fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockIte
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBlockItem> {
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<Span, ConstraintBl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn solve_before_list(s: Span) -> IResult<Span, SolveBeforeList> {
let (s, a) = list(symbol(","), constraint_primary)(s)?;
Ok((s, SolveBeforeList { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
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<Span, ConstraintPrimary> {
Ok((s, ConstraintPrimary { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
alt((
constraint_expression_expression,
@ -82,7 +82,7 @@ pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpressi
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpression> {
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<Span, Constra
))
}
#[parser]
#[tracable_parser]
pub(crate) fn soft(s: Span) -> IResult<Span, Soft> {
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<Span, ConstraintExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol("->")(s)?;
@ -113,7 +113,7 @@ pub(crate) fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintEx
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression> {
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<Span, ConstraintExpre
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = keyword("foreach")(s)?;
let (s, b) = paren(pair(
@ -141,7 +141,7 @@ pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, Constraint
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpression> {
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<Span, Constraint
))
}
#[parser]
#[tracable_parser]
pub(crate) fn uniqueness_constraint(s: Span) -> IResult<Span, UniquenessConstraint> {
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<Span, ConstraintSet> {
alt((
map(constraint_expression, |x| {
@ -172,7 +172,7 @@ pub(crate) fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
let (s, a) = brace(many0(constraint_expression))(s)?;
Ok((
@ -182,26 +182,26 @@ pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn dist_list(s: Span) -> IResult<Span, DistList> {
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<Span, DistItem> {
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<Span, DistWeight> {
alt((dist_weight_equal, dist_weight_divide))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
let (s, a) = symbol(":=")(s)?;
let (s, b) = expression(s)?;
@ -211,7 +211,7 @@ pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
let (s, a) = symbol(":/")(s)?;
let (s, b) = expression(s)?;
@ -221,7 +221,7 @@ pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype> {
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<Span, ConstraintPrototype
))
}
#[parser]
#[tracable_parser]
pub(crate) fn constraint_prototype_qualifier(
s: Span,
) -> IResult<Span, ConstraintPrototypeQualifier> {
@ -250,7 +250,7 @@ pub(crate) fn constraint_prototype_qualifier(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintDeclaration> {
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<Span, ExternCons
))
}
#[parser]
#[tracable_parser]
pub(crate) fn identifier_list(s: Span) -> IResult<Span, IdentifierList> {
let (s, a) = list(symbol(","), identifier)(s)?;
Ok((s, IdentifierList { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
alt((
interface_or_generate_item_module,
@ -11,7 +11,7 @@ pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGe
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn interface_or_generate_item_module(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
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<Span, Interf
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_or_generate_item_extern(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
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<Span, Interf
))
}
#[parser]
#[tracable_parser]
pub(crate) fn extern_tf_declaration(s: Span) -> IResult<Span, ExternTfDeclaration> {
alt((extern_tf_declaration_method, extern_tf_declaration_task))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaration> {
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<Span, ExternTfDec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration> {
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<Span, ExternTfDecla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
@ -73,7 +73,7 @@ pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_interface_item(s: Span) -> IResult<Span, NonPortInterfaceItem> {
alt((
map(generate_region, |x| {

View File

@ -2,13 +2,13 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn library_text(s: Span) -> IResult<Span, LibraryText> {
let (s, a) = many0(library_description)(s)?;
Ok((s, LibraryText { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
alt((
map(library_declaration, |x| {
@ -24,7 +24,7 @@ pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
let (s, a) = keyword("library")(s)?;
let (s, b) = library_identifier(s)?;
@ -39,7 +39,7 @@ pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
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<Span, IncludeStatement> {
}
//TODO support non literal path
#[parser]
#[tracable_parser]
pub(crate) fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
let (s, a) = string_literal(s)?;
Ok((s, FilePathSpec { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask> {
alt((
elaboration_system_task_fatal,
@ -12,7 +12,7 @@ pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSyste
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystemTask> {
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<Span, Elaboratio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystemTask> {
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<Span, Elaboratio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSystemTask> {
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<Span, Elaborat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemTask> {
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<Span, Elaboration
))
}
#[parser]
#[tracable_parser]
pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
alt((
map(symbol("0"), |x| FinishNumber::Zero(Box::new(x))),
@ -70,7 +70,7 @@ pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
alt((
map(module_or_generate_item_declaration, |x| {
@ -113,7 +113,7 @@ pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
@ -125,7 +125,7 @@ pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
alt((
module_or_generate_item_parameter,
@ -136,7 +136,7 @@ pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerate
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_parameter(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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<Span, Module
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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<Span, ModuleOrGen
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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<Span, ModuleOrGene
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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<Span, ModuleOrG
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_module_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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<Span, Modu
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_or_generate_item_declaration(
s: Span,
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
@ -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<Span, ModuleOrGenerateItemDeclaration> {
@ -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<Span, ModuleOrGenerateItemDeclaration> {
@ -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<Span, NonPortModuleItem> {
alt((
map(generate_region, |x| {
@ -273,7 +273,7 @@ pub(crate) fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortModuleItem> {
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<Span, NonPortMo
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
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<Span, ParameterOverride> {
Ok((s, ParameterOverride { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn bind_directive(s: Span) -> IResult<Span, BindDirective> {
alt((bind_directive_scope, bind_directive_instance))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
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<Span, BindDirective> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
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<Span, BindDirective> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
alt((
map(module_identifier, |x| {
@ -337,20 +337,20 @@ pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn bind_target_instance(s: Span) -> IResult<Span, BindTargetInstance> {
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<Span, BindTargetInstanceList> {
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<Span, BindInstantiation> {
alt((
map(program_instantiation, |x| {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
alt((
parameter_port_list_assignment,
@ -11,7 +11,7 @@ pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortList> {
let (s, a) = symbol("#")(s)?;
let (s, b) = paren(pair(
@ -24,7 +24,7 @@ pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, Parameter
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_list_declaration(s: Span) -> IResult<Span, ParameterPortList> {
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<Span, Paramete
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
let (s, a) = symbol("#")(s)?;
let (s, b) = symbol("(")(s)?;
@ -42,7 +42,7 @@ pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortL
Ok((s, ParameterPortList::Empty(Box::new((a, b, c)))))
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclaration> {
alt((
map(parameter_declaration, |x| {
@ -56,7 +56,7 @@ pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPort
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn parameter_port_declaration_param_list(
s: Span,
) -> IResult<Span, ParameterPortDeclaration> {
@ -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<Span, ParameterPortDeclaration> {
@ -84,13 +84,13 @@ pub(crate) fn parameter_port_declaration_type_list(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_ports(s: Span) -> IResult<Span, ListOfPorts> {
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<Span, ListOfPortDeclarations> {
let (s, a) = paren(opt(list(
symbol(","),
@ -99,7 +99,7 @@ pub(crate) fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDecl
Ok((s, ListOfPortDeclarations { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
alt((
port_declaration_inout,
@ -110,7 +110,7 @@ pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
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<Span, PortDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
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<Span, PortDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
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<Span, PortDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
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<Span, PortDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclaration> {
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<Span, PortDeclarati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port(s: Span) -> IResult<Span, Port> {
alt((port_non_named, port_named))(s)
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn port_non_named(s: Span) -> IResult<Span, Port> {
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<Span, Port> {
let (s, a) = symbol(".")(s)?;
let (s, b) = port_identifier(s)?;
@ -180,7 +180,7 @@ pub(crate) fn port_named(s: Span) -> IResult<Span, Port> {
Ok((s, Port::Named(Box::new(PortNamed { nodes: (a, b, c) }))))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
alt((
map(port_reference, |x| {
@ -190,7 +190,7 @@ pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
let (s, a) = brace(list(symbol(","), port_reference))(s)?;
Ok((
@ -199,14 +199,14 @@ pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn port_reference(s: Span) -> IResult<Span, PortReference> {
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<Span, PortDirection> {
alt((
map(keyword("input"), |x| PortDirection::Input(Box::new(x))),
@ -216,21 +216,21 @@ pub(crate) fn port_direction(s: Span) -> IResult<Span, PortDirection> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn net_port_header(s: Span) -> IResult<Span, NetPortHeader> {
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<Span, VariablePortHeader> {
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<Span, InterfacePortHeader> {
alt((
interface_port_header_identifier,
@ -238,7 +238,7 @@ pub(crate) fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeade
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_port_header_identifier(s: Span) -> IResult<Span, InterfacePortHeader> {
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<Span, Interfa
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_port_header_interface(s: Span) -> IResult<Span, InterfacePortHeader> {
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<Span, Interfac
))
}
#[parser]
#[tracable_parser]
pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
alt((
ansi_port_declaration_net,
@ -267,7 +267,7 @@ pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaratio
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclaration> {
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<Span, AnsiPortDeclar
))
}
#[parser]
#[tracable_parser]
pub(crate) fn net_port_header_or_interface_port_header(
s: Span,
) -> IResult<Span, NetPortHeaderOrInterfacePortHeader> {
@ -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<Span, AnsiPortDeclaration> {
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<Span, AnsiPortDecla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn ansi_port_declaration_paren(s: Span) -> IResult<Span, AnsiPortDeclaration> {
let (s, a) = opt(port_direction)(s)?;
let (s, b) = symbol(".")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
alt((
map(package_or_generate_item_declaration, |x| {
@ -20,7 +20,7 @@ pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn package_or_generate_item_declaration(
s: Span,
) -> IResult<Span, PackageOrGenerateItemDeclaration> {
@ -70,7 +70,7 @@ pub(crate) fn package_or_generate_item_declaration(
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
let (s, a) = keyword("program")(s)?;
let (s, b) = symbol(";")(s)?;
@ -84,7 +84,7 @@ pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn anonymous_program_item(s: Span) -> IResult<Span, AnonymousProgramItem> {
alt((
map(task_declaration, |x| {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
@ -14,7 +14,7 @@ pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
alt((
non_port_program_item_assign,
@ -31,7 +31,7 @@ pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProgramItem> {
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<Span, NonPortProg
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProgramItem> {
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<Span, NonPortProg
))
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortProgramItem> {
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<Span, NonPortPro
))
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgramItem> {
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<Span, NonPortProgr
))
}
#[parser]
#[tracable_parser]
pub(crate) fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortProgramItem> {
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<Span, NonPortP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_generate_item(s: Span) -> IResult<Span, ProgramGenerateItem> {
alt((
map(loop_generate_construct, |x| {

View File

@ -2,14 +2,14 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn source_text(s: Span) -> IResult<Span, SourceText> {
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<Span, Description> {
alt((
map(module_declaration, |x| {
@ -39,7 +39,7 @@ pub(crate) fn description(s: Span) -> IResult<Span, Description> {
}
#[recursive_parser]
#[parser]
#[tracable_parser]
pub(crate) fn description_package_item(s: Span) -> IResult<Span, Description> {
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<Span, Description> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn description_bind_directive(s: Span) -> IResult<Span, Description> {
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<Span, Description>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
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<Span, ModuleNonansiHeade
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
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<Span, ModuleAnsiHeader> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
alt((
module_declaration_nonansi,
@ -106,7 +106,7 @@ pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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<Span, ModuleDeclara
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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<Span, ModuleDeclaratio
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration> {
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<Span, ModuleDeclar
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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<Span, Module
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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<Span, ModuleDec
))
}
#[parser]
#[tracable_parser]
pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
alt((
map(keyword("module"), |x| ModuleKeyword::Module(Box::new(x))),
@ -188,7 +188,7 @@ pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
alt((
interface_declaration_nonansi,
@ -199,7 +199,7 @@ pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclarati
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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<Span, InterfaceD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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<Span, InterfaceDecl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclaration> {
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<Span, Interface
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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<Span, Int
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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<Span, Interf
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader> {
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<Span, InterfaceNonans
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
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<Span, InterfaceAnsiHeade
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
alt((
program_declaration_nonansi,
@ -320,7 +320,7 @@ pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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<Span, ProgramDecla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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<Span, ProgramDeclarat
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration> {
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<Span, ProgramDecl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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<Span, Progr
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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<Span, ProgramD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
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<Span, ProgramNonansiHea
))
}
#[parser]
#[tracable_parser]
pub(crate) fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
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<Span, ProgramAnsiHeader> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
let (s, a) = keyword("checker")(s)?;
let (s, b) = checker_identifier(s)?;
@ -444,7 +444,7 @@ pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
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<Span, ClassDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_class_type(s: Span) -> IResult<Span, InterfaceClassType> {
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<Span, InterfaceClassDeclaration> {
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<Span, InterfaceCla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
alt((
map(type_declaration, |x| {
@ -518,7 +518,7 @@ pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceClassItem> {
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<Span, InterfaceCla
))
}
#[parser]
#[tracable_parser]
pub(crate) fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
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<Span, InterfaceClassMet
))
}
#[parser]
#[tracable_parser]
pub(crate) fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
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<Span, PackageDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
alt((
timeunits_declaration_timeunit_timeprecision,
@ -571,7 +571,7 @@ pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclarati
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclaration> {
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<Span, Timeunits
))
}
#[parser]
#[tracable_parser]
pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDeclaration> {
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<Span, Time
))
}
#[parser]
#[tracable_parser]
pub(crate) fn timeunits_declaration_timeunit_timeprecision(
s: Span,
) -> IResult<Span, TimeunitsDeclaration> {
@ -618,7 +618,7 @@ pub(crate) fn timeunits_declaration_timeunit_timeprecision(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn timeunits_declaration_timeprecision_timeunit(
s: Span,
) -> IResult<Span, TimeunitsDeclaration> {

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
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<Span, SpecifyBlock> {
Ok((s, SpecifyBlock { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
alt((
map(specparam_declaration, |x| {
@ -31,7 +31,7 @@ pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
let (s, a) = alt((
keyword("pulsestyle_onevent"),
@ -42,7 +42,7 @@ pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclara
Ok((s, PulsestyleDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn showcancelled_declaration(s: Span) -> IResult<Span, ShowcancelledDeclaration> {
let (s, a) = alt((keyword("showcalcelled"), keyword("noshowcancelled")))(s)?;
let (s, b) = list_of_path_outputs(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn specify_input_terminal_descriptor(
s: Span,
) -> IResult<Span, SpecifyInputTerminalDescriptor> {
@ -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<Span, SpecifyOutputTerminalDescriptor> {
@ -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<Span, InputIdentifier> {
alt((
map(input_port_identifier, |x| {
@ -33,7 +33,7 @@ pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
let (s, a) = interface_identifier(s)?;
let (s, b) = symbol(".")(s)?;
@ -44,7 +44,7 @@ pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifi
))
}
#[parser]
#[tracable_parser]
pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
alt((
map(output_port_identifier, |x| {
@ -57,7 +57,7 @@ pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn output_identifier_interface(s: Span) -> IResult<Span, OutputIdentifier> {
let (s, a) = interface_identifier(s)?;
let (s, b) = symbol(".")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
alt((
map(pair(simple_path_declaration, symbol(";")), |x| {
@ -17,7 +17,7 @@ pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration> {
alt((
simple_path_declaration_parallel,
@ -25,7 +25,7 @@ pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclar
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDeclaration> {
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<Span, SimpleP
))
}
#[parser]
#[tracable_parser]
pub(crate) fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclaration> {
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<Span, SimplePathD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescription> {
let (s, a) = paren(tuple((
specify_input_terminal_descriptor,
@ -60,7 +60,7 @@ pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDe
Ok((s, ParallelPathDescription { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
let (s, a) = paren(tuple((
list_of_path_inputs,
@ -71,13 +71,13 @@ pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescriptio
Ok((s, FullPathDescription { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_path_inputs(s: Span) -> IResult<Span, ListOfPathInputs> {
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<Span, ListOfPathOutputs> {
let (s, a) = list(symbol(","), specify_output_terminal_descriptor)(s)?;
Ok((s, ListOfPathOutputs { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
alt((
map(list_of_path_delay_expressions, |x| {
@ -12,7 +12,7 @@ pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
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<Span, PathDelayValue> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn list_of_path_delay_expressions(s: Span) -> IResult<Span, ListOfPathDelayExpressions> {
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<Span, TPathDelayExpression> {
let (s, a) = path_delay_expression(s)?;
Ok((s, TPathDelayExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn path_delay_expression(s: Span) -> IResult<Span, PathDelayExpression> {
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<Span, EdgeSensitivePathDeclaration> {
@ -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<Span, EdgeSensitivePathDeclaration> {
@ -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<Span, EdgeSensitivePathDeclaration> {
@ -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<Span, ParallelEdgeSensitivePathDescription> {
@ -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<Span, FullEdgeSensitivePathDescription> {
@ -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<Span, DataSourceExpression> {
let (s, a) = expression(s)?;
Ok((s, DataSourceExpression { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
alt((
map(keyword("posedge"), |x| EdgeIdentifier::Posedge(Box::new(x))),
@ -132,7 +132,7 @@ pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn state_dependent_path_declaration(
s: Span,
) -> IResult<Span, StateDependentPathDeclaration> {
@ -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<Span, StateDependentPathDeclaration> {
@ -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<Span, StateDependentPathDeclaration> {
@ -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<Span, StateDependentPathDeclaration> {
@ -187,7 +187,7 @@ pub(crate) fn state_dependent_path_declaration_if_none(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn polarity_operator(s: Span) -> IResult<Span, PolarityOperator> {
alt((
map(symbol("+"), |x| PolarityOperator { nodes: (x,) }),

View File

@ -2,25 +2,25 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn timecheck_condition(s: Span) -> IResult<Span, TimecheckCondition> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, TimecheckCondition { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn controlled_referecne_event(s: Span) -> IResult<Span, ControlledReferenceEvent> {
let (s, a) = controlled_timing_check_event(s)?;
Ok((s, ControlledReferenceEvent { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn data_event(s: Span) -> IResult<Span, DataEvent> {
let (s, a) = timing_check_event(s)?;
Ok((s, DataEvent { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
alt((
map(terminal_identifier, |x| {
@ -30,7 +30,7 @@ pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData> {
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<Span, DelayedData>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
alt((
map(terminal_identifier, |x| {
@ -50,7 +50,7 @@ pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, DelayedReference> {
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<Span, Delayed
))
}
#[parser]
#[tracable_parser]
pub(crate) fn end_edge_offset(s: Span) -> IResult<Span, EndEdgeOffset> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, EndEdgeOffset { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn event_based_flag(s: Span) -> IResult<Span, EventBasedFlag> {
let (s, a) = constant_expression(s)?;
Ok((s, EventBasedFlag { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn notifier(s: Span) -> IResult<Span, Notifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, Notifier { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn referecne_event(s: Span) -> IResult<Span, ReferenceEvent> {
let (s, a) = timing_check_event(s)?;
Ok((s, ReferenceEvent { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn remain_active_flag(s: Span) -> IResult<Span, RemainActiveFlag> {
let (s, a) = constant_mintypmax_expression(s)?;
Ok((s, RemainActiveFlag { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn timestamp_condition(s: Span) -> IResult<Span, TimestampCondition> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, TimestampCondition { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn start_edge_offset(s: Span) -> IResult<Span, StartEdgeOffset> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, StartEdgeOffset { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn threshold(s: Span) -> IResult<Span, Threshold> {
let (s, a) = constant_expression(s)?;
Ok((s, Threshold { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn timing_check_limit(s: Span) -> IResult<Span, TimingCheckLimit> {
let (s, a) = expression(s)?;
Ok((s, TimingCheckLimit { nodes: (a,) }))

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
alt((
map(setup_timing_check, |x| {
@ -44,7 +44,7 @@ pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
let (s, a) = keyword("$setup")(s)?;
let (s, b) = paren(tuple((
@ -59,7 +59,7 @@ pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
Ok((s, SetupTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
let (s, a) = keyword("$setup")(s)?;
let (s, b) = paren(tuple((
@ -74,7 +74,7 @@ pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
Ok((s, HoldTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
let (s, a) = keyword("$setuphold")(s)?;
let (s, b) = paren(tuple((
@ -107,7 +107,7 @@ pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCh
Ok((s, SetupholdTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
let (s, a) = keyword("$recovery")(s)?;
let (s, b) = paren(tuple((
@ -122,7 +122,7 @@ pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingChec
Ok((s, RecoveryTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
let (s, a) = keyword("$removal")(s)?;
let (s, b) = paren(tuple((
@ -137,7 +137,7 @@ pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck>
Ok((s, RemovalTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
let (s, a) = keyword("$recrem")(s)?;
let (s, b) = paren(tuple((
@ -170,7 +170,7 @@ pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
Ok((s, RecremTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
let (s, a) = keyword("$skew")(s)?;
let (s, b) = paren(tuple((
@ -185,7 +185,7 @@ pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
Ok((s, SkewTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
let (s, a) = keyword("$timeskew")(s)?;
let (s, b) = paren(tuple((
@ -208,7 +208,7 @@ pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingChec
Ok((s, TimeskewTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
let (s, a) = keyword("$fullskew")(s)?;
let (s, b) = paren(tuple((
@ -233,7 +233,7 @@ pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingChec
Ok((s, FullskewTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
let (s, a) = keyword("$period")(s)?;
let (s, b) = paren(tuple((
@ -246,7 +246,7 @@ pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
Ok((s, PeriodTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
let (s, a) = keyword("$width")(s)?;
let (s, b) = paren(tuple((
@ -261,7 +261,7 @@ pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
Ok((s, WidthTimingCheck { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
let (s, a) = keyword("$nocharge")(s)?;
let (s, b) = paren(tuple((

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
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<Span, TimingCheckEvent> {
Ok((s, TimingCheckEvent { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn controlled_timing_check_event(s: Span) -> IResult<Span, ControlledTimingCheckEvent> {
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<Span, Controlled
Ok((s, ControlledTimingCheckEvent { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventControl> {
alt((
map(keyword("posedge"), |x| {
@ -36,7 +36,7 @@ pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEv
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDescriptor> {
alt((
map(specify_input_terminal_descriptor, |x| {
@ -48,14 +48,14 @@ pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTermi
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn edge_control_specifier(s: Span) -> IResult<Span, EdgeControlSpecifier> {
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<Span, EdgeDescriptor> {
alt((
map(keyword("01"), |x| EdgeDescriptor { nodes: (x,) }),
@ -79,7 +79,7 @@ pub(crate) fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
alt((
map(scalar_timing_check_condition, |x| {
@ -89,7 +89,7 @@ pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondit
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckCondition> {
let (s, a) = paren(scalar_timing_check_condition)(s)?;
Ok((
@ -98,7 +98,7 @@ pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheck
))
}
#[parser]
#[tracable_parser]
pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
alt((
map(expression, |x| {
@ -109,7 +109,7 @@ pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimi
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn scalar_timing_check_condition_unary(
s: Span,
) -> IResult<Span, ScalarTimingCheckCondition> {
@ -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<Span, ScalarTimingCheckCondition> {
@ -138,7 +138,7 @@ pub(crate) fn scalar_timing_check_condition_binary(
))
}
#[parser]
#[tracable_parser]
pub(crate) fn scalar_constant(s: Span) -> IResult<Span, ScalarConstant> {
alt((
map(keyword("1'b0"), |x| ScalarConstant { nodes: (x,) }),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
alt((
map(combinational_body, |x| {
@ -12,7 +12,7 @@ pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
let (s, a) = keyword("table")(s)?;
let (s, b) = combinational_entry(s)?;
@ -26,7 +26,7 @@ pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
let (s, a) = level_input_list(s)?;
let (s, b) = symbol(":")(s)?;
@ -40,7 +40,7 @@ pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
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<Span, SequentialBody> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
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<Span, UdpInitialStatemen
))
}
#[parser]
#[tracable_parser]
pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
alt((
map(keyword("1'b0"), |x| InitVal { nodes: (x,) }),
@ -86,7 +86,7 @@ pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
let (s, a) = seq_input_list(s)?;
let (s, b) = symbol(":")(s)?;
@ -102,7 +102,7 @@ pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
alt((
map(level_input_list, |x| {
@ -114,14 +114,14 @@ pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn level_input_list(s: Span) -> IResult<Span, LevelInputList> {
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<Span, EdgeInputList> {
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<Span, EdgeInputList> {
Ok((s, EdgeInputList { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
alt((
edge_indicator_paren,
@ -137,7 +137,7 @@ pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
let (s, a) = paren(pair(level_symbol, level_symbol))(s)?;
Ok((
@ -146,13 +146,13 @@ pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn current_state(s: Span) -> IResult<Span, CurrentState> {
let (s, a) = level_symbol(s)?;
Ok((s, CurrentState { nodes: (a,) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
alt((
map(output_symbol, |x| NextState::OutputSymbol(Box::new(x))),
@ -160,7 +160,7 @@ pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
alt((
map(keyword("0"), |x| OutputSymbol { nodes: (x,) }),
@ -170,7 +170,7 @@ pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
alt((
map(keyword("0"), |x| LevelSymbol { nodes: (x,) }),
@ -183,7 +183,7 @@ pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
alt((
map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }),

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration> {
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<Span, UdpNonansiDeclar
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
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<Span, UdpAnsiDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
alt((
udp_declaration_nonansi,
@ -43,7 +43,7 @@ pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
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<Span, UdpDeclaration>
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
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<Span, UdpDeclaration> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
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<Span, UdpDeclar
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
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<Span, UdpDeclarati
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_wildcard(s: Span) -> IResult<Span, UdpDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("primitive")(s)?;

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
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<Span, UdpInstantiation> {
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_instance(s: Span) -> IResult<Span, UdpInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(tuple((

View File

@ -2,7 +2,7 @@ use crate::*;
// -----------------------------------------------------------------------------
#[parser]
#[tracable_parser]
pub(crate) fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
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<Span, UdpPortList> {
Ok((s, UdpPortList { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortList> {
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<Span, UdpDeclaration
Ok((s, UdpDeclarationPortList { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
alt((
map(pair(udp_output_declaration, symbol(";")), |x| {
@ -33,12 +33,12 @@ pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration>
))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_output_declaration(s: Span) -> IResult<Span, UdpOutputDeclaration> {
alt((udp_output_declaration_nonreg, udp_output_declaration_reg))(s)
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
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<Span, UdpOutputD
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
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<Span, UdpOutputDecl
))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
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<Span, UdpInputDeclaratio
Ok((s, UdpInputDeclaration { nodes: (a, b, c) }))
}
#[parser]
#[tracable_parser]
pub(crate) fn udp_reg_declaration(s: Span) -> IResult<Span, UdpRegDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("reg")(s)?;

View File

@ -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<Span<'a>, 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<Span<'a>, S
}
}
#[cfg(any(feature = "forward_trace", feature = "backward_trace"))]
pub(crate) fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, 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<Span<'a>,
}
}
#[cfg(any(feature = "forward_trace", feature = "backward_trace"))]
pub(crate) fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Paren<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Paren<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Bracket<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Bracket<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Brace<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, Brace<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, ApostropheBrace<O>>
@ -341,8 +425,6 @@ where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span<'a>, ApostropheBrace<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, 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<Span, WhiteSpace> {
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<Span<'a>, O>,
name: &str,
depth: usize,
) -> IResult<Span<'a>, 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)
}
}
}

View File

@ -9,5 +9,5 @@ build = "build.rs"
sv-parser-macros = { path = "../sv-parser-macros" }
[build-dependencies]
walkdir = "2"
regex = "1"
walkdir = "2"

View File

@ -12,7 +12,8 @@ edition = "2018"
[features]
default = []
trace = ["sv-parser-parser/trace"]
forward_trace = ["sv-parser-parser/forward_trace"]
backward_trace = ["sv-parser-parser/backward_trace"]
[dependencies]
sv-parser-parser = { path = "../sv-parser-parser" }