Adjust visibility

This commit is contained in:
dalance 2019-07-24 21:53:51 +09:00
parent 5419b44cf8
commit dc0547461c
78 changed files with 1304 additions and 1261 deletions

View File

@ -77,5 +77,12 @@ A parser library for System Verilog.
| general | comments | x | x | x |
| general | identifiers | x | x | x |
## Missing entry of specification
* interface_class_declaration -> connect to description
* formal_identifier -> ignore
* covergroup_variable_identifier -> ignore
* array_identifier -> ignore
## Test
6.25

View File

@ -1,5 +1,5 @@
pub mod any_node;
pub mod node;
pub use any_node::*;
pub use node::*;
pub use sv_parser_macro::*;
pub(crate) use any_node::*;
pub(crate) use node::*;
pub(crate) use sv_parser_macro::*;

View File

@ -6,12 +6,12 @@ use core::convert::TryFrom;
include!(concat!(env!("OUT_DIR"), "/any_node.rs"));
pub struct RefNodes<'a>(pub Vec<RefNode<'a>>);
pub(crate) struct RefNodes<'a>(pub Vec<RefNode<'a>>);
// -----------------------------------------------------------------------------
pub struct Iter<'a> {
pub next: RefNodes<'a>,
pub(crate) next: RefNodes<'a>,
}
impl<'a> Iterator for Iter<'a> {

View File

@ -1,7 +1,7 @@
use crate::ast::*;
use crate::parser::*;
pub trait Node<'a> {
pub(crate) trait Node<'a> {
fn next(&'a self) -> RefNodes<'a>;
}

View File

@ -1,7 +1,25 @@
#![recursion_limit = "256"]
pub mod ast;
pub mod parser;
use ast::*;
use parser::*;
use nom_packrat::storage;
storage!(ast::AnyNode);
pub fn parse_sv(s: &str) -> Result<SourceText, ()> {
let s = Span::new_extra(s, Extra::default());
match source_text(s) {
Ok((_, x)) => Ok(x),
Err(_) => Err(()),
}
}
pub fn parse_lib(s: &str) -> Result<LibraryText, ()> {
let s = Span::new_extra(s, Extra::default());
match library_text(s) {
Ok((_, x)) => Ok(x),
Err(_) => Err(()),
}
}

View File

@ -21,16 +21,16 @@ pub use source_text::*;
pub use specify_section::*;
pub use udp_declaration_and_instantiation::*;
pub const RECURSIVE_FLAG_WORDS: usize = 1;
pub(crate) const RECURSIVE_FLAG_WORDS: usize = 1;
#[derive(Copy, Clone, Default, Debug, PartialEq)]
pub struct Extra {
pub(crate) struct Extra {
#[cfg(feature = "trace")]
pub depth: usize,
pub recursive_flag: [u128; RECURSIVE_FLAG_WORDS],
}
pub type Span<'a> = nom_locate::LocatedSpanEx<&'a str, Extra>;
pub(crate) type Span<'a> = nom_locate::LocatedSpanEx<&'a str, Extra>;
#[derive(Copy, Clone, Default, Debug, PartialEq)]
pub struct Locate {
@ -86,16 +86,4 @@ mod thread_context {
RefCell::new(ParserIndex{index: HashMap::new(), allocated: [0;RECURSIVE_FLAG_WORDS]})
}
);
thread_local!(
pub static FAILED_MEMO: RefCell<HashMap<(&'static str, usize), bool>> = {
RefCell::new(HashMap::new())
}
);
//thread_local!(
// pub static MEMO: RefCell<HashMap<(&'static str, usize), AnyNode>> = {
// RefCell::new(HashMap::new())
// }
//);
}

View File

@ -87,7 +87,7 @@ pub enum AssertTiming {
// -----------------------------------------------------------------------------
#[parser]
pub fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
pub(crate) fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
alt((
map(concurrent_assertion_item, |x| {
AssertionItem::Concurrent(Box::new(x))
@ -99,14 +99,14 @@ pub fn assertion_item(s: Span) -> IResult<Span, AssertionItem> {
}
#[parser]
pub fn deferred_immediate_assertion_item(s: Span) -> IResult<Span, DeferredImmediateAssetionItem> {
pub(crate) fn deferred_immediate_assertion_item(s: Span) -> IResult<Span, DeferredImmediateAssetionItem> {
let (s, a) = opt(pair(block_identifier, symbol(":")))(s)?;
let (s, b) = deferred_immediate_assertion_statement(s)?;
Ok((s, DeferredImmediateAssetionItem { nodes: (a, b) }))
}
#[parser]
pub fn procedural_assertion_statement(s: Span) -> IResult<Span, ProceduralAssertionStatement> {
pub(crate) fn procedural_assertion_statement(s: Span) -> IResult<Span, ProceduralAssertionStatement> {
alt((
map(concurrent_assertion_statement, |x| {
ProceduralAssertionStatement::Concurrent(Box::new(x))
@ -121,7 +121,7 @@ pub fn procedural_assertion_statement(s: Span) -> IResult<Span, ProceduralAssert
}
#[parser]
pub fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetionStatement> {
pub(crate) fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetionStatement> {
alt((
map(simple_immediate_assertion_statement, |x| {
ImmediateAssetionStatement::Simple(Box::new(x))
@ -133,7 +133,7 @@ pub fn immediate_assertion_statement(s: Span) -> IResult<Span, ImmediateAssetion
}
#[parser]
pub fn simple_immediate_assertion_statement(
pub(crate) fn simple_immediate_assertion_statement(
s: Span,
) -> IResult<Span, SimpleImmediateAssertionStatement> {
alt((
@ -150,7 +150,7 @@ pub fn simple_immediate_assertion_statement(
}
#[parser]
pub fn simple_immediate_assert_statement(s: Span) -> IResult<Span, SimpleImmediateAssertStatement> {
pub(crate) fn simple_immediate_assert_statement(s: Span) -> IResult<Span, SimpleImmediateAssertStatement> {
let (s, a) = keyword("assert")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = action_block(s)?;
@ -158,7 +158,7 @@ pub fn simple_immediate_assert_statement(s: Span) -> IResult<Span, SimpleImmedia
}
#[parser]
pub fn simple_immediate_assume_statement(s: Span) -> IResult<Span, SimpleImmediateAssumeStatement> {
pub(crate) fn simple_immediate_assume_statement(s: Span) -> IResult<Span, SimpleImmediateAssumeStatement> {
let (s, a) = keyword("assume")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = action_block(s)?;
@ -166,7 +166,7 @@ pub fn simple_immediate_assume_statement(s: Span) -> IResult<Span, SimpleImmedia
}
#[parser]
pub fn simple_immediate_cover_statement(s: Span) -> IResult<Span, SimpleImmediateCoverStatement> {
pub(crate) fn simple_immediate_cover_statement(s: Span) -> IResult<Span, SimpleImmediateCoverStatement> {
let (s, a) = keyword("cover")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = statement_or_null(s)?;
@ -174,7 +174,7 @@ pub fn simple_immediate_cover_statement(s: Span) -> IResult<Span, SimpleImmediat
}
#[parser]
pub fn deferred_immediate_assertion_statement(
pub(crate) fn deferred_immediate_assertion_statement(
s: Span,
) -> IResult<Span, DeferredImmediateAssertionStatement> {
alt((
@ -191,7 +191,7 @@ pub fn deferred_immediate_assertion_statement(
}
#[parser]
pub fn deferred_immediate_assert_statement(
pub(crate) fn deferred_immediate_assert_statement(
s: Span,
) -> IResult<Span, DeferredImmediateAssertStatement> {
let (s, a) = keyword("assert")(s)?;
@ -207,7 +207,7 @@ pub fn deferred_immediate_assert_statement(
}
#[parser]
pub fn deferred_immediate_assume_statement(
pub(crate) fn deferred_immediate_assume_statement(
s: Span,
) -> IResult<Span, DeferredImmediateAssumeStatement> {
let (s, a) = keyword("assume")(s)?;
@ -223,7 +223,7 @@ pub fn deferred_immediate_assume_statement(
}
#[parser]
pub fn deferred_immediate_cover_statement(
pub(crate) fn deferred_immediate_cover_statement(
s: Span,
) -> IResult<Span, DeferredImmediateCoverStatement> {
let (s, a) = keyword("cover")(s)?;
@ -239,7 +239,7 @@ pub fn deferred_immediate_cover_statement(
}
#[parser]
pub fn assert_timing(s: Span) -> IResult<Span, AssertTiming> {
pub(crate) fn assert_timing(s: Span) -> IResult<Span, AssertTiming> {
alt((
map(symbol("#0"), |x| AssertTiming::Zero(Box::new(x))),
map(keyword("final"), |x| AssertTiming::Final(Box::new(x))),

View File

@ -136,7 +136,7 @@ pub struct OpenValueRange {
// -----------------------------------------------------------------------------
#[parser]
pub fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
pub(crate) fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
alt((
case_statement_normal,
case_statement_matches,
@ -145,7 +145,7 @@ pub fn case_statement(s: Span) -> IResult<Span, CaseStatement> {
}
#[parser]
pub fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
pub(crate) fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
let (s, a) = opt(unique_priority)(s)?;
let (s, b) = case_keyword(s)?;
let (s, c) = paren(case_expression)(s)?;
@ -161,7 +161,7 @@ pub fn case_statement_normal(s: Span) -> IResult<Span, CaseStatement> {
}
#[parser]
pub fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
pub(crate) fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
let (s, a) = opt(unique_priority)(s)?;
let (s, b) = case_keyword(s)?;
let (s, c) = paren(case_expression)(s)?;
@ -178,7 +178,7 @@ pub fn case_statement_matches(s: Span) -> IResult<Span, CaseStatement> {
}
#[parser]
pub fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
pub(crate) fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
let (s, a) = opt(unique_priority)(s)?;
let (s, b) = keyword("case")(s)?;
let (s, c) = paren(case_expression)(s)?;
@ -195,7 +195,7 @@ pub fn case_statement_inside(s: Span) -> IResult<Span, CaseStatement> {
}
#[parser]
pub fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
pub(crate) fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
alt((
map(keyword("casez"), |x| CaseKeyword::Casez(Box::new(x))),
map(keyword("casex"), |x| CaseKeyword::Casex(Box::new(x))),
@ -204,13 +204,13 @@ pub fn case_keyword(s: Span) -> IResult<Span, CaseKeyword> {
}
#[parser]
pub fn case_expression(s: Span) -> IResult<Span, CaseExpression> {
pub(crate) fn case_expression(s: Span) -> IResult<Span, CaseExpression> {
let (s, a) = expression(s)?;
Ok((s, CaseExpression { nodes: (a,) }))
}
#[parser]
pub fn case_item(s: Span) -> IResult<Span, CaseItem> {
pub(crate) fn case_item(s: Span) -> IResult<Span, CaseItem> {
alt((
case_item_nondefault,
map(case_item_default, |x| CaseItem::Default(Box::new(x))),
@ -218,7 +218,7 @@ pub fn case_item(s: Span) -> IResult<Span, CaseItem> {
}
#[parser(MaybeRecursive)]
pub fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
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)?;
let (s, c) = statement_or_null(s)?;
@ -229,7 +229,7 @@ pub fn case_item_nondefault(s: Span) -> IResult<Span, CaseItem> {
}
#[parser]
pub fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
pub(crate) fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
let (s, a) = keyword("default")(s)?;
let (s, b) = opt(symbol(":"))(s)?;
let (s, c) = statement_or_null(s)?;
@ -237,7 +237,7 @@ pub fn case_item_default(s: Span) -> IResult<Span, CaseItemDefault> {
}
#[parser]
pub fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
pub(crate) fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
alt((
case_pattern_item_nondefault,
map(case_item_default, |x| CasePatternItem::Default(Box::new(x))),
@ -245,7 +245,7 @@ pub fn case_pattern_item(s: Span) -> IResult<Span, CasePatternItem> {
}
#[parser(MaybeRecursive)]
pub fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePatternItem> {
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)?;
let (s, c) = symbol(":")(s)?;
@ -259,7 +259,7 @@ pub fn case_pattern_item_nondefault(s: Span) -> IResult<Span, CasePatternItem> {
}
#[parser]
pub fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
pub(crate) fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
alt((
case_inside_item_nondefault,
map(case_item_default, |x| CaseInsideItem::Default(Box::new(x))),
@ -267,7 +267,7 @@ pub fn case_inside_item(s: Span) -> IResult<Span, CaseInsideItem> {
}
#[parser(MaybeRecursive)]
pub fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
pub(crate) fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
let (s, a) = open_range_list(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = statement_or_null(s)?;
@ -278,13 +278,13 @@ pub fn case_inside_item_nondefault(s: Span) -> IResult<Span, CaseInsideItem> {
}
#[parser]
pub fn case_item_expression(s: Span) -> IResult<Span, CaseItemExpression> {
pub(crate) fn case_item_expression(s: Span) -> IResult<Span, CaseItemExpression> {
let (s, a) = expression(s)?;
Ok((s, CaseItemExpression { nodes: (a,) }))
}
#[parser]
pub fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
pub(crate) fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
let (s, a) = keyword("randcase")(s)?;
let (s, b) = randcase_item(s)?;
let (s, c) = many0(randcase_item)(s)?;
@ -298,7 +298,7 @@ pub fn randcase_statement(s: Span) -> IResult<Span, RandcaseStatement> {
}
#[parser(MaybeRecursive)]
pub fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
pub(crate) fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = statement_or_null(s)?;
@ -306,13 +306,13 @@ pub fn randcase_item(s: Span) -> IResult<Span, RandcaseItem> {
}
#[parser(MaybeRecursive)]
pub fn open_range_list(s: Span) -> IResult<Span, OpenRangeList> {
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]
pub fn open_value_range(s: Span) -> IResult<Span, OpenValueRange> {
pub(crate) fn open_value_range(s: Span) -> IResult<Span, OpenValueRange> {
let (s, a) = value_range(s)?;
Ok((s, OpenValueRange { nodes: (a,) }))
}

View File

@ -189,12 +189,12 @@ pub struct ClockvarExpression {
// -----------------------------------------------------------------------------
#[parser]
pub fn clocking_declaration(s: Span) -> IResult<Span, ClockingDeclaration> {
pub(crate) fn clocking_declaration(s: Span) -> IResult<Span, ClockingDeclaration> {
alt((clocking_declaration_local, clocking_declaration_global))(s)
}
#[parser]
pub fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration> {
pub(crate) fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration> {
let (s, a) = opt(default)(s)?;
let (s, b) = keyword("clocking")(s)?;
let (s, c) = opt(clocking_identifier)(s)?;
@ -212,13 +212,13 @@ pub fn clocking_declaration_local(s: Span) -> IResult<Span, ClockingDeclaration>
}
#[parser]
pub fn default(s: Span) -> IResult<Span, Default> {
pub(crate) fn default(s: Span) -> IResult<Span, Default> {
let (s, a) = keyword("default")(s)?;
Ok((s, Default { nodes: (a,) }))
}
#[parser]
pub fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration> {
pub(crate) fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration> {
let (s, a) = keyword("global")(s)?;
let (s, b) = keyword("clocking")(s)?;
let (s, c) = opt(clocking_identifier)(s)?;
@ -235,12 +235,12 @@ pub fn clocking_declaration_global(s: Span) -> IResult<Span, ClockingDeclaration
}
#[parser]
pub fn clocking_event(s: Span) -> IResult<Span, ClockingEvent> {
pub(crate) fn clocking_event(s: Span) -> IResult<Span, ClockingEvent> {
alt((clocking_event_identifier, clocking_event_expression))(s)
}
#[parser]
pub fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
pub(crate) fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
let (s, a) = symbol("@")(s)?;
let (s, b) = identifier(s)?;
Ok((
@ -250,7 +250,7 @@ pub fn clocking_event_identifier(s: Span) -> IResult<Span, ClockingEvent> {
}
#[parser]
pub fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
pub(crate) fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
let (s, a) = symbol("@")(s)?;
let (s, b) = paren(event_expression)(s)?;
Ok((
@ -260,7 +260,7 @@ pub fn clocking_event_expression(s: Span) -> IResult<Span, ClockingEvent> {
}
#[parser]
pub fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
pub(crate) fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
alt((
clocking_item_default,
clocking_item_direction,
@ -269,7 +269,7 @@ pub fn clocking_item(s: Span) -> IResult<Span, ClockingItem> {
}
#[parser]
pub fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
pub(crate) fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
let (s, a) = keyword("default")(s)?;
let (s, b) = default_skew(s)?;
let (s, c) = symbol(";")(s)?;
@ -280,7 +280,7 @@ pub fn clocking_item_default(s: Span) -> IResult<Span, ClockingItem> {
}
#[parser]
pub fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -291,7 +291,7 @@ pub fn clocking_item_direction(s: Span) -> IResult<Span, ClockingItem> {
}
#[parser]
pub fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
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)?;
Ok((
@ -301,7 +301,7 @@ pub fn clocking_item_assertion(s: Span) -> IResult<Span, ClockingItem> {
}
#[parser]
pub fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
pub(crate) fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
alt((
default_skew_input,
default_skew_output,
@ -310,7 +310,7 @@ pub fn default_skew(s: Span) -> IResult<Span, DefaultSkew> {
}
#[parser]
pub fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
pub(crate) fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
let (s, a) = keyword("input")(s)?;
let (s, b) = clocking_skew(s)?;
Ok((
@ -320,7 +320,7 @@ pub fn default_skew_input(s: Span) -> IResult<Span, DefaultSkew> {
}
#[parser]
pub fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
pub(crate) fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
let (s, a) = keyword("output")(s)?;
let (s, b) = clocking_skew(s)?;
Ok((
@ -330,7 +330,7 @@ pub fn default_skew_output(s: Span) -> IResult<Span, DefaultSkew> {
}
#[parser]
pub fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
pub(crate) fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
let (s, a) = keyword("input")(s)?;
let (s, b) = clocking_skew(s)?;
let (s, c) = keyword("output")(s)?;
@ -344,7 +344,7 @@ pub fn default_skew_input_output(s: Span) -> IResult<Span, DefaultSkew> {
}
#[parser]
pub fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
pub(crate) fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
alt((
clocking_direction_input,
clocking_direction_output,
@ -354,7 +354,7 @@ pub fn clocking_direction(s: Span) -> IResult<Span, ClockingDirection> {
}
#[parser]
pub fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
pub(crate) fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
let (s, a) = keyword("input")(s)?;
let (s, b) = opt(clocking_skew)(s)?;
Ok((
@ -364,7 +364,7 @@ pub fn clocking_direction_input(s: Span) -> IResult<Span, ClockingDirection> {
}
#[parser]
pub fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
pub(crate) fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
let (s, a) = keyword("output")(s)?;
let (s, b) = opt(clocking_skew)(s)?;
Ok((
@ -374,7 +374,7 @@ pub fn clocking_direction_output(s: Span) -> IResult<Span, ClockingDirection> {
}
#[parser]
pub fn clocking_direction_input_output(s: Span) -> IResult<Span, ClockingDirection> {
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)?;
let (s, c) = keyword("output")(s)?;
@ -388,26 +388,26 @@ pub fn clocking_direction_input_output(s: Span) -> IResult<Span, ClockingDirecti
}
#[parser]
pub fn clocking_direction_inout(s: Span) -> IResult<Span, ClockingDirection> {
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]
pub fn list_of_clocking_decl_assign(s: Span) -> IResult<Span, ListOfClockingDeclAssign> {
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]
pub fn clocking_decl_assign(s: Span) -> IResult<Span, ClockingDeclAssign> {
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]
pub fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
pub(crate) fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
alt((
clocking_skew_edge,
map(delay_control, |x| ClockingSkew::DelayControl(Box::new(x))),
@ -415,7 +415,7 @@ pub fn clocking_skew(s: Span) -> IResult<Span, ClockingSkew> {
}
#[parser]
pub fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
pub(crate) fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
let (s, a) = edge_identifier(s)?;
let (s, b) = opt(delay_control)(s)?;
Ok((
@ -425,7 +425,7 @@ pub fn clocking_skew_edge(s: Span) -> IResult<Span, ClockingSkew> {
}
#[parser]
pub fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
pub(crate) fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
let (s, a) = clockvar_expression(s)?;
let (s, b) = symbol("<=")(s)?;
let (s, c) = opt(cycle_delay)(s)?;
@ -439,7 +439,7 @@ pub fn clocking_drive(s: Span) -> IResult<Span, ClockingDrive> {
}
#[parser]
pub fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
pub(crate) fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
alt((
cycle_delay_integral,
cycle_delay_identifier,
@ -448,7 +448,7 @@ pub fn cycle_delay(s: Span) -> IResult<Span, CycleDelay> {
}
#[parser]
pub fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
pub(crate) fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = integral_number(s)?;
Ok((
@ -458,7 +458,7 @@ pub fn cycle_delay_integral(s: Span) -> IResult<Span, CycleDelay> {
}
#[parser]
pub fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
pub(crate) fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = identifier(s)?;
Ok((
@ -468,7 +468,7 @@ pub fn cycle_delay_identifier(s: Span) -> IResult<Span, CycleDelay> {
}
#[parser]
pub fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
pub(crate) fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
let (s, a) = symbol("##")(s)?;
let (s, b) = paren(expression)(s)?;
Ok((
@ -478,13 +478,13 @@ pub fn cycle_delay_expression(s: Span) -> IResult<Span, CycleDelay> {
}
#[parser]
pub fn clockvar(s: Span) -> IResult<Span, Clockvar> {
pub(crate) fn clockvar(s: Span) -> IResult<Span, Clockvar> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, Clockvar { nodes: (a,) }))
}
#[parser]
pub fn clockvar_expression(s: Span) -> IResult<Span, ClockvarExpression> {
pub(crate) fn clockvar_expression(s: Span) -> IResult<Span, ClockvarExpression> {
let (s, a) = clockvar(s)?;
let (s, b) = select(s)?;
Ok((s, ClockvarExpression { nodes: (a, b) }))

View File

@ -46,7 +46,7 @@ pub struct CondPattern {
// -----------------------------------------------------------------------------
#[parser]
pub fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
pub(crate) fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
let (s, a) = opt(unique_priority)(s)?;
let (s, b) = keyword("if")(s)?;
let (s, c) = paren(cond_predicate)(s)?;
@ -68,7 +68,7 @@ pub fn conditional_statement(s: Span) -> IResult<Span, ConditionalStatement> {
}
#[parser]
pub fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
pub(crate) fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
alt((
map(keyword("unique0"), |x| UniquePriority::Unique0(Box::new(x))),
map(keyword("unique"), |x| UniquePriority::Unique(Box::new(x))),
@ -79,13 +79,13 @@ pub fn unique_priority(s: Span) -> IResult<Span, UniquePriority> {
}
#[parser(MaybeRecursive)]
pub fn cond_predicate(s: Span) -> IResult<Span, CondPredicate> {
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]
pub fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrCondPattern> {
pub(crate) fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrCondPattern> {
alt((
map(expression, |x| {
ExpressionOrCondPattern::Expression(Box::new(x))
@ -97,7 +97,7 @@ pub fn expression_or_cond_pattern(s: Span) -> IResult<Span, ExpressionOrCondPatt
}
#[parser(MaybeRecursive)]
pub fn cond_pattern(s: Span) -> IResult<Span, CondPattern> {
pub(crate) fn cond_pattern(s: Span) -> IResult<Span, CondPattern> {
let (s, a) = expression(s)?;
let (s, b) = keyword("matches")(s)?;
let (s, c) = pattern(s)?;

View File

@ -56,12 +56,12 @@ pub struct NetAssignment {
// -----------------------------------------------------------------------------
#[parser]
pub fn continuous_assign(s: Span) -> IResult<Span, ContinuousAssign> {
pub(crate) fn continuous_assign(s: Span) -> IResult<Span, ContinuousAssign> {
alt((continuous_assign_net, continuous_assign_variable))(s)
}
#[parser]
pub fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
pub(crate) fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
let (s, a) = keyword("assign")(s)?;
let (s, b) = opt(drive_strength)(s)?;
let (s, c) = opt(delay3)(s)?;
@ -77,7 +77,7 @@ pub fn continuous_assign_net(s: Span) -> IResult<Span, ContinuousAssign> {
}
#[parser]
pub fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
pub(crate) fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
let (s, a) = keyword("assign")(s)?;
let (s, b) = opt(delay_control)(s)?;
let (s, c) = list_of_variable_assignments(s)?;
@ -92,19 +92,19 @@ pub fn continuous_assign_variable(s: Span) -> IResult<Span, ContinuousAssign> {
}
#[parser(MaybeRecursive)]
pub fn list_of_net_assignments(s: Span) -> IResult<Span, ListOfNetAssignments> {
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,) }))
}
#[parser(MaybeRecursive)]
pub fn list_of_variable_assignments(s: Span) -> IResult<Span, ListOfVariableAssignments> {
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]
pub fn net_alias(s: Span) -> IResult<Span, NetAlias> {
pub(crate) fn net_alias(s: Span) -> IResult<Span, NetAlias> {
let (s, a) = keyword("alias")(s)?;
let (s, b) = net_lvalue(s)?;
let (s, c) = symbol("=")(s)?;
@ -120,7 +120,7 @@ pub fn net_alias(s: Span) -> IResult<Span, NetAlias> {
}
#[parser(MaybeRecursive)]
pub fn net_assignment(s: Span) -> IResult<Span, NetAssignment> {
pub(crate) fn net_assignment(s: Span) -> IResult<Span, NetAssignment> {
let (s, a) = net_lvalue(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = expression(s)?;

View File

@ -106,7 +106,7 @@ pub struct LoopVariables {
// -----------------------------------------------------------------------------
#[parser]
pub fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
alt((
loop_statement_forever,
loop_statement_repeat,
@ -118,7 +118,7 @@ pub fn loop_statement(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("forever")(s)?;
let (s, b) = statement_or_null(s)?;
Ok((
@ -128,7 +128,7 @@ pub fn loop_statement_forever(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("repeat")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = statement_or_null(s)?;
@ -139,7 +139,7 @@ pub fn loop_statement_repeat(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("while")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = statement_or_null(s)?;
@ -150,7 +150,7 @@ pub fn loop_statement_while(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("for")(s)?;
let (s, b) = paren(tuple((
opt(for_initialization),
@ -167,7 +167,7 @@ pub fn loop_statement_for(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
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)?;
let (s, c) = keyword("while")(s)?;
@ -182,7 +182,7 @@ pub fn loop_statement_do_while(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
pub(crate) fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
let (s, a) = keyword("foreach")(s)?;
let (s, b) = paren(pair(
ps_or_hierarchical_array_identifier,
@ -196,7 +196,7 @@ pub fn loop_statement_foreach(s: Span) -> IResult<Span, LoopStatement> {
}
#[parser]
pub fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
pub(crate) fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
alt((
map(list_of_variable_assignments, |x| {
ForInitialization::ListOfVariableAssignments(Box::new(x))
@ -206,7 +206,7 @@ pub fn for_initialization(s: Span) -> IResult<Span, ForInitialization> {
}
#[parser(MaybeRecursive)]
pub fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitialization> {
pub(crate) fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitialization> {
let (s, a) = list(symbol(","), for_variable_declaration)(s)?;
Ok((
s,
@ -215,7 +215,7 @@ pub fn for_initialization_declaration(s: Span) -> IResult<Span, ForInitializatio
}
#[parser]
pub fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration> {
pub(crate) fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration> {
let (s, a) = opt(var)(s)?;
let (s, b) = data_type(s)?;
let (s, c) = list(
@ -226,19 +226,19 @@ pub fn for_variable_declaration(s: Span) -> IResult<Span, ForVariableDeclaration
}
#[parser]
pub fn var(s: Span) -> IResult<Span, Var> {
pub(crate) fn var(s: Span) -> IResult<Span, Var> {
let (s, a) = keyword("var")(s)?;
Ok((s, Var { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn for_step(s: Span) -> IResult<Span, ForStep> {
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]
pub fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
pub(crate) fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
alt((
map(operator_assignment, |x| {
ForStepAssignment::OperatorAssignment(Box::new(x))
@ -253,7 +253,7 @@ pub fn for_step_assignment(s: Span) -> IResult<Span, ForStepAssignment> {
}
#[parser]
pub fn loop_variables(s: Span) -> IResult<Span, LoopVariables> {
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

@ -53,7 +53,7 @@ pub enum JoinKeyword {
// -----------------------------------------------------------------------------
#[parser]
pub fn action_block(s: Span) -> IResult<Span, ActionBlock> {
pub(crate) fn action_block(s: Span) -> IResult<Span, ActionBlock> {
alt((
map(statement_or_null, |x| {
ActionBlock::StatementOrNull(Box::new(x))
@ -63,7 +63,7 @@ pub fn action_block(s: Span) -> IResult<Span, ActionBlock> {
}
#[parser]
pub fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
pub(crate) fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
let (s, a) = opt(statement)(s)?;
let (s, b) = keyword("else")(s)?;
let (s, c) = statement_or_null(s)?;
@ -74,7 +74,7 @@ pub fn action_block_else(s: Span) -> IResult<Span, ActionBlock> {
}
#[parser]
pub fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
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)?;
let (s, c) = many0(block_item_declaration)(s)?;
@ -90,7 +90,7 @@ pub fn seq_block(s: Span) -> IResult<Span, SeqBlock> {
}
#[parser]
pub fn par_block(s: Span) -> IResult<Span, ParBlock> {
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)?;
let (s, c) = many0(block_item_declaration)(s)?;
@ -106,7 +106,7 @@ pub fn par_block(s: Span) -> IResult<Span, ParBlock> {
}
#[parser]
pub fn join_keyword(s: Span) -> IResult<Span, JoinKeyword> {
pub(crate) fn join_keyword(s: Span) -> IResult<Span, JoinKeyword> {
alt((
map(keyword("join_any"), |x| JoinKeyword::JoinAny(Box::new(x))),
map(keyword("join_none"), |x| JoinKeyword::JoinNone(Box::new(x))),

View File

@ -115,7 +115,7 @@ pub struct AssignmentPatternVariableLvalue {
// -----------------------------------------------------------------------------
#[parser]
pub fn pattern(s: Span) -> IResult<Span, Pattern> {
pub(crate) fn pattern(s: Span) -> IResult<Span, Pattern> {
alt((
pattern_variable,
map(symbol(".*"), |x| Pattern::Asterisk(Box::new(x))),
@ -129,7 +129,7 @@ pub fn pattern(s: Span) -> IResult<Span, Pattern> {
}
#[parser]
pub fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
pub(crate) fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
let (s, a) = symbol(".")(s)?;
let (s, b) = variable_identifier(s)?;
Ok((
@ -139,7 +139,7 @@ pub fn pattern_variable(s: Span) -> IResult<Span, Pattern> {
}
#[parser]
pub fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
pub(crate) fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
let (s, a) = keyword("tagged")(s)?;
let (s, b) = member_identifier(s)?;
let (s, c) = opt(pattern)(s)?;
@ -150,13 +150,13 @@ pub fn pattern_tagged(s: Span) -> IResult<Span, Pattern> {
}
#[parser]
pub fn pattern_list(s: Span) -> IResult<Span, Pattern> {
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]
pub fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
pub(crate) fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
triple(member_identifier, symbol(":"), pattern),
@ -168,7 +168,7 @@ pub fn pattern_identifier_list(s: Span) -> IResult<Span, Pattern> {
}
#[parser]
pub fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
pub(crate) fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
alt((
assignment_pattern_list,
assignment_pattern_structure,
@ -178,7 +178,7 @@ pub fn assignment_pattern(s: Span) -> IResult<Span, AssignmentPattern> {
}
#[parser]
pub fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
pub(crate) fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(symbol(","), expression))(s)?;
Ok((
s,
@ -187,7 +187,7 @@ pub fn assignment_pattern_list(s: Span) -> IResult<Span, AssignmentPattern> {
}
#[parser]
pub fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern> {
pub(crate) fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
triple(structure_pattern_key, symbol(":"), expression),
@ -199,7 +199,7 @@ pub fn assignment_pattern_structure(s: Span) -> IResult<Span, AssignmentPattern>
}
#[parser]
pub fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
pub(crate) fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(list(
symbol(","),
triple(array_pattern_key, symbol(":"), expression),
@ -211,7 +211,7 @@ pub fn assignment_pattern_array(s: Span) -> IResult<Span, AssignmentPattern> {
}
#[parser]
pub fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
pub(crate) fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
let (s, a) = apostrophe_brace(pair(
constant_expression,
brace(list(symbol(","), expression)),
@ -223,7 +223,7 @@ pub fn assignment_pattern_repeat(s: Span) -> IResult<Span, AssignmentPattern> {
}
#[parser]
pub fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
pub(crate) fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
alt((
map(member_identifier, |x| {
StructurePatternKey::MemberIdentifier(Box::new(x))
@ -235,7 +235,7 @@ pub fn structure_pattern_key(s: Span) -> IResult<Span, StructurePatternKey> {
}
#[parser]
pub fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
pub(crate) fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
alt((
map(constant_expression, |x| {
ArrayPatternKey::ConstantExpression(Box::new(x))
@ -247,7 +247,7 @@ pub fn array_pattern_key(s: Span) -> IResult<Span, ArrayPatternKey> {
}
#[parser]
pub fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
pub(crate) fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
alt((
map(simple_type, |x| {
AssignmentPatternKey::SimpleType(Box::new(x))
@ -260,14 +260,14 @@ pub fn assignment_pattern_key(s: Span) -> IResult<Span, AssignmentPatternKey> {
#[packrat_parser]
#[parser]
pub fn assignment_pattern_expression(s: Span) -> IResult<Span, AssignmentPatternExpression> {
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]
pub fn assignment_pattern_expression_type(
pub(crate) fn assignment_pattern_expression_type(
s: Span,
) -> IResult<Span, AssignmentPatternExpressionType> {
alt((
@ -287,7 +287,7 @@ pub fn assignment_pattern_expression_type(
}
#[parser]
pub fn constant_assignment_pattern_expression(
pub(crate) fn constant_assignment_pattern_expression(
s: Span,
) -> IResult<Span, ConstantAssignmentPatternExpression> {
let (s, a) = assignment_pattern_expression(s)?;
@ -295,13 +295,13 @@ pub fn constant_assignment_pattern_expression(
}
#[parser]
pub fn assignment_pattern_net_lvalue(s: Span) -> IResult<Span, AssignmentPatternNetLvalue> {
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]
pub fn assignment_pattern_variable_lvalue(
pub(crate) fn assignment_pattern_variable_lvalue(
s: Span,
) -> IResult<Span, AssignmentPatternVariableLvalue> {
let (s, a) = apostrophe_brace(list(symbol(","), variable_lvalue))(s)?;

View File

@ -126,21 +126,21 @@ pub struct VariableAssignment {
// -----------------------------------------------------------------------------
#[parser]
pub fn initial_construct(s: Span) -> IResult<Span, InitialConstruct> {
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]
pub fn always_construct(s: Span) -> IResult<Span, AlwaysConstruct> {
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]
pub fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
pub(crate) fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
alt((
map(keyword("always_comb"), |x| {
AlwaysKeyword::AlwaysComb(Box::new(x))
@ -156,14 +156,14 @@ pub fn always_keyword(s: Span) -> IResult<Span, AlwaysKeyword> {
}
#[parser]
pub fn final_construct(s: Span) -> IResult<Span, FinalConstruct> {
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]
pub fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment> {
pub(crate) fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment> {
alt((
blocking_assignment_variable,
blocking_assignment_nonrange_variable,
@ -175,7 +175,7 @@ pub fn blocking_assignment(s: Span) -> IResult<Span, BlockingAssignment> {
}
#[parser(MaybeRecursive)]
pub fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment> {
pub(crate) fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = delay_or_event_control(s)?;
@ -189,7 +189,7 @@ pub fn blocking_assignment_variable(s: Span) -> IResult<Span, BlockingAssignment
}
#[parser(MaybeRecursive)]
pub fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingAssignment> {
pub(crate) fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingAssignment> {
let (s, a) = nonrange_variable_lvalue(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = dynamic_array_new(s)?;
@ -202,7 +202,7 @@ pub fn blocking_assignment_nonrange_variable(s: Span) -> IResult<Span, BlockingA
}
#[parser]
pub fn blocking_assignment_hierarchical_variable(s: Span) -> IResult<Span, BlockingAssignment> {
pub(crate) fn blocking_assignment_hierarchical_variable(s: Span) -> IResult<Span, BlockingAssignment> {
let (s, a) = opt(implicit_class_handle_or_class_scope_or_package_scope)(s)?;
let (s, b) = hierarchical_variable_identifier(s)?;
let (s, c) = select(s)?;
@ -219,7 +219,7 @@ pub fn blocking_assignment_hierarchical_variable(s: Span) -> IResult<Span, Block
}
#[parser(MaybeRecursive)]
pub fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
pub(crate) fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = assignment_operator(s)?;
let (s, c) = expression(s)?;
@ -227,7 +227,7 @@ pub fn operator_assignment(s: Span) -> IResult<Span, OperatorAssignment> {
}
#[parser]
pub fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
pub(crate) fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
alt((
map(symbol("="), |x| AssignmentOperator { nodes: (x,) }),
map(symbol("+="), |x| AssignmentOperator { nodes: (x,) }),
@ -246,7 +246,7 @@ pub fn assignment_operator(s: Span) -> IResult<Span, AssignmentOperator> {
}
#[parser(MaybeRecursive)]
pub fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
pub(crate) fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("<=")(s)?;
let (s, c) = opt(delay_or_event_control)(s)?;
@ -260,7 +260,7 @@ pub fn nonblocking_assignment(s: Span) -> IResult<Span, NonblockingAssignment> {
}
#[parser]
pub fn procedural_continuous_assignment(s: Span) -> IResult<Span, ProceduralContinuousAssignment> {
pub(crate) fn procedural_continuous_assignment(s: Span) -> IResult<Span, ProceduralContinuousAssignment> {
alt((
procedural_continuous_assignment_assign,
procedural_continuous_assignment_deassign,
@ -272,7 +272,7 @@ pub fn procedural_continuous_assignment(s: Span) -> IResult<Span, ProceduralCont
}
#[parser]
pub fn procedural_continuous_assignment_assign(
pub(crate) fn procedural_continuous_assignment_assign(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("assign")(s)?;
@ -286,7 +286,7 @@ pub fn procedural_continuous_assignment_assign(
}
#[parser]
pub fn procedural_continuous_assignment_deassign(
pub(crate) fn procedural_continuous_assignment_deassign(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("deassign")(s)?;
@ -300,7 +300,7 @@ pub fn procedural_continuous_assignment_deassign(
}
#[parser]
pub fn procedural_continuous_assignment_force_variable(
pub(crate) fn procedural_continuous_assignment_force_variable(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("force")(s)?;
@ -314,7 +314,7 @@ pub fn procedural_continuous_assignment_force_variable(
}
#[parser]
pub fn procedural_continuous_assignment_force_net(
pub(crate) fn procedural_continuous_assignment_force_net(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("force")(s)?;
@ -328,7 +328,7 @@ pub fn procedural_continuous_assignment_force_net(
}
#[parser]
pub fn procedural_continuous_assignment_release_variable(
pub(crate) fn procedural_continuous_assignment_release_variable(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("release")(s)?;
@ -342,7 +342,7 @@ pub fn procedural_continuous_assignment_release_variable(
}
#[parser]
pub fn procedural_continuous_assignment_release_net(
pub(crate) fn procedural_continuous_assignment_release_net(
s: Span,
) -> IResult<Span, ProceduralContinuousAssignment> {
let (s, a) = keyword("release")(s)?;
@ -356,7 +356,7 @@ pub fn procedural_continuous_assignment_release_net(
}
#[parser(MaybeRecursive)]
pub fn variable_assignment(s: Span) -> IResult<Span, VariableAssignment> {
pub(crate) fn variable_assignment(s: Span) -> IResult<Span, VariableAssignment> {
let (s, a) = variable_lvalue(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = expression(s)?;

View File

@ -143,7 +143,7 @@ pub struct RsCaseItemDefault {
// -----------------------------------------------------------------------------
#[parser]
pub fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
pub(crate) fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
let (s, a) = keyword("randsequence")(s)?;
let (s, b) = paren(opt(production_identifier))(s)?;
let (s, c) = production(s)?;
@ -158,7 +158,7 @@ pub fn randsequence_statement(s: Span) -> IResult<Span, RandsequenceStatement> {
}
#[parser]
pub fn production(s: Span) -> IResult<Span, Production> {
pub(crate) fn production(s: Span) -> IResult<Span, Production> {
let (s, a) = opt(data_type_or_void)(s)?;
let (s, b) = production_identifier(s)?;
let (s, c) = opt(paren(tf_port_list))(s)?;
@ -174,7 +174,7 @@ pub fn production(s: Span) -> IResult<Span, Production> {
}
#[parser]
pub fn rs_rule(s: Span) -> IResult<Span, RsRule> {
pub(crate) fn rs_rule(s: Span) -> IResult<Span, RsRule> {
let (s, a) = rs_production_list(s)?;
let (s, b) = opt(triple(
symbol(":="),
@ -185,12 +185,12 @@ pub fn rs_rule(s: Span) -> IResult<Span, RsRule> {
}
#[parser]
pub fn rs_production_list(s: Span) -> IResult<Span, RsProductionList> {
pub(crate) fn rs_production_list(s: Span) -> IResult<Span, RsProductionList> {
alt((rs_production_list_prod, rs_production_list_join))(s)
}
#[parser]
pub fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList> {
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)?;
Ok((
@ -200,7 +200,7 @@ pub fn rs_production_list_prod(s: Span) -> IResult<Span, RsProductionList> {
}
#[parser]
pub fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
pub(crate) fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
let (s, a) = keyword("rand")(s)?;
let (s, b) = keyword("join")(s)?;
let (s, c) = opt(paren(expression))(s)?;
@ -216,7 +216,7 @@ pub fn rs_production_list_join(s: Span) -> IResult<Span, RsProductionList> {
}
#[parser]
pub fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
pub(crate) fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
alt((
map(integral_number, |x| {
WeightSpecification::IntegralNumber(Box::new(x))
@ -229,7 +229,7 @@ pub fn weight_specification(s: Span) -> IResult<Span, WeightSpecification> {
}
#[parser]
pub fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecification> {
pub(crate) fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecification> {
let (s, a) = paren(expression)(s)?;
Ok((
s,
@ -238,13 +238,13 @@ pub fn weight_specification_expression(s: Span) -> IResult<Span, WeightSpecifica
}
#[parser]
pub fn rs_code_block(s: Span) -> IResult<Span, RsCodeBlock> {
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]
pub fn rs_prod(s: Span) -> IResult<Span, RsProd> {
pub(crate) fn rs_prod(s: Span) -> IResult<Span, RsProd> {
alt((
map(production_item, |x| RsProd::ProductionItem(Box::new(x))),
map(rs_code_block, |x| RsProd::RsCodeBlock(Box::new(x))),
@ -255,14 +255,14 @@ pub fn rs_prod(s: Span) -> IResult<Span, RsProd> {
}
#[parser]
pub fn production_item(s: Span) -> IResult<Span, ProductionItem> {
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]
pub fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
pub(crate) fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
let (s, a) = keyword("if")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = production_item(s)?;
@ -276,7 +276,7 @@ pub fn rs_if_else(s: Span) -> IResult<Span, RsIfElse> {
}
#[parser]
pub fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
pub(crate) fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
let (s, a) = keyword("repeat")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = production_item(s)?;
@ -284,7 +284,7 @@ pub fn rs_repeat(s: Span) -> IResult<Span, RsRepeat> {
}
#[parser]
pub fn rs_case(s: Span) -> IResult<Span, RsCase> {
pub(crate) fn rs_case(s: Span) -> IResult<Span, RsCase> {
let (s, a) = keyword("case")(s)?;
let (s, b) = paren(case_expression)(s)?;
let (s, c) = rs_case_item(s)?;
@ -299,12 +299,12 @@ pub fn rs_case(s: Span) -> IResult<Span, RsCase> {
}
#[parser]
pub fn rs_case_item(s: Span) -> IResult<Span, RsCaseItem> {
pub(crate) fn rs_case_item(s: Span) -> IResult<Span, RsCaseItem> {
alt((rs_case_item_nondefault, rs_case_item_default))(s)
}
#[parser(MaybeRecursive)]
pub fn rs_case_item_nondefault(s: Span) -> IResult<Span, RsCaseItem> {
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)?;
let (s, c) = production_item(s)?;
@ -318,7 +318,7 @@ pub fn rs_case_item_nondefault(s: Span) -> IResult<Span, RsCaseItem> {
}
#[parser]
pub fn rs_case_item_default(s: Span) -> IResult<Span, RsCaseItem> {
pub(crate) fn rs_case_item_default(s: Span) -> IResult<Span, RsCaseItem> {
let (s, a) = keyword("default")(s)?;
let (s, b) = opt(symbol(":"))(s)?;
let (s, c) = production_item(s)?;

View File

@ -76,7 +76,7 @@ pub struct VariableIdentifierList {
// -----------------------------------------------------------------------------
#[parser]
pub fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
pub(crate) fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
alt((
map(statement, |x| StatementOrNull::Statement(Box::new(x))),
statement_or_null_attribute,
@ -84,7 +84,7 @@ pub fn statement_or_null(s: Span) -> IResult<Span, StatementOrNull> {
}
#[parser]
pub fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
pub(crate) fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = symbol(";")(s)?;
Ok((
@ -94,7 +94,7 @@ pub fn statement_or_null_attribute(s: Span) -> IResult<Span, StatementOrNull> {
}
#[parser(MaybeRecursive)]
pub fn statement(s: Span) -> IResult<Span, Statement> {
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)?;
let (s, c) = statement_item(s)?;
@ -102,7 +102,7 @@ pub fn statement(s: Span) -> IResult<Span, Statement> {
}
#[parser]
pub fn statement_item(s: Span) -> IResult<Span, StatementItem> {
pub(crate) fn statement_item(s: Span) -> IResult<Span, StatementItem> {
alt((
map(pair(blocking_assignment, symbol(";")), |x| {
StatementItem::BlockingAssignment(Box::new(x))
@ -162,13 +162,13 @@ pub fn statement_item(s: Span) -> IResult<Span, StatementItem> {
}
#[parser]
pub fn function_statement(s: Span) -> IResult<Span, FunctionStatement> {
pub(crate) fn function_statement(s: Span) -> IResult<Span, FunctionStatement> {
let (s, a) = statement(s)?;
Ok((s, FunctionStatement { nodes: (a,) }))
}
#[parser]
pub fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrNull> {
pub(crate) fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrNull> {
alt((
map(function_statement, |x| {
FunctionStatementOrNull::Statement(Box::new(x))
@ -178,7 +178,7 @@ pub fn function_statement_or_null(s: Span) -> IResult<Span, FunctionStatementOrN
}
#[parser]
pub fn function_statement_or_null_attribute(s: Span) -> IResult<Span, FunctionStatementOrNull> {
pub(crate) fn function_statement_or_null_attribute(s: Span) -> IResult<Span, FunctionStatementOrNull> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = symbol(";")(s)?;
Ok((
@ -190,7 +190,7 @@ pub fn function_statement_or_null_attribute(s: Span) -> IResult<Span, FunctionSt
}
#[parser]
pub fn variable_identifier_list(s: Span) -> IResult<Span, VariableIdentifierList> {
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

@ -21,7 +21,7 @@ pub struct SubroutineCallStatementFunction {
// -----------------------------------------------------------------------------
#[parser]
pub fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStatement> {
pub(crate) fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStatement> {
alt((
map(pair(subroutine_call, symbol(";")), |x| {
SubroutineCallStatement::SubroutineCall(Box::new(x))
@ -31,7 +31,7 @@ pub fn subroutine_call_statement(s: Span) -> IResult<Span, SubroutineCallStateme
}
#[parser]
pub fn subroutine_call_statement_function(s: Span) -> IResult<Span, SubroutineCallStatement> {
pub(crate) fn subroutine_call_statement_function(s: Span) -> IResult<Span, SubroutineCallStatement> {
let (s, a) = keyword("void")(s)?;
let (s, b) = symbol("'")(s)?;
let (s, c) = paren(function_subroutine_call)(s)?;

View File

@ -213,7 +213,7 @@ pub struct DisableStatementFork {
// -----------------------------------------------------------------------------
#[parser]
pub fn procedural_timing_control_statement(
pub(crate) fn procedural_timing_control_statement(
s: Span,
) -> IResult<Span, ProceduralTimingControlStatement> {
let (s, a) = procedural_timing_control(s)?;
@ -222,7 +222,7 @@ pub fn procedural_timing_control_statement(
}
#[parser]
pub fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventControl> {
pub(crate) fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventControl> {
alt((
map(delay_control, |x| DelayOrEventControl::Delay(Box::new(x))),
map(event_control, |x| DelayOrEventControl::Event(Box::new(x))),
@ -231,7 +231,7 @@ pub fn delay_or_event_control(s: Span) -> IResult<Span, DelayOrEventControl> {
}
#[parser]
pub fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEventControl> {
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)?;
let (s, c) = event_control(s)?;
@ -242,12 +242,12 @@ pub fn delay_or_event_control_repeat(s: Span) -> IResult<Span, DelayOrEventContr
}
#[parser]
pub fn delay_control(s: Span) -> IResult<Span, DelayControl> {
pub(crate) fn delay_control(s: Span) -> IResult<Span, DelayControl> {
alt((delay_control_delay, delay_control_mintypmax))(s)
}
#[parser]
pub fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
pub(crate) fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
let (s, a) = symbol("#")(s)?;
let (s, b) = delay_value(s)?;
Ok((
@ -257,7 +257,7 @@ pub fn delay_control_delay(s: Span) -> IResult<Span, DelayControl> {
}
#[parser]
pub fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
pub(crate) fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
let (s, a) = symbol("#")(s)?;
let (s, b) = paren(mintypmax_expression)(s)?;
Ok((
@ -267,7 +267,7 @@ pub fn delay_control_mintypmax(s: Span) -> IResult<Span, DelayControl> {
}
#[parser]
pub fn event_control(s: Span) -> IResult<Span, EventControl> {
pub(crate) fn event_control(s: Span) -> IResult<Span, EventControl> {
alt((
event_control_event_identifier,
event_control_event_expression,
@ -278,7 +278,7 @@ pub fn event_control(s: Span) -> IResult<Span, EventControl> {
}
#[parser]
pub fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
pub(crate) fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
let (s, a) = symbol("@")(s)?;
let (s, b) = hierarchical_event_identifier(s)?;
Ok((
@ -288,7 +288,7 @@ pub fn event_control_event_identifier(s: Span) -> IResult<Span, EventControl> {
}
#[parser]
pub fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
pub(crate) fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
let (s, a) = symbol("@")(s)?;
let (s, b) = paren(event_expression)(s)?;
Ok((
@ -298,7 +298,7 @@ pub fn event_control_event_expression(s: Span) -> IResult<Span, EventControl> {
}
#[parser]
pub fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
pub(crate) fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
let (s, a) = symbol("@*")(s)?;
Ok((
s,
@ -307,7 +307,7 @@ pub fn event_control_asterisk(s: Span) -> IResult<Span, EventControl> {
}
#[parser]
pub fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
pub(crate) fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
let (s, a) = symbol("@")(s)?;
let (s, b) = paren(symbol("*"))(s)?;
Ok((
@ -317,7 +317,7 @@ pub fn event_control_paren_asterisk(s: Span) -> IResult<Span, EventControl> {
}
#[parser]
pub fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventControl> {
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)?;
Ok((
@ -329,7 +329,7 @@ pub fn event_control_sequence_identifier(s: Span) -> IResult<Span, EventControl>
}
#[parser]
pub fn event_expression(s: Span) -> IResult<Span, EventExpression> {
pub(crate) fn event_expression(s: Span) -> IResult<Span, EventExpression> {
alt((
event_expression_expression,
event_expression_sequence,
@ -340,7 +340,7 @@ pub fn event_expression(s: Span) -> IResult<Span, EventExpression> {
}
#[parser(MaybeRecursive)]
pub fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
pub(crate) fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = opt(edge_identifier)(s)?;
let (s, b) = expression(s)?;
let (s, c) = opt(pair(keyword("iff"), expression))(s)?;
@ -351,7 +351,7 @@ pub fn event_expression_expression(s: Span) -> IResult<Span, EventExpression> {
}
#[parser]
pub fn event_expression_sequence(s: Span) -> IResult<Span, EventExpression> {
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)?;
Ok((
@ -361,7 +361,7 @@ pub fn event_expression_sequence(s: Span) -> IResult<Span, EventExpression> {
}
#[parser(MaybeRecursive)]
pub fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
pub(crate) fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = event_expression(s)?;
let (s, b) = keyword("or")(s)?;
let (s, c) = event_expression(s)?;
@ -372,7 +372,7 @@ pub fn event_expression_or(s: Span) -> IResult<Span, EventExpression> {
}
#[parser(MaybeRecursive)]
pub fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
pub(crate) fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = event_expression(s)?;
let (s, b) = symbol(",")(s)?;
let (s, c) = event_expression(s)?;
@ -383,7 +383,7 @@ pub fn event_expression_comma(s: Span) -> IResult<Span, EventExpression> {
}
#[parser]
pub fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
pub(crate) fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
let (s, a) = paren(event_expression)(s)?;
Ok((
s,
@ -392,7 +392,7 @@ pub fn event_expression_paren(s: Span) -> IResult<Span, EventExpression> {
}
#[parser]
pub fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingControl> {
pub(crate) fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingControl> {
alt((
map(delay_control, |x| {
ProceduralTimingControl::DelayControl(Box::new(x))
@ -407,7 +407,7 @@ pub fn procedural_timing_control(s: Span) -> IResult<Span, ProceduralTimingContr
}
#[parser]
pub fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
pub(crate) fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
alt((
jump_statement_return,
jump_statement_break,
@ -416,7 +416,7 @@ pub fn jump_statement(s: Span) -> IResult<Span, JumpStatement> {
}
#[parser]
pub fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
pub(crate) fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
let (s, a) = keyword("return")(s)?;
let (s, b) = opt(expression)(s)?;
let (s, c) = symbol(";")(s)?;
@ -427,7 +427,7 @@ pub fn jump_statement_return(s: Span) -> IResult<Span, JumpStatement> {
}
#[parser]
pub fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
pub(crate) fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
let (s, a) = keyword("break")(s)?;
let (s, b) = symbol(";")(s)?;
Ok((
@ -437,7 +437,7 @@ pub fn jump_statement_break(s: Span) -> IResult<Span, JumpStatement> {
}
#[parser]
pub fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
pub(crate) fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
let (s, a) = keyword("continue")(s)?;
let (s, b) = symbol(";")(s)?;
Ok((
@ -447,7 +447,7 @@ pub fn jump_statement_continue(s: Span) -> IResult<Span, JumpStatement> {
}
#[parser]
pub fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
pub(crate) fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
alt((
wait_statement_wait,
wait_statement_fork,
@ -456,7 +456,7 @@ pub fn wait_statement(s: Span) -> IResult<Span, WaitStatement> {
}
#[parser]
pub fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
pub(crate) fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
let (s, a) = keyword("wait")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = statement_or_null(s)?;
@ -467,7 +467,7 @@ pub fn wait_statement_wait(s: Span) -> IResult<Span, WaitStatement> {
}
#[parser]
pub fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
pub(crate) fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
let (s, a) = keyword("wait")(s)?;
let (s, b) = keyword("fork")(s)?;
let (s, c) = symbol(";")(s)?;
@ -478,7 +478,7 @@ pub fn wait_statement_fork(s: Span) -> IResult<Span, WaitStatement> {
}
#[parser]
pub fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
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)?;
let (s, c) = action_block(s)?;
@ -489,12 +489,12 @@ pub fn wait_statement_order(s: Span) -> IResult<Span, WaitStatement> {
}
#[parser]
pub fn event_trigger(s: Span) -> IResult<Span, EventTrigger> {
pub(crate) fn event_trigger(s: Span) -> IResult<Span, EventTrigger> {
alt((event_trigger_named, event_trigger_nonblocking))(s)
}
#[parser]
pub fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
pub(crate) fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
let (s, a) = symbol("->")(s)?;
let (s, b) = hierarchical_event_identifier(s)?;
let (s, c) = symbol(";")(s)?;
@ -505,7 +505,7 @@ pub fn event_trigger_named(s: Span) -> IResult<Span, EventTrigger> {
}
#[parser]
pub fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger> {
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)?;
let (s, c) = hierarchical_event_identifier(s)?;
@ -519,7 +519,7 @@ pub fn event_trigger_nonblocking(s: Span) -> IResult<Span, EventTrigger> {
}
#[parser]
pub fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
pub(crate) fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
alt((
disable_statement_task,
disable_statement_block,
@ -528,7 +528,7 @@ pub fn disable_statement(s: Span) -> IResult<Span, DisableStatement> {
}
#[parser]
pub fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
pub(crate) fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
let (s, a) = keyword("disable")(s)?;
let (s, b) = hierarchical_task_identifier(s)?;
let (s, c) = symbol(";")(s)?;
@ -539,7 +539,7 @@ pub fn disable_statement_task(s: Span) -> IResult<Span, DisableStatement> {
}
#[parser]
pub fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
pub(crate) fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
let (s, a) = keyword("disable")(s)?;
let (s, b) = hierarchical_block_identifier(s)?;
let (s, c) = symbol(";")(s)?;
@ -550,7 +550,7 @@ pub fn disable_statement_block(s: Span) -> IResult<Span, DisableStatement> {
}
#[parser]
pub fn disable_statement_fork(s: Span) -> IResult<Span, DisableStatement> {
pub(crate) fn disable_statement_fork(s: Span) -> IResult<Span, DisableStatement> {
let (s, a) = keyword("disable")(s)?;
let (s, b) = keyword("fork")(s)?;
let (s, c) = symbol(";")(s)?;

View File

@ -670,7 +670,7 @@ pub struct AssertionVariableDeclaration {
// -----------------------------------------------------------------------------
#[parser]
pub fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
pub(crate) fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
alt((
concurrent_assertion_item_statement,
map(checker_instantiation, |x| {
@ -680,7 +680,7 @@ pub fn concurrent_assertion_item(s: Span) -> IResult<Span, ConcurrentAssertionIt
}
#[parser]
pub fn concurrent_assertion_item_statement(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
pub(crate) fn concurrent_assertion_item_statement(s: Span) -> IResult<Span, ConcurrentAssertionItem> {
let (s, a) = opt(pair(block_identifier, symbol(":")))(s)?;
let (s, b) = concurrent_assertion_statement(s)?;
Ok((
@ -692,7 +692,7 @@ pub fn concurrent_assertion_item_statement(s: Span) -> IResult<Span, ConcurrentA
}
#[parser]
pub fn concurrent_assertion_statement(s: Span) -> IResult<Span, ConcurrentAssertionStatement> {
pub(crate) fn concurrent_assertion_statement(s: Span) -> IResult<Span, ConcurrentAssertionStatement> {
alt((
map(assert_property_statement, |x| {
ConcurrentAssertionStatement::AssertPropertyStatement(Box::new(x))
@ -713,7 +713,7 @@ pub fn concurrent_assertion_statement(s: Span) -> IResult<Span, ConcurrentAssert
}
#[parser]
pub fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStatement> {
pub(crate) fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStatement> {
let (s, a) = keyword("assert")(s)?;
let (s, b) = keyword("property")(s)?;
let (s, c) = paren(property_spec)(s)?;
@ -727,7 +727,7 @@ pub fn assert_property_statement(s: Span) -> IResult<Span, AssertPropertyStateme
}
#[parser]
pub fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStatement> {
pub(crate) fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStatement> {
let (s, a) = keyword("assume")(s)?;
let (s, b) = keyword("property")(s)?;
let (s, c) = paren(property_spec)(s)?;
@ -741,7 +741,7 @@ pub fn assume_property_statement(s: Span) -> IResult<Span, AssumePropertyStateme
}
#[parser]
pub fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement> {
pub(crate) fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement> {
let (s, a) = keyword("cover")(s)?;
let (s, b) = keyword("property")(s)?;
let (s, c) = paren(property_spec)(s)?;
@ -755,7 +755,7 @@ pub fn cover_property_statement(s: Span) -> IResult<Span, CoverPropertyStatement
}
#[parser]
pub fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStatement> {
pub(crate) fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStatement> {
let (s, a) = keyword("expect")(s)?;
let (s, b) = paren(property_spec)(s)?;
let (s, c) = action_block(s)?;
@ -763,7 +763,7 @@ pub fn expect_property_statement(s: Span) -> IResult<Span, ExpectPropertyStateme
}
#[parser]
pub fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement> {
pub(crate) fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement> {
let (s, a) = keyword("cover")(s)?;
let (s, b) = keyword("sequence")(s)?;
let (s, c) = paren(triple(
@ -785,7 +785,7 @@ pub fn cover_sequence_statement(s: Span) -> IResult<Span, CoverSequenceStatement
}
#[parser]
pub fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertyStatement> {
pub(crate) fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertyStatement> {
let (s, a) = keyword("restrict")(s)?;
let (s, b) = keyword("property")(s)?;
let (s, c) = paren(property_spec)(s)?;
@ -799,14 +799,14 @@ pub fn restrict_property_statement(s: Span) -> IResult<Span, RestrictPropertySta
}
#[parser]
pub fn property_instance(s: Span) -> IResult<Span, PropertyInstance> {
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]
pub fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListOfArguments> {
pub(crate) fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListOfArguments> {
alt((
property_list_of_arguments_ordered,
property_list_of_arguments_named,
@ -814,7 +814,7 @@ pub fn property_list_of_arguments(s: Span) -> IResult<Span, PropertyListOfArgume
}
#[parser(MaybeRecursive)]
pub fn property_list_of_arguments_ordered(s: Span) -> IResult<Span, PropertyListOfArguments> {
pub(crate) fn property_list_of_arguments_ordered(s: Span) -> IResult<Span, PropertyListOfArguments> {
let (s, a) = list(symbol(","), opt(property_actual_arg))(s)?;
let (s, b) = many0(tuple((
symbol(","),
@ -831,7 +831,7 @@ pub fn property_list_of_arguments_ordered(s: Span) -> IResult<Span, PropertyList
}
#[parser]
pub fn property_list_of_arguments_named(s: Span) -> IResult<Span, PropertyListOfArguments> {
pub(crate) fn property_list_of_arguments_named(s: Span) -> IResult<Span, PropertyListOfArguments> {
let (s, a) = list(
symbol(","),
triple(symbol("."), identifier, paren(opt(property_actual_arg))),
@ -843,7 +843,7 @@ pub fn property_list_of_arguments_named(s: Span) -> IResult<Span, PropertyListOf
}
#[parser]
pub fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
pub(crate) fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
alt((
map(property_expr, |x| {
PropertyActualArg::PropertyExpr(Box::new(x))
@ -855,7 +855,7 @@ pub fn property_actual_arg(s: Span) -> IResult<Span, PropertyActualArg> {
}
#[parser]
pub fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclaration> {
pub(crate) fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclaration> {
alt((
map(property_declaration, |x| {
AssertionItemDeclaration::PropertyDeclaration(Box::new(x))
@ -870,7 +870,7 @@ pub fn assertion_item_declaration(s: Span) -> IResult<Span, AssertionItemDeclara
}
#[parser]
pub fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
pub(crate) fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
let (s, a) = keyword("property")(s)?;
let (s, b) = property_identifier(s)?;
let (s, c) = opt(paren(opt(property_port_list)))(s)?;
@ -889,13 +889,13 @@ pub fn property_declaration(s: Span) -> IResult<Span, PropertyDeclaration> {
}
#[parser]
pub fn property_port_list(s: Span) -> IResult<Span, PropertyPortList> {
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)]
pub fn property_port_item(s: Span) -> IResult<Span, PropertyPortItem> {
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)?;
let (s, c) = ambiguous_opt(property_formal_type)(s)?;
@ -911,13 +911,13 @@ pub fn property_port_item(s: Span) -> IResult<Span, PropertyPortItem> {
}
#[parser]
pub fn property_lvar_port_direction(s: Span) -> IResult<Span, PropertyLvarPortDirection> {
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]
pub fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType> {
pub(crate) fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType> {
alt((
map(sequence_formal_type, |x| {
PropertyFormalType::SequenceFormalType(Box::new(x))
@ -929,7 +929,7 @@ pub fn property_formal_type(s: Span) -> IResult<Span, PropertyFormalType> {
}
#[parser(MaybeRecursive)]
pub fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
pub(crate) fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
let (s, a) = opt(clocking_event)(s)?;
let (s, b) = opt(triple(
keyword("disable"),
@ -941,7 +941,7 @@ pub fn property_spec(s: Span) -> IResult<Span, PropertySpec> {
}
#[parser]
pub fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
alt((
alt((
map(sequence_expr, |x| PropertyExpr::SequenceExpr(Box::new(x))),
@ -984,7 +984,7 @@ pub fn property_expr(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = keyword("strong")(s)?;
let (s, b) = paren(sequence_expr)(s)?;
Ok((
@ -994,7 +994,7 @@ pub fn property_expr_strong(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = keyword("weak")(s)?;
let (s, b) = paren(sequence_expr)(s)?;
Ok((
@ -1004,7 +1004,7 @@ pub fn property_expr_weak(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = paren(sequence_expr)(s)?;
Ok((
s,
@ -1013,7 +1013,7 @@ pub fn property_expr_paren(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = keyword("not")(s)?;
let (s, b) = property_expr(s)?;
Ok((
@ -1023,7 +1023,7 @@ pub fn property_expr_not(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = property_expr(s)?;
let (s, b) = keyword("or")(s)?;
let (s, c) = property_expr(s)?;
@ -1034,7 +1034,7 @@ pub fn property_expr_or(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = property_expr(s)?;
let (s, b) = keyword("and")(s)?;
let (s, c) = property_expr(s)?;
@ -1045,7 +1045,7 @@ pub fn property_expr_and(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = symbol("|->")(s)?;
let (s, c) = property_expr(s)?;
@ -1058,7 +1058,7 @@ pub fn property_expr_implication_overlapped(s: Span) -> IResult<Span, PropertyEx
}
#[parser(MaybeRecursive)]
pub fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = symbol("|=>")(s)?;
let (s, c) = property_expr(s)?;
@ -1071,7 +1071,7 @@ pub fn property_expr_implication_nonoverlapped(s: Span) -> IResult<Span, Propert
}
#[parser]
pub fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1085,7 +1085,7 @@ pub fn property_expr_if(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_case_item(s)?;
@ -1100,7 +1100,7 @@ pub fn property_expr_case(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = symbol("#-#")(s)?;
let (s, c) = property_expr(s)?;
@ -1113,7 +1113,7 @@ pub fn property_expr_followed_by_overlapped(s: Span) -> IResult<Span, PropertyEx
}
#[parser(MaybeRecursive)]
pub fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = symbol("#=#")(s)?;
let (s, c) = property_expr(s)?;
@ -1126,7 +1126,7 @@ pub fn property_expr_followed_by_nonoverlapped(s: Span) -> IResult<Span, Propert
}
#[parser]
pub fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1137,7 +1137,7 @@ pub fn property_expr_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1148,7 +1148,7 @@ pub fn property_expr_s_nexttime(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1159,7 +1159,7 @@ pub fn property_expr_always(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1170,7 +1170,7 @@ pub fn property_expr_s_always(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = keyword("eventually")(s)?;
let (s, b) = bracket(constant_range)(s)?;
let (s, c) = property_expr(s)?;
@ -1181,7 +1181,7 @@ pub fn property_expr_eventually(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1192,7 +1192,7 @@ pub fn property_expr_s_eventually(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = property_expr(s)?;
let (s, b) = keyword("until")(s)?;
let (s, c) = property_expr(s)?;
@ -1203,7 +1203,7 @@ pub fn property_expr_until(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1214,7 +1214,7 @@ pub fn property_expr_s_until(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1225,7 +1225,7 @@ pub fn property_expr_until_with(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1236,7 +1236,7 @@ pub fn property_expr_s_until_with(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = property_expr(s)?;
let (s, b) = keyword("implies")(s)?;
let (s, c) = property_expr(s)?;
@ -1247,7 +1247,7 @@ pub fn property_expr_implies(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser(MaybeRecursive)]
pub fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = property_expr(s)?;
let (s, b) = keyword("iff")(s)?;
let (s, c) = property_expr(s)?;
@ -1258,7 +1258,7 @@ pub fn property_expr_iff(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1269,7 +1269,7 @@ pub fn property_expr_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1280,7 +1280,7 @@ pub fn property_expr_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1291,7 +1291,7 @@ pub fn property_expr_sync_accept_on(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
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)?;
let (s, c) = property_expr(s)?;
@ -1302,7 +1302,7 @@ pub fn property_expr_sync_reject_on(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
pub(crate) fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
let (s, a) = clocking_event(s)?;
let (s, b) = property_expr(s)?;
Ok((
@ -1312,12 +1312,12 @@ pub fn property_expr_clocking_event(s: Span) -> IResult<Span, PropertyExpr> {
}
#[parser]
pub fn property_case_item(s: Span) -> IResult<Span, PropertyCaseItem> {
pub(crate) fn property_case_item(s: Span) -> IResult<Span, PropertyCaseItem> {
alt((property_case_item_nondefault, property_case_item_default))(s)
}
#[parser(MaybeRecursive)]
pub fn property_case_item_nondefault(s: Span) -> IResult<Span, PropertyCaseItem> {
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)?;
let (s, c) = property_expr(s)?;
@ -1331,7 +1331,7 @@ pub fn property_case_item_nondefault(s: Span) -> IResult<Span, PropertyCaseItem>
}
#[parser]
pub fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
pub(crate) fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
let (s, a) = keyword("default")(s)?;
let (s, b) = opt(symbol(":"))(s)?;
let (s, c) = property_expr(s)?;
@ -1345,7 +1345,7 @@ pub fn property_case_item_default(s: Span) -> IResult<Span, PropertyCaseItem> {
}
#[parser]
pub fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
pub(crate) fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
let (s, a) = keyword("sequence")(s)?;
let (s, b) = sequence_identifier(s)?;
let (s, c) = opt(paren(opt(sequence_port_list)))(s)?;
@ -1364,13 +1364,13 @@ pub fn sequence_declaration(s: Span) -> IResult<Span, SequenceDeclaration> {
}
#[parser]
pub fn sequence_port_list(s: Span) -> IResult<Span, SequencePortList> {
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)]
pub fn sequence_port_item(s: Span) -> IResult<Span, SequencePortItem> {
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)?;
let (s, c) = ambiguous_opt(sequence_formal_type)(s)?;
@ -1386,7 +1386,7 @@ pub fn sequence_port_item(s: Span) -> IResult<Span, SequencePortItem> {
}
#[parser]
pub fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDirection> {
pub(crate) fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDirection> {
alt((
map(keyword("input"), |x| {
SequenceLvarPortDirection::Input(Box::new(x))
@ -1401,7 +1401,7 @@ pub fn sequence_lvar_port_direction(s: Span) -> IResult<Span, SequenceLvarPortDi
}
#[parser]
pub fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
pub(crate) fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
alt((
map(data_type_or_implicit, |x| {
SequenceFormalType::DataTypeOrImplicit(Box::new(x))
@ -1416,7 +1416,7 @@ pub fn sequence_formal_type(s: Span) -> IResult<Span, SequenceFormalType> {
}
#[parser]
pub fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
alt((
sequence_expr_cycle_delay_expr,
sequence_expr_expr_cycle_delay_expr,
@ -1434,7 +1434,7 @@ pub fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
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)?;
let (s, c) = many0(pair(cycle_delay_range, sequence_expr))(s)?;
@ -1445,7 +1445,7 @@ pub fn sequence_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExpr> {
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)?;
let (s, c) = sequence_expr(s)?;
@ -1459,7 +1459,7 @@ pub fn sequence_expr_expr_cycle_delay_expr(s: Span) -> IResult<Span, SequenceExp
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
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)?;
Ok((
@ -1469,7 +1469,7 @@ pub fn sequence_expr_expression(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = sequence_instance(s)?;
let (s, b) = opt(sequence_abbrev)(s)?;
Ok((
@ -1479,7 +1479,7 @@ pub fn sequence_expr_instance(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = paren(pair(
sequence_expr,
many0(pair(symbol(","), sequence_match_item)),
@ -1492,7 +1492,7 @@ pub fn sequence_expr_paren(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = keyword("and")(s)?;
let (s, c) = sequence_expr(s)?;
@ -1503,7 +1503,7 @@ pub fn sequence_expr_and(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = keyword("intersect")(s)?;
let (s, c) = sequence_expr(s)?;
@ -1514,7 +1514,7 @@ pub fn sequence_expr_intersect(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = keyword("or")(s)?;
let (s, c) = sequence_expr(s)?;
@ -1525,7 +1525,7 @@ pub fn sequence_expr_or(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = keyword("first_match")(s)?;
let (s, b) = paren(pair(
sequence_expr,
@ -1538,7 +1538,7 @@ pub fn sequence_expr_first_match(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = expression_or_dist(s)?;
let (s, b) = keyword("throughout")(s)?;
let (s, c) = sequence_expr(s)?;
@ -1549,7 +1549,7 @@ pub fn sequence_expr_throughout(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser(MaybeRecursive)]
pub fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = sequence_expr(s)?;
let (s, b) = keyword("within")(s)?;
let (s, c) = sequence_expr(s)?;
@ -1560,7 +1560,7 @@ pub fn sequence_expr_within(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
pub(crate) fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
let (s, a) = clocking_event(s)?;
let (s, b) = sequence_expr(s)?;
Ok((
@ -1570,7 +1570,7 @@ pub fn sequence_expr_clocking_event(s: Span) -> IResult<Span, SequenceExpr> {
}
#[parser]
pub fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
pub(crate) fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
alt((
cycle_delay_range_primary,
cycle_delay_range_expression,
@ -1580,7 +1580,7 @@ pub fn cycle_delay_range(s: Span) -> IResult<Span, CycleDelayRange> {
}
#[parser]
pub fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
pub(crate) fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
let (s, a) = symbol("##")(s)?;
let (s, b) = constant_primary(s)?;
Ok((
@ -1590,7 +1590,7 @@ pub fn cycle_delay_range_primary(s: Span) -> IResult<Span, CycleDelayRange> {
}
#[parser]
pub fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayRange> {
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)?;
Ok((
@ -1600,7 +1600,7 @@ pub fn cycle_delay_range_expression(s: Span) -> IResult<Span, CycleDelayRange> {
}
#[parser]
pub fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
pub(crate) fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
let (s, a) = symbol("##")(s)?;
let (s, b) = bracket(symbol("*"))(s)?;
Ok((
@ -1610,7 +1610,7 @@ pub fn cycle_delay_range_asterisk(s: Span) -> IResult<Span, CycleDelayRange> {
}
#[parser]
pub fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
pub(crate) fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
let (s, a) = symbol("##")(s)?;
let (s, b) = bracket(symbol("+"))(s)?;
Ok((
@ -1620,7 +1620,7 @@ pub fn cycle_delay_range_plus(s: Span) -> IResult<Span, CycleDelayRange> {
}
#[parser]
pub fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
pub(crate) fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
let (s, a) = sequence_instance(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = method_identifier(s)?;
@ -1628,7 +1628,7 @@ pub fn sequence_method_call(s: Span) -> IResult<Span, SequenceMethodCall> {
}
#[parser]
pub fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
pub(crate) fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
alt((
map(operator_assignment, |x| {
SequenceMatchItem::OperatorAssignment(Box::new(x))
@ -1643,14 +1643,14 @@ pub fn sequence_match_item(s: Span) -> IResult<Span, SequenceMatchItem> {
}
#[parser]
pub fn sequence_instance(s: Span) -> IResult<Span, SequenceInstance> {
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]
pub fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListOfArguments> {
pub(crate) fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListOfArguments> {
alt((
sequence_list_of_arguments_ordered,
sequence_list_of_arguments_named,
@ -1658,7 +1658,7 @@ pub fn sequence_list_of_arguments(s: Span) -> IResult<Span, SequenceListOfArgume
}
#[parser(MaybeRecursive)]
pub fn sequence_list_of_arguments_ordered(s: Span) -> IResult<Span, SequenceListOfArguments> {
pub(crate) fn sequence_list_of_arguments_ordered(s: Span) -> IResult<Span, SequenceListOfArguments> {
let (s, a) = list(symbol(","), opt(sequence_actual_arg))(s)?;
let (s, b) = many0(tuple((
symbol(","),
@ -1675,7 +1675,7 @@ pub fn sequence_list_of_arguments_ordered(s: Span) -> IResult<Span, SequenceList
}
#[parser]
pub fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, SequenceListOfArguments> {
pub(crate) fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, SequenceListOfArguments> {
let (s, a) = list(
symbol(","),
triple(symbol("."), identifier, paren(opt(sequence_actual_arg))),
@ -1687,7 +1687,7 @@ pub fn sequence_list_of_arguments_named(s: Span) -> IResult<Span, SequenceListOf
}
#[parser]
pub fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
pub(crate) fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
alt((
map(event_expression, |x| {
SequenceActualArg::EventExpression(Box::new(x))
@ -1699,7 +1699,7 @@ pub fn sequence_actual_arg(s: Span) -> IResult<Span, SequenceActualArg> {
}
#[parser]
pub fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
pub(crate) fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
alt((
map(consecutive_repetition, |x| {
BooleanAbbrev::ConsecutiveRepetition(Box::new(x))
@ -1714,13 +1714,13 @@ pub fn boolean_abbrev(s: Span) -> IResult<Span, BooleanAbbrev> {
}
#[parser]
pub fn sequence_abbrev(s: Span) -> IResult<Span, SequenceAbbrev> {
pub(crate) fn sequence_abbrev(s: Span) -> IResult<Span, SequenceAbbrev> {
let (s, a) = consecutive_repetition(s)?;
Ok((s, SequenceAbbrev { nodes: (a,) }))
}
#[parser]
pub fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
pub(crate) fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
alt((
consecutive_repetition_expression,
consecutive_repetition_asterisk,
@ -1729,7 +1729,7 @@ pub fn consecutive_repetition(s: Span) -> IResult<Span, ConsecutiveRepetition> {
}
#[parser]
pub fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRepetition> {
pub(crate) fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRepetition> {
let (s, a) = bracket(pair(symbol("*"), const_or_range_expression))(s)?;
Ok((
s,
@ -1740,7 +1740,7 @@ pub fn consecutive_repetition_expression(s: Span) -> IResult<Span, ConsecutiveRe
}
#[parser]
pub fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepetition> {
pub(crate) fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepetition> {
let (s, a) = bracket(symbol("*"))(s)?;
Ok((
s,
@ -1749,7 +1749,7 @@ pub fn consecutive_repetition_asterisk(s: Span) -> IResult<Span, ConsecutiveRepe
}
#[parser]
pub fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetition> {
pub(crate) fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetition> {
let (s, a) = bracket(symbol("+"))(s)?;
Ok((
s,
@ -1758,19 +1758,19 @@ pub fn consecutive_repetition_plus(s: Span) -> IResult<Span, ConsecutiveRepetiti
}
#[parser]
pub fn non_consecutive_repetition(s: Span) -> IResult<Span, NonConsecutiveRepetition> {
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]
pub fn goto_repetition(s: Span) -> IResult<Span, GotoRepetition> {
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]
pub fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeExpression> {
pub(crate) fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeExpression> {
alt((
map(constant_expression, |x| {
ConstOrRangeExpression::ConstantExpression(Box::new(x))
@ -1782,7 +1782,7 @@ pub fn const_or_range_expression(s: Span) -> IResult<Span, ConstOrRangeExpressio
}
#[parser]
pub fn cycle_delay_const_range_expression(
pub(crate) fn cycle_delay_const_range_expression(
s: Span,
) -> IResult<Span, CycleDelayConstRangeExpression> {
alt((
@ -1792,7 +1792,7 @@ pub fn cycle_delay_const_range_expression(
}
#[parser(MaybeRecursive)]
pub fn cycle_delay_const_range_expression_binary(
pub(crate) fn cycle_delay_const_range_expression_binary(
s: Span,
) -> IResult<Span, CycleDelayConstRangeExpression> {
let (s, a) = constant_expression(s)?;
@ -1807,7 +1807,7 @@ pub fn cycle_delay_const_range_expression_binary(
}
#[parser(MaybeRecursive)]
pub fn cycle_delay_const_range_expression_dollar(
pub(crate) fn cycle_delay_const_range_expression_dollar(
s: Span,
) -> IResult<Span, CycleDelayConstRangeExpression> {
let (s, a) = constant_expression(s)?;
@ -1822,14 +1822,14 @@ pub fn cycle_delay_const_range_expression_dollar(
}
#[parser(MaybeRecursive)]
pub fn expression_or_dist(s: Span) -> IResult<Span, ExpressionOrDist> {
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]
pub fn assertion_variable_declaration(s: Span) -> IResult<Span, AssertionVariableDeclaration> {
pub(crate) fn assertion_variable_declaration(s: Span) -> IResult<Span, AssertionVariableDeclaration> {
let (s, a) = var_data_type(s)?;
let (s, b) = list_of_variable_decl_assignments(s)?;
let (s, c) = symbol(";")(s)?;

View File

@ -37,7 +37,7 @@ pub struct BlockItemDeclarationLet {
// -----------------------------------------------------------------------------
#[parser]
pub fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
pub(crate) fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
alt((
block_item_declaration_data,
block_item_declaration_local_parameter,
@ -47,7 +47,7 @@ pub fn block_item_declaration(s: Span) -> IResult<Span, BlockItemDeclaration> {
}
#[parser(MaybeRecursive)]
pub fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDeclaration> {
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)?;
Ok((
@ -57,7 +57,7 @@ pub fn block_item_declaration_data(s: Span) -> IResult<Span, BlockItemDeclaratio
}
#[parser]
pub fn block_item_declaration_local_parameter(s: Span) -> IResult<Span, BlockItemDeclaration> {
pub(crate) fn block_item_declaration_local_parameter(s: Span) -> IResult<Span, BlockItemDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = local_parameter_declaration(s)?;
let (s, c) = symbol(";")(s)?;
@ -70,7 +70,7 @@ pub fn block_item_declaration_local_parameter(s: Span) -> IResult<Span, BlockIte
}
#[parser]
pub fn block_item_declaration_parameter(s: Span) -> IResult<Span, BlockItemDeclaration> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -83,7 +83,7 @@ pub fn block_item_declaration_parameter(s: Span) -> IResult<Span, BlockItemDecla
}
#[parser]
pub fn block_item_declaration_let(s: Span) -> IResult<Span, BlockItemDeclaration> {
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)?;
Ok((

View File

@ -476,7 +476,7 @@ pub struct CovergroupExpression {
// -----------------------------------------------------------------------------
#[parser]
pub fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
pub(crate) fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
let (s, a) = keyword("covergroup")(s)?;
let (s, b) = covergroup_identifier(s)?;
let (s, c) = opt(paren(opt(tf_port_list)))(s)?;
@ -494,12 +494,12 @@ pub fn covergroup_declaration(s: Span) -> IResult<Span, CovergroupDeclaration> {
}
#[parser]
pub fn coverage_spec_or_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
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]
pub fn coverage_spec_or_option_spec(s: Span) -> IResult<Span, CoverageSpecOrOption> {
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)?;
Ok((
@ -509,7 +509,7 @@ pub fn coverage_spec_or_option_spec(s: Span) -> IResult<Span, CoverageSpecOrOpti
}
#[parser]
pub fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageSpecOrOption> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -520,12 +520,12 @@ pub fn coverage_spec_or_option_option(s: Span) -> IResult<Span, CoverageSpecOrOp
}
#[parser]
pub fn coverage_option(s: Span) -> IResult<Span, CoverageOption> {
pub(crate) fn coverage_option(s: Span) -> IResult<Span, CoverageOption> {
alt((coverage_option_option, coverage_option_type_option))(s)
}
#[parser]
pub fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
pub(crate) fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
let (s, a) = keyword("option")(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = member_identifier(s)?;
@ -540,7 +540,7 @@ pub fn coverage_option_option(s: Span) -> IResult<Span, CoverageOption> {
}
#[parser]
pub fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
pub(crate) fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
let (s, a) = keyword("type_option")(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = member_identifier(s)?;
@ -555,7 +555,7 @@ pub fn coverage_option_type_option(s: Span) -> IResult<Span, CoverageOption> {
}
#[parser]
pub fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
pub(crate) fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
alt((
map(cover_point, |x| CoverageSpec::CoverPoint(Box::new(x))),
map(cover_cross, |x| CoverageSpec::CoverCross(Box::new(x))),
@ -563,7 +563,7 @@ pub fn coverage_spec(s: Span) -> IResult<Span, CoverageSpec> {
}
#[parser]
pub fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
pub(crate) fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
alt((
map(clocking_event, |x| {
CoverageEvent::ClockingEvent(Box::new(x))
@ -574,7 +574,7 @@ pub fn coverage_event(s: Span) -> IResult<Span, CoverageEvent> {
}
#[parser]
pub fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
pub(crate) fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
let (s, a) = keyword("with")(s)?;
let (s, b) = keyword("function")(s)?;
let (s, c) = keyword("sample")(s)?;
@ -588,7 +588,7 @@ pub fn coverage_event_sample(s: Span) -> IResult<Span, CoverageEvent> {
}
#[parser]
pub fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
pub(crate) fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
let (s, a) = symbol("@@")(s)?;
let (s, b) = paren(block_event_expression)(s)?;
Ok((
@ -598,7 +598,7 @@ pub fn coverage_event_at(s: Span) -> IResult<Span, CoverageEvent> {
}
#[parser]
pub fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
pub(crate) fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
alt((
block_event_expression_or,
block_event_expression_begin,
@ -607,7 +607,7 @@ pub fn block_event_expression(s: Span) -> IResult<Span, BlockEventExpression> {
}
#[parser(MaybeRecursive)]
pub fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpression> {
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)?;
let (s, c) = block_event_expression(s)?;
@ -618,7 +618,7 @@ pub fn block_event_expression_or(s: Span) -> IResult<Span, BlockEventExpression>
}
#[parser]
pub fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventExpression> {
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)?;
Ok((
@ -628,7 +628,7 @@ pub fn block_event_expression_begin(s: Span) -> IResult<Span, BlockEventExpressi
}
#[parser]
pub fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExpression> {
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)?;
Ok((
@ -638,7 +638,7 @@ pub fn block_event_expression_end(s: Span) -> IResult<Span, BlockEventExpression
}
#[parser]
pub fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
pub(crate) fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
alt((
map(hierarchical_tf_identifier, |x| {
HierarchicalBtfIdentifier::HierarchicalTfIdentifier(Box::new(x))
@ -651,7 +651,7 @@ pub fn hierarchical_btf_identifier(s: Span) -> IResult<Span, HierarchicalBtfIden
}
#[parser]
pub fn hierarchical_btf_identifier_method(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
pub(crate) fn hierarchical_btf_identifier_method(s: Span) -> IResult<Span, HierarchicalBtfIdentifier> {
let (s, a) = opt(hierarchical_identifier_or_class_scope)(s)?;
let (s, b) = method_identifier(s)?;
Ok((
@ -663,7 +663,7 @@ pub fn hierarchical_btf_identifier_method(s: Span) -> IResult<Span, Hierarchical
}
#[parser]
pub fn hierarchical_identifier_or_class_scope(
pub(crate) fn hierarchical_identifier_or_class_scope(
s: Span,
) -> IResult<Span, HierarchicalIdentifierOrClassScope> {
alt((
@ -677,7 +677,7 @@ pub fn hierarchical_identifier_or_class_scope(
}
#[parser(Ambiguous)]
pub fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
pub(crate) fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
let (s, a) = opt(triple(
ambiguous_opt(data_type_or_implicit),
cover_point_identifier,
@ -696,7 +696,7 @@ pub fn cover_point(s: Span) -> IResult<Span, CoverPoint> {
}
#[parser]
pub fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
pub(crate) fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
alt((
bins_or_empty_non_empty,
map(symbol(";"), |x| BinsOrEmpty::Empty(Box::new(x))),
@ -704,7 +704,7 @@ pub fn bins_or_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
}
#[parser]
pub fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
pub(crate) fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
let (s, a) = brace(pair(
many0(attribute_instance),
many0(pair(bins_or_options, symbol(";"))),
@ -716,7 +716,7 @@ pub fn bins_or_empty_non_empty(s: Span) -> IResult<Span, BinsOrEmpty> {
}
#[parser]
pub fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
pub(crate) fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
alt((
map(coverage_option, |x| {
BinsOrOptions::CoverageOption(Box::new(x))
@ -731,7 +731,7 @@ pub fn bins_or_options(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
pub(crate) fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
let (s, a) = opt(wildcard)(s)?;
let (s, b) = bins_keyword(s)?;
let (s, c) = bin_identifier(s)?;
@ -749,13 +749,13 @@ pub fn bins_or_options_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn wildcard(s: Span) -> IResult<Span, Wildcard> {
pub(crate) fn wildcard(s: Span) -> IResult<Span, Wildcard> {
let (s, a) = keyword("wildcard")(s)?;
Ok((s, Wildcard { nodes: (a,) }))
}
#[parser]
pub fn bins_or_options_cover_point(s: Span) -> IResult<Span, BinsOrOptions> {
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)?;
let (s, c) = bin_identifier(s)?;
@ -774,7 +774,7 @@ pub fn bins_or_options_cover_point(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
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)?;
let (s, c) = bin_identifier(s)?;
@ -791,7 +791,7 @@ pub fn bins_or_options_set_covergroup(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions> {
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)?;
let (s, c) = bin_identifier(s)?;
@ -808,7 +808,7 @@ pub fn bins_or_options_trans_list(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
pub(crate) fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
let (s, a) = bins_keyword(s)?;
let (s, b) = bin_identifier(s)?;
let (s, c) = opt(bracket(opt(covergroup_expression)))(s)?;
@ -824,7 +824,7 @@ pub fn bins_or_options_default(s: Span) -> IResult<Span, BinsOrOptions> {
}
#[parser]
pub fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrOptions> {
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)?;
let (s, c) = symbol("=")(s)?;
@ -840,7 +840,7 @@ pub fn bins_or_options_default_sequence(s: Span) -> IResult<Span, BinsOrOptions>
}
#[parser]
pub fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
pub(crate) fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
alt((
map(keyword("bins"), |x| BinsKeyword::Bins(Box::new(x))),
map(keyword("illegal_bins"), |x| {
@ -853,19 +853,19 @@ pub fn bins_keyword(s: Span) -> IResult<Span, BinsKeyword> {
}
#[parser]
pub fn trans_list(s: Span) -> IResult<Span, TransList> {
pub(crate) fn trans_list(s: Span) -> IResult<Span, TransList> {
let (s, a) = list(symbol(","), paren(trans_set))(s)?;
Ok((s, TransList { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn trans_set(s: Span) -> IResult<Span, TransSet> {
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]
pub fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
pub(crate) fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
alt((
map(trans_item, |x| TransRangeList::TransItem(Box::new(x))),
trans_range_list_asterisk,
@ -875,7 +875,7 @@ pub fn trans_range_list(s: Span) -> IResult<Span, TransRangeList> {
}
#[parser(MaybeRecursive)]
pub fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList> {
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)?;
Ok((
@ -885,7 +885,7 @@ pub fn trans_range_list_asterisk(s: Span) -> IResult<Span, TransRangeList> {
}
#[parser(MaybeRecursive)]
pub fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
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)?;
Ok((
@ -895,7 +895,7 @@ pub fn trans_range_list_arrow(s: Span) -> IResult<Span, TransRangeList> {
}
#[parser(MaybeRecursive)]
pub fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
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)?;
Ok((
@ -905,13 +905,13 @@ pub fn trans_range_list_equal(s: Span) -> IResult<Span, TransRangeList> {
}
#[parser]
pub fn trans_item(s: Span) -> IResult<Span, TransItem> {
pub(crate) fn trans_item(s: Span) -> IResult<Span, TransItem> {
let (s, a) = covergroup_range_list(s)?;
Ok((s, TransItem { nodes: (a,) }))
}
#[parser]
pub fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
pub(crate) fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
alt((
map(covergroup_expression, |x| {
RepeatRange::CovergroupExpression(Box::new(x))
@ -921,7 +921,7 @@ pub fn repeat_range(s: Span) -> IResult<Span, RepeatRange> {
}
#[parser(MaybeRecursive)]
pub fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
pub(crate) fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
let (s, a) = covergroup_expression(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = covergroup_expression(s)?;
@ -932,7 +932,7 @@ pub fn repeat_range_binary(s: Span) -> IResult<Span, RepeatRange> {
}
#[parser]
pub fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
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)?;
let (s, c) = list_of_cross_items(s)?;
@ -947,14 +947,14 @@ pub fn cover_cross(s: Span) -> IResult<Span, CoverCross> {
}
#[parser]
pub fn list_of_cross_items(s: Span) -> IResult<Span, ListOfCrossItems> {
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]
pub fn cross_item(s: Span) -> IResult<Span, CrossItem> {
pub(crate) fn cross_item(s: Span) -> IResult<Span, CrossItem> {
alt((
map(cover_point_identifier, |x| {
CrossItem::CoverPointIdentifier(Box::new(x))
@ -966,7 +966,7 @@ pub fn cross_item(s: Span) -> IResult<Span, CrossItem> {
}
#[parser]
pub fn cross_body(s: Span) -> IResult<Span, CrossBody> {
pub(crate) fn cross_body(s: Span) -> IResult<Span, CrossBody> {
alt((
cross_body_non_empty,
map(symbol(";"), |x| CrossBody::Empty(Box::new(x))),
@ -974,7 +974,7 @@ pub fn cross_body(s: Span) -> IResult<Span, CrossBody> {
}
#[parser]
pub fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
pub(crate) fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
let (s, a) = brace(many0(pair(cross_body_item, symbol(";"))))(s)?;
Ok((
s,
@ -983,7 +983,7 @@ pub fn cross_body_non_empty(s: Span) -> IResult<Span, CrossBody> {
}
#[parser]
pub fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
pub(crate) fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
alt((
map(function_declaration, |x| {
CrossBodyItem::FunctionDeclaration(Box::new(x))
@ -995,7 +995,7 @@ pub fn cross_body_item(s: Span) -> IResult<Span, CrossBodyItem> {
}
#[parser]
pub fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption> {
pub(crate) fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption> {
alt((
bins_selection_or_option_coverage,
bins_selection_or_option_bins,
@ -1003,7 +1003,7 @@ pub fn bins_selection_or_option(s: Span) -> IResult<Span, BinsSelectionOrOption>
}
#[parser]
pub fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSelectionOrOption> {
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)?;
Ok((
@ -1013,7 +1013,7 @@ pub fn bins_selection_or_option_coverage(s: Span) -> IResult<Span, BinsSelection
}
#[parser]
pub fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelectionOrOption> {
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)?;
Ok((
@ -1023,7 +1023,7 @@ pub fn bins_selection_or_option_bins(s: Span) -> IResult<Span, BinsSelectionOrOp
}
#[parser]
pub fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
pub(crate) fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
let (s, a) = bins_keyword(s)?;
let (s, b) = bin_identifier(s)?;
let (s, c) = symbol("=")(s)?;
@ -1038,7 +1038,7 @@ pub fn bins_selection(s: Span) -> IResult<Span, BinsSelection> {
}
#[parser]
pub fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
alt((
map(select_condition, |x| {
SelectExpression::SelectCondition(Box::new(x))
@ -1056,7 +1056,7 @@ pub fn select_expression(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser]
pub fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = symbol("!")(s)?;
let (s, b) = select_condition(s)?;
Ok((
@ -1066,7 +1066,7 @@ pub fn select_expression_not(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser(MaybeRecursive)]
pub fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = select_expression(s)?;
let (s, b) = symbol("&&")(s)?;
let (s, c) = select_expression(s)?;
@ -1077,7 +1077,7 @@ pub fn select_expression_and(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser(MaybeRecursive)]
pub fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = select_expression(s)?;
let (s, b) = symbol("||")(s)?;
let (s, c) = select_expression(s)?;
@ -1088,7 +1088,7 @@ pub fn select_expression_or(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser]
pub fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = paren(select_expression)(s)?;
Ok((
s,
@ -1097,7 +1097,7 @@ pub fn select_expression_paren(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser(MaybeRecursive)]
pub fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
pub(crate) fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
let (s, a) = select_expression(s)?;
let (s, b) = keyword("with")(s)?;
let (s, c) = paren(with_covergroup_expression)(s)?;
@ -1111,7 +1111,7 @@ pub fn select_expression_with(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser(MaybeRecursive)]
pub fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpression> {
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)?;
Ok((
@ -1121,7 +1121,7 @@ pub fn select_expression_cross_set(s: Span) -> IResult<Span, SelectExpression> {
}
#[parser]
pub fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
pub(crate) fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
let (s, a) = keyword("binsof")(s)?;
let (s, b) = paren(bins_expression)(s)?;
let (s, c) = opt(pair(keyword("intersect"), brace(covergroup_range_list)))(s)?;
@ -1129,7 +1129,7 @@ pub fn select_condition(s: Span) -> IResult<Span, SelectCondition> {
}
#[parser]
pub fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
pub(crate) fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
alt((
map(variable_identifier, |x| {
BinsExpression::VariableIdentifier(Box::new(x))
@ -1139,7 +1139,7 @@ pub fn bins_expression(s: Span) -> IResult<Span, BinsExpression> {
}
#[parser]
pub fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpression> {
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)?;
Ok((
@ -1149,13 +1149,13 @@ pub fn bins_expression_cover_point(s: Span) -> IResult<Span, BinsExpression> {
}
#[parser(MaybeRecursive)]
pub fn covergroup_range_list(s: Span) -> IResult<Span, CovergroupRangeList> {
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]
pub fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRange> {
pub(crate) fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRange> {
alt((
map(covergroup_expression, |x| {
CovergroupValueRange::CovergroupExpression(Box::new(x))
@ -1165,7 +1165,7 @@ pub fn covergroup_value_range(s: Span) -> IResult<Span, CovergroupValueRange> {
}
#[parser]
pub fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRange> {
pub(crate) fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRange> {
let (s, a) = bracket(triple(
covergroup_expression,
symbol(":"),
@ -1178,31 +1178,31 @@ pub fn covergroup_value_range_binary(s: Span) -> IResult<Span, CovergroupValueRa
}
#[parser]
pub fn with_covergroup_expression(s: Span) -> IResult<Span, WithCovergroupExpression> {
pub(crate) fn with_covergroup_expression(s: Span) -> IResult<Span, WithCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, WithCovergroupExpression { nodes: (a,) }))
}
#[parser]
pub fn set_covergroup_expression(s: Span) -> IResult<Span, SetCovergroupExpression> {
pub(crate) fn set_covergroup_expression(s: Span) -> IResult<Span, SetCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, SetCovergroupExpression { nodes: (a,) }))
}
#[parser]
pub fn integer_covergroup_expression(s: Span) -> IResult<Span, IntegerCovergroupExpression> {
pub(crate) fn integer_covergroup_expression(s: Span) -> IResult<Span, IntegerCovergroupExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, IntegerCovergroupExpression { nodes: (a,) }))
}
#[parser]
pub fn cross_set_expression(s: Span) -> IResult<Span, CrossSetExpression> {
pub(crate) fn cross_set_expression(s: Span) -> IResult<Span, CrossSetExpression> {
let (s, a) = covergroup_expression(s)?;
Ok((s, CrossSetExpression { nodes: (a,) }))
}
#[parser]
pub fn covergroup_expression(s: Span) -> IResult<Span, CovergroupExpression> {
pub(crate) fn covergroup_expression(s: Span) -> IResult<Span, CovergroupExpression> {
let (s, a) = expression(s)?;
Ok((s, CovergroupExpression { nodes: (a,) }))
}

View File

@ -148,7 +148,7 @@ pub struct DynamicArrayNew {
// -----------------------------------------------------------------------------
#[parser]
pub fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
pub(crate) fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
let (s, a) = hierarchical_parameter_identifier(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = constant_mintypmax_expression(s)?;
@ -156,7 +156,7 @@ pub fn defparam_assignment(s: Span) -> IResult<Span, DefparamAssignment> {
}
#[parser]
pub fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
pub(crate) fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
let (s, a) = net_identifier(s)?;
let (s, b) = many0(unpacked_dimension)(s)?;
let (s, c) = opt(pair(symbol("="), expression))(s)?;
@ -164,7 +164,7 @@ pub fn net_decl_assignment(s: Span) -> IResult<Span, NetDeclAssignment> {
}
#[parser]
pub fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
pub(crate) fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
let (s, a) = parameter_identifier(s)?;
let (s, b) = many0(unpacked_dimension)(s)?;
let (s, c) = opt(pair(symbol("="), constant_param_expression))(s)?;
@ -172,7 +172,7 @@ pub fn param_assignment(s: Span) -> IResult<Span, ParamAssignment> {
}
#[parser]
pub fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
pub(crate) fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
alt((
specparam_assignment_mintypmax,
map(pulse_control_specparam, |x| {
@ -182,7 +182,7 @@ pub fn specparam_assignment(s: Span) -> IResult<Span, SpecparamAssignment> {
}
#[parser]
pub fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignment> {
pub(crate) fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignment> {
let (s, a) = specparam_identifier(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = constant_mintypmax_expression(s)?;
@ -193,14 +193,14 @@ pub fn specparam_assignment_mintypmax(s: Span) -> IResult<Span, SpecparamAssignm
}
#[parser]
pub fn type_assignment(s: Span) -> IResult<Span, TypeAssignment> {
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]
pub fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpecparam> {
pub(crate) fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpecparam> {
alt((
pulse_control_specparam_without_descriptor,
pulse_control_specparam_with_descriptor,
@ -208,7 +208,7 @@ pub fn pulse_control_specparam(s: Span) -> IResult<Span, PulseControlSpecparam>
}
#[parser]
pub fn pulse_control_specparam_without_descriptor(s: Span) -> IResult<Span, PulseControlSpecparam> {
pub(crate) fn pulse_control_specparam_without_descriptor(s: Span) -> IResult<Span, PulseControlSpecparam> {
let (s, a) = symbol("PATHPULSE$")(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = paren(pair(
@ -224,7 +224,7 @@ pub fn pulse_control_specparam_without_descriptor(s: Span) -> IResult<Span, Puls
}
#[parser]
pub fn pulse_control_specparam_with_descriptor(s: Span) -> IResult<Span, PulseControlSpecparam> {
pub(crate) fn pulse_control_specparam_with_descriptor(s: Span) -> IResult<Span, PulseControlSpecparam> {
let (s, a) = symbol("PATHPULSE$")(s)?;
let (s, b) = specify_input_terminal_descriptor(s)?;
let (s, c) = symbol("$")(s)?;
@ -243,25 +243,25 @@ pub fn pulse_control_specparam_with_descriptor(s: Span) -> IResult<Span, PulseCo
}
#[parser]
pub fn error_limit_value(s: Span) -> IResult<Span, ErrorLimitValue> {
pub(crate) fn error_limit_value(s: Span) -> IResult<Span, ErrorLimitValue> {
let (s, a) = limit_value(s)?;
Ok((s, ErrorLimitValue { nodes: (a,) }))
}
#[parser]
pub fn reject_limit_value(s: Span) -> IResult<Span, RejectLimitValue> {
pub(crate) fn reject_limit_value(s: Span) -> IResult<Span, RejectLimitValue> {
let (s, a) = limit_value(s)?;
Ok((s, RejectLimitValue { nodes: (a,) }))
}
#[parser]
pub fn limit_value(s: Span) -> IResult<Span, LimitValue> {
pub(crate) fn limit_value(s: Span) -> IResult<Span, LimitValue> {
let (s, a) = constant_mintypmax_expression(s)?;
Ok((s, LimitValue { nodes: (a,) }))
}
#[parser]
pub fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment> {
pub(crate) fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment> {
alt((
variable_decl_assignment_variable,
variable_decl_assignment_dynamic_array,
@ -270,7 +270,7 @@ pub fn variable_decl_assignment(s: Span) -> IResult<Span, VariableDeclAssignment
}
#[parser]
pub fn variable_decl_assignment_variable(s: Span) -> IResult<Span, VariableDeclAssignment> {
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)?;
let (s, c) = opt(pair(symbol("="), expression))(s)?;
@ -283,7 +283,7 @@ pub fn variable_decl_assignment_variable(s: Span) -> IResult<Span, VariableDeclA
}
#[parser]
pub fn variable_decl_assignment_dynamic_array(s: Span) -> IResult<Span, VariableDeclAssignment> {
pub(crate) fn variable_decl_assignment_dynamic_array(s: Span) -> IResult<Span, VariableDeclAssignment> {
let (s, a) = dynamic_array_variable_identifier(s)?;
let (s, b) = unsized_dimension(s)?;
let (s, c) = many0(variable_dimension)(s)?;
@ -297,7 +297,7 @@ pub fn variable_decl_assignment_dynamic_array(s: Span) -> IResult<Span, Variable
}
#[parser]
pub fn variable_decl_assignment_class(s: Span) -> IResult<Span, VariableDeclAssignment> {
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)?;
Ok((
@ -307,12 +307,12 @@ pub fn variable_decl_assignment_class(s: Span) -> IResult<Span, VariableDeclAssi
}
#[parser]
pub fn class_new(s: Span) -> IResult<Span, ClassNew> {
pub(crate) fn class_new(s: Span) -> IResult<Span, ClassNew> {
alt((class_new_argument, class_new_expression))(s)
}
#[parser]
pub fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
pub(crate) fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
let (s, a) = opt(class_scope)(s)?;
let (s, b) = keyword("new")(s)?;
let (s, c) = opt(paren(list_of_arguments))(s)?;
@ -323,7 +323,7 @@ pub fn class_new_argument(s: Span) -> IResult<Span, ClassNew> {
}
#[parser]
pub fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
pub(crate) fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
let (s, a) = keyword("new")(s)?;
let (s, b) = expression(s)?;
Ok((
@ -333,7 +333,7 @@ pub fn class_new_expression(s: Span) -> IResult<Span, ClassNew> {
}
#[parser]
pub fn dynamic_array_new(s: Span) -> IResult<Span, DynamicArrayNew> {
pub(crate) fn dynamic_array_new(s: Span) -> IResult<Span, DynamicArrayNew> {
let (s, a) = keyword("new")(s)?;
let (s, b) = bracket(expression)(s)?;
let (s, c) = opt(paren(expression))(s)?;

View File

@ -93,19 +93,19 @@ pub struct ListOfVariablePortIdentifiers {
// -----------------------------------------------------------------------------
#[parser]
pub fn list_of_defparam_assignments(s: Span) -> IResult<Span, ListOfDefparamAssignments> {
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]
pub fn list_of_genvar_identifiers(s: Span) -> IResult<Span, ListOfGenvarIdentifiers> {
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]
pub fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInterfaceIdentifiers> {
pub(crate) fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInterfaceIdentifiers> {
let (s, a) = list(
symbol(","),
pair(interface_identifier, many0(unpacked_dimension)),
@ -114,19 +114,19 @@ pub fn list_of_interface_identifiers(s: Span) -> IResult<Span, ListOfInterfaceId
}
#[parser]
pub fn list_of_net_decl_assignments(s: Span) -> IResult<Span, ListOfNetDeclAssignments> {
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]
pub fn list_of_param_assignments(s: Span) -> IResult<Span, ListOfParamAssignments> {
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]
pub fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdentifiers> {
pub(crate) fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdentifiers> {
let (s, a) = list(
symbol(","),
pair(port_identifier, many0(unpacked_dimension)),
@ -135,19 +135,19 @@ pub fn list_of_port_identifiers(s: Span) -> IResult<Span, ListOfPortIdentifiers>
}
#[parser]
pub fn list_of_udp_port_identifiers(s: Span) -> IResult<Span, ListOfUdpPortIdentifiers> {
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]
pub fn list_of_specparam_assignments(s: Span) -> IResult<Span, ListOfSpecparamAssignments> {
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]
pub fn list_of_tf_variable_identifiers(s: Span) -> IResult<Span, ListOfTfVariableIdentifiers> {
pub(crate) fn list_of_tf_variable_identifiers(s: Span) -> IResult<Span, ListOfTfVariableIdentifiers> {
let (s, a) = list(
symbol(","),
triple(
@ -160,19 +160,19 @@ pub fn list_of_tf_variable_identifiers(s: Span) -> IResult<Span, ListOfTfVariabl
}
#[parser]
pub fn list_of_type_assignments(s: Span) -> IResult<Span, ListOfTypeAssignments> {
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]
pub fn list_of_variable_decl_assignments(s: Span) -> IResult<Span, ListOfVariableDeclAssignments> {
pub(crate) fn list_of_variable_decl_assignments(s: Span) -> IResult<Span, ListOfVariableDeclAssignments> {
let (s, a) = list(symbol(","), variable_decl_assignment)(s)?;
Ok((s, ListOfVariableDeclAssignments { nodes: (a,) }))
}
#[parser]
pub fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVariableIdentifiers> {
pub(crate) fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVariableIdentifiers> {
let (s, a) = list(
symbol(","),
pair(variable_identifier, many0(variable_dimension)),
@ -181,7 +181,7 @@ pub fn list_of_variable_identifiers(s: Span) -> IResult<Span, ListOfVariableIden
}
#[parser]
pub fn list_of_variable_port_identifiers(s: Span) -> IResult<Span, ListOfVariablePortIdentifiers> {
pub(crate) fn list_of_variable_port_identifiers(s: Span) -> IResult<Span, ListOfVariablePortIdentifiers> {
let (s, a) = list(
symbol(","),
triple(

View File

@ -71,12 +71,12 @@ pub struct UnsizedDimension {
// -----------------------------------------------------------------------------
#[parser]
pub fn unpacked_dimension(s: Span) -> IResult<Span, UnpackedDimension> {
pub(crate) fn unpacked_dimension(s: Span) -> IResult<Span, UnpackedDimension> {
alt((unpacked_dimension_range, unpacked_dimension_expression))(s)
}
#[parser]
pub fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
pub(crate) fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
let (s, a) = bracket(constant_range)(s)?;
Ok((
s,
@ -85,7 +85,7 @@ pub fn unpacked_dimension_range(s: Span) -> IResult<Span, UnpackedDimension> {
}
#[parser]
pub fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension> {
pub(crate) fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension> {
let (s, a) = bracket(constant_expression)(s)?;
Ok((
s,
@ -94,7 +94,7 @@ pub fn unpacked_dimension_expression(s: Span) -> IResult<Span, UnpackedDimension
}
#[parser]
pub fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
pub(crate) fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
alt((
packed_dimension_range,
map(unsized_dimension, |x| {
@ -104,7 +104,7 @@ pub fn packed_dimension(s: Span) -> IResult<Span, PackedDimension> {
}
#[parser]
pub fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
pub(crate) fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
let (s, a) = bracket(constant_range)(s)?;
Ok((
s,
@ -113,7 +113,7 @@ pub fn packed_dimension_range(s: Span) -> IResult<Span, PackedDimension> {
}
#[parser]
pub fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
pub(crate) fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
alt((
associative_dimension_data_type,
associative_dimension_asterisk,
@ -121,7 +121,7 @@ pub fn associative_dimension(s: Span) -> IResult<Span, AssociativeDimension> {
}
#[parser]
pub fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDimension> {
pub(crate) fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDimension> {
let (s, a) = bracket(data_type)(s)?;
Ok((
s,
@ -130,7 +130,7 @@ pub fn associative_dimension_data_type(s: Span) -> IResult<Span, AssociativeDime
}
#[parser]
pub fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimension> {
pub(crate) fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimension> {
let (s, a) = bracket(symbol("*"))(s)?;
Ok((
s,
@ -139,7 +139,7 @@ pub fn associative_dimension_asterisk(s: Span) -> IResult<Span, AssociativeDimen
}
#[parser]
pub fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
pub(crate) fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
alt((
map(unsized_dimension, |x| {
VariableDimension::UnsizedDimension(Box::new(x))
@ -157,7 +157,7 @@ pub fn variable_dimension(s: Span) -> IResult<Span, VariableDimension> {
}
#[parser]
pub fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
pub(crate) fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
let (s, a) = bracket(pair(
symbol("$"),
opt(pair(symbol(":"), constant_expression)),
@ -166,7 +166,7 @@ pub fn queue_dimension(s: Span) -> IResult<Span, QueueDimension> {
}
#[parser]
pub fn unsized_dimension(s: Span) -> IResult<Span, UnsizedDimension> {
pub(crate) fn unsized_dimension(s: Span) -> IResult<Span, UnsizedDimension> {
let (s, a) = symbol("[")(s)?;
let (s, b) = symbol("]")(s)?;
Ok((s, UnsizedDimension { nodes: (a, b) }))

View File

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

View File

@ -156,7 +156,7 @@ pub struct DpiTaskProto {
// -----------------------------------------------------------------------------
#[parser]
pub fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataTypeOrImplicit> {
pub(crate) fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataTypeOrImplicit> {
alt((
map(data_type_or_void, |x| {
FunctionDataTypeOrImplicit::DataTypeOrVoid(Box::new(x))
@ -168,7 +168,7 @@ pub fn function_data_type_or_implicit(s: Span) -> IResult<Span, FunctionDataType
}
#[parser]
pub fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
pub(crate) fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
let (s, a) = keyword("function")(s)?;
let (s, b) = opt(lifetime)(s)?;
let (s, c) = function_body_declaration(s)?;
@ -176,7 +176,7 @@ pub fn function_declaration(s: Span) -> IResult<Span, FunctionDeclaration> {
}
#[parser]
pub fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
pub(crate) fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
alt((
function_body_declaration_without_port,
function_body_declaration_with_port,
@ -184,7 +184,7 @@ pub fn function_body_declaration(s: Span) -> IResult<Span, FunctionBodyDeclarati
}
#[parser(Ambiguous)]
pub fn function_body_declaration_without_port(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
pub(crate) fn function_body_declaration_without_port(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
let (s, a) = ambiguous_opt(function_data_type_or_implicit)(s)?;
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
let (s, c) = function_identifier(s)?;
@ -202,7 +202,7 @@ pub fn function_body_declaration_without_port(s: Span) -> IResult<Span, Function
}
#[parser(Ambiguous)]
pub fn function_body_declaration_with_port(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
pub(crate) fn function_body_declaration_with_port(s: Span) -> IResult<Span, FunctionBodyDeclaration> {
let (s, a) = ambiguous_opt(function_data_type_or_implicit)(s)?;
let (s, b) = opt(interface_identifier_or_class_scope)(s)?;
let (s, c) = function_identifier(s)?;
@ -221,7 +221,7 @@ pub fn function_body_declaration_with_port(s: Span) -> IResult<Span, FunctionBod
}
#[parser]
pub fn interface_identifier_or_class_scope(
pub(crate) fn interface_identifier_or_class_scope(
s: Span,
) -> IResult<Span, InterfaceIdentifierOrClassScope> {
alt((
@ -235,7 +235,7 @@ pub fn interface_identifier_or_class_scope(
}
#[parser]
pub fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
pub(crate) fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
let (s, a) = keyword("function")(s)?;
let (s, b) = data_type_or_void(s)?;
let (s, c) = function_identifier(s)?;
@ -249,7 +249,7 @@ pub fn function_prototype(s: Span) -> IResult<Span, FunctionPrototype> {
}
#[parser]
pub fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
pub(crate) fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
alt((
dpi_import_export_import_function,
dpi_import_export_import_task,
@ -259,7 +259,7 @@ pub fn dpi_import_export(s: Span) -> IResult<Span, DpiImportExport> {
}
#[parser]
pub fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImportExport> {
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)?;
let (s, c) = opt(dpi_function_import_property)(s)?;
@ -275,7 +275,7 @@ pub fn dpi_import_export_import_function(s: Span) -> IResult<Span, DpiImportExpo
}
#[parser]
pub fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportExport> {
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)?;
let (s, c) = opt(dpi_task_import_property)(s)?;
@ -291,7 +291,7 @@ pub fn dpi_import_export_import_task(s: Span) -> IResult<Span, DpiImportExport>
}
#[parser]
pub fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImportExport> {
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)?;
let (s, c) = opt(pair(c_identifier, symbol("=")))(s)?;
@ -307,7 +307,7 @@ pub fn dpi_import_export_export_function(s: Span) -> IResult<Span, DpiImportExpo
}
#[parser]
pub fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportExport> {
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)?;
let (s, c) = opt(pair(c_identifier, symbol("=")))(s)?;
@ -323,7 +323,7 @@ pub fn dpi_import_export_export_task(s: Span) -> IResult<Span, DpiImportExport>
}
#[parser]
pub fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
pub(crate) fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
alt((
map(keyword("DPI-C"), |x| DpiSpecString::DpiC(Box::new(x))),
map(keyword("DPI"), |x| DpiSpecString::Dpi(Box::new(x))),
@ -331,7 +331,7 @@ pub fn dpi_spec_string(s: Span) -> IResult<Span, DpiSpecString> {
}
#[parser]
pub fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportProperty> {
pub(crate) fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportProperty> {
alt((
map(keyword("context"), |x| {
DpiFunctionImportProperty::Context(Box::new(x))
@ -343,19 +343,19 @@ pub fn dpi_function_import_property(s: Span) -> IResult<Span, DpiFunctionImportP
}
#[parser]
pub fn dpi_task_import_property(s: Span) -> IResult<Span, DpiTaskImportProperty> {
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]
pub fn dpi_function_proto(s: Span) -> IResult<Span, DpiFunctionProto> {
pub(crate) fn dpi_function_proto(s: Span) -> IResult<Span, DpiFunctionProto> {
let (s, a) = function_prototype(s)?;
Ok((s, DpiFunctionProto { nodes: (a,) }))
}
#[parser]
pub fn dpi_task_proto(s: Span) -> IResult<Span, DpiTaskProto> {
pub(crate) fn dpi_task_proto(s: Span) -> IResult<Span, DpiTaskProto> {
let (s, a) = task_prototype(s)?;
Ok((s, DpiTaskProto { nodes: (a,) }))
}

View File

@ -88,7 +88,7 @@ pub enum ImportExport {
// -----------------------------------------------------------------------------
#[parser]
pub fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
pub(crate) fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
let (s, a) = keyword("modport")(s)?;
let (s, b) = list(symbol(","), modport_item)(s)?;
let (s, c) = symbol(";")(s)?;
@ -96,14 +96,14 @@ pub fn modport_declaration(s: Span) -> IResult<Span, ModportDeclaration> {
}
#[parser]
pub fn modport_item(s: Span) -> IResult<Span, ModportItem> {
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]
pub fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
pub(crate) fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
alt((
modport_ports_declaration_simple,
modport_ports_declaration_tf,
@ -112,7 +112,7 @@ pub fn modport_ports_declaration(s: Span) -> IResult<Span, ModportPortsDeclarato
}
#[parser]
pub fn modport_ports_declaration_simple(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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)?;
Ok((
@ -122,7 +122,7 @@ pub fn modport_ports_declaration_simple(s: Span) -> IResult<Span, ModportPortsDe
}
#[parser]
pub fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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)?;
Ok((
@ -132,7 +132,7 @@ pub fn modport_ports_declaration_tf(s: Span) -> IResult<Span, ModportPortsDeclar
}
#[parser]
pub fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, ModportPortsDeclaraton> {
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)?;
Ok((
@ -144,26 +144,26 @@ pub fn modport_ports_declaration_clocking(s: Span) -> IResult<Span, ModportPorts
}
#[parser]
pub fn modport_clocking_declaration(s: Span) -> IResult<Span, ModportClockingDeclaration> {
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]
pub fn modport_simple_ports_declaration(s: Span) -> IResult<Span, ModportSimplePortsDeclaration> {
pub(crate) fn modport_simple_ports_declaration(s: Span) -> IResult<Span, ModportSimplePortsDeclaration> {
let (s, a) = port_direction(s)?;
let (s, b) = list(symbol(","), modport_simple_port)(s)?;
Ok((s, ModportSimplePortsDeclaration { nodes: (a, b) }))
}
#[parser]
pub fn modport_simple_port(s: Span) -> IResult<Span, ModportSimplePort> {
pub(crate) fn modport_simple_port(s: Span) -> IResult<Span, ModportSimplePort> {
alt((modport_simple_port_ordered, modport_simple_port_named))(s)
}
#[parser]
pub fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort> {
pub(crate) fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort> {
let (s, a) = port_identifier(s)?;
Ok((
s,
@ -172,7 +172,7 @@ pub fn modport_simple_port_ordered(s: Span) -> IResult<Span, ModportSimplePort>
}
#[parser]
pub fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
pub(crate) fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
let (s, a) = symbol(".")(s)?;
let (s, b) = port_identifier(s)?;
let (s, c) = paren(opt(expression))(s)?;
@ -183,14 +183,14 @@ pub fn modport_simple_port_named(s: Span) -> IResult<Span, ModportSimplePort> {
}
#[parser]
pub fn modport_tf_ports_declaration(s: Span) -> IResult<Span, ModportTfPortsDeclaration> {
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]
pub fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
pub(crate) fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
alt((
map(method_prototype, |x| {
ModportTfPort::MethodPrototype(Box::new(x))
@ -200,7 +200,7 @@ pub fn modport_tf_port(s: Span) -> IResult<Span, ModportTfPort> {
}
#[parser]
pub fn import_export(s: Span) -> IResult<Span, ImportExport> {
pub(crate) fn import_export(s: Span) -> IResult<Span, ImportExport> {
alt((
map(keyword("import"), |x| ImportExport::Import(Box::new(x))),
map(keyword("export"), |x| ImportExport::Export(Box::new(x))),

View File

@ -83,7 +83,7 @@ pub struct LetActualArg {
// -----------------------------------------------------------------------------
#[parser]
pub fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
pub(crate) fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
let (s, a) = keyword("let")(s)?;
let (s, b) = let_identifier(s)?;
let (s, c) = opt(paren(opt(let_port_list)))(s)?;
@ -99,19 +99,19 @@ pub fn let_declaration(s: Span) -> IResult<Span, LetDeclaration> {
}
#[parser]
pub fn let_identifier(s: Span) -> IResult<Span, LetIdentifier> {
pub(crate) fn let_identifier(s: Span) -> IResult<Span, LetIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, LetIdentifier { nodes: (a,) }))
}
#[parser]
pub fn let_port_list(s: Span) -> IResult<Span, LetPortList> {
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)]
pub fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
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)?;
let (s, c) = formal_port_identifier(s)?;
@ -126,7 +126,7 @@ pub fn let_port_item(s: Span) -> IResult<Span, LetPortItem> {
}
#[parser]
pub fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
pub(crate) fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
alt((
map(data_type_or_implicit, |x| {
LetFormalType::DataTypeOrImplicit(Box::new(x))
@ -136,7 +136,7 @@ pub fn let_formal_type(s: Span) -> IResult<Span, LetFormalType> {
}
#[parser]
pub fn let_expression(s: Span) -> IResult<Span, LetExpression> {
pub(crate) fn let_expression(s: Span) -> IResult<Span, LetExpression> {
let (s, a) = opt(package_scope)(s)?;
let (s, b) = let_identifier(s)?;
let (s, c) = opt(paren(opt(let_list_of_arguments)))(s)?;
@ -144,12 +144,12 @@ pub fn let_expression(s: Span) -> IResult<Span, LetExpression> {
}
#[parser]
pub fn let_list_of_arguments(s: Span) -> IResult<Span, LetListOfArguments> {
pub(crate) fn let_list_of_arguments(s: Span) -> IResult<Span, LetListOfArguments> {
alt((let_list_of_arguments_ordered, let_list_of_arguments_named))(s)
}
#[parser(MaybeRecursive)]
pub fn let_list_of_arguments_ordered(s: Span) -> IResult<Span, LetListOfArguments> {
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((
symbol(","),
@ -164,7 +164,7 @@ pub fn let_list_of_arguments_ordered(s: Span) -> IResult<Span, LetListOfArgument
}
#[parser]
pub fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments> {
pub(crate) fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments> {
let (s, a) = list(
symbol(","),
triple(symbol("."), identifier, paren(opt(let_actual_arg))),
@ -176,7 +176,7 @@ pub fn let_list_of_arguments_named(s: Span) -> IResult<Span, LetListOfArguments>
}
#[parser]
pub fn let_actual_arg(s: Span) -> IResult<Span, LetActualArg> {
pub(crate) fn let_actual_arg(s: Span) -> IResult<Span, LetActualArg> {
let (s, a) = expression(s)?;
Ok((s, LetActualArg { nodes: (a,) }))
}

View File

@ -51,7 +51,7 @@ pub struct SpecparamDeclaration {
// -----------------------------------------------------------------------------
#[parser]
pub fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDeclaration> {
pub(crate) fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDeclaration> {
alt((
local_parameter_declaration_param,
local_parameter_declaration_type,
@ -59,7 +59,7 @@ pub fn local_parameter_declaration(s: Span) -> IResult<Span, LocalParameterDecla
}
#[parser(Ambiguous)]
pub fn local_parameter_declaration_param(s: Span) -> IResult<Span, LocalParameterDeclaration> {
pub(crate) fn local_parameter_declaration_param(s: Span) -> IResult<Span, LocalParameterDeclaration> {
let (s, a) = keyword("localparam")(s)?;
let (s, b) = ambiguous_opt(data_type_or_implicit)(s)?;
let (s, c) = list_of_param_assignments(s)?;
@ -72,7 +72,7 @@ pub fn local_parameter_declaration_param(s: Span) -> IResult<Span, LocalParamete
}
#[parser]
pub fn local_parameter_declaration_type(s: Span) -> IResult<Span, LocalParameterDeclaration> {
pub(crate) fn local_parameter_declaration_type(s: Span) -> IResult<Span, LocalParameterDeclaration> {
let (s, a) = keyword("localparam")(s)?;
let (s, b) = keyword("type")(s)?;
let (s, c) = list_of_type_assignments(s)?;
@ -85,12 +85,12 @@ pub fn local_parameter_declaration_type(s: Span) -> IResult<Span, LocalParameter
}
#[parser]
pub fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclaration> {
pub(crate) fn parameter_declaration(s: Span) -> IResult<Span, ParameterDeclaration> {
alt((parameter_declaration_param, parameter_declaration_type))(s)
}
#[parser(Ambiguous)]
pub fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDeclaration> {
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)?;
let (s, c) = list_of_param_assignments(s)?;
@ -101,7 +101,7 @@ pub fn parameter_declaration_param(s: Span) -> IResult<Span, ParameterDeclaratio
}
#[parser]
pub fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration> {
pub(crate) fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration> {
let (s, a) = keyword("parameter")(s)?;
let (s, b) = keyword("type")(s)?;
let (s, c) = list_of_type_assignments(s)?;
@ -112,7 +112,7 @@ pub fn parameter_declaration_type(s: Span) -> IResult<Span, ParameterDeclaration
}
#[parser]
pub fn specparam_declaration(s: Span) -> IResult<Span, SpecparamDeclaration> {
pub(crate) fn specparam_declaration(s: Span) -> IResult<Span, SpecparamDeclaration> {
let (s, a) = keyword("specparam")(s)?;
let (s, b) = opt(packed_dimension)(s)?;
let (s, c) = list_of_specparam_assignments(s)?;

View File

@ -288,7 +288,7 @@ pub struct TypeReferenceDataType {
#[packrat_parser]
#[parser]
pub fn casting_type(s: Span) -> IResult<Span, CastingType> {
pub(crate) fn casting_type(s: Span) -> IResult<Span, CastingType> {
alt((
map(simple_type, |x| CastingType::SimpleType(Box::new(x))),
map(signing, |x| CastingType::Signing(Box::new(x))),
@ -301,7 +301,7 @@ pub fn casting_type(s: Span) -> IResult<Span, CastingType> {
}
#[parser]
pub fn data_type(s: Span) -> IResult<Span, DataType> {
pub(crate) fn data_type(s: Span) -> IResult<Span, DataType> {
alt((
data_type_vector,
data_type_atom,
@ -322,7 +322,7 @@ pub fn data_type(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn data_type_vector(s: Span) -> IResult<Span, DataType> {
pub(crate) fn data_type_vector(s: Span) -> IResult<Span, DataType> {
let (s, a) = integer_vector_type(s)?;
let (s, b) = opt(signing)(s)?;
let (s, c) = many0(packed_dimension)(s)?;
@ -333,14 +333,14 @@ pub fn data_type_vector(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn data_type_atom(s: Span) -> IResult<Span, DataType> {
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]
pub fn data_type_struct_union(s: Span) -> IResult<Span, DataType> {
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)?;
let (s, c) = brace(pair(struct_union_member, many0(struct_union_member)))(s)?;
@ -354,13 +354,13 @@ pub fn data_type_struct_union(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn packed(s: Span) -> IResult<Span, Packed> {
pub(crate) fn packed(s: Span) -> IResult<Span, Packed> {
let (s, a) = keyword("packed")(s)?;
Ok((s, Packed { nodes: (a,) }))
}
#[parser]
pub fn data_type_enum(s: Span) -> IResult<Span, DataType> {
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)?;
let (s, c) = brace(list(symbol(","), enum_name_declaration))(s)?;
@ -374,7 +374,7 @@ pub fn data_type_enum(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
pub(crate) fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
let (s, a) = keyword("virtual")(s)?;
let (s, b) = opt(interface)(s)?;
let (s, c) = interface_identifier(s)?;
@ -389,13 +389,13 @@ pub fn data_type_virtual(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn interface(s: Span) -> IResult<Span, Interface> {
pub(crate) fn interface(s: Span) -> IResult<Span, Interface> {
let (s, a) = keyword("interface")(s)?;
Ok((s, Interface { nodes: (a,) }))
}
#[parser]
pub fn data_type_type(s: Span) -> IResult<Span, DataType> {
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)?;
let (s, c) = many0(packed_dimension)(s)?;
@ -406,7 +406,7 @@ pub fn data_type_type(s: Span) -> IResult<Span, DataType> {
}
#[parser]
pub fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
pub(crate) fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
alt((
map(data_type, |x| DataTypeOrImplicit::DataType(Box::new(x))),
map(implicit_data_type, |x| {
@ -416,14 +416,14 @@ pub fn data_type_or_implicit(s: Span) -> IResult<Span, DataTypeOrImplicit> {
}
#[parser]
pub fn implicit_data_type(s: Span) -> IResult<Span, ImplicitDataType> {
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]
pub fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
pub(crate) fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
alt((
enum_base_type_atom,
enum_base_type_vector,
@ -432,7 +432,7 @@ pub fn enum_base_type(s: Span) -> IResult<Span, EnumBaseType> {
}
#[parser]
pub fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
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)?;
Ok((
@ -442,7 +442,7 @@ pub fn enum_base_type_atom(s: Span) -> IResult<Span, EnumBaseType> {
}
#[parser]
pub fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
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)?;
let (s, c) = opt(packed_dimension)(s)?;
@ -453,7 +453,7 @@ pub fn enum_base_type_vector(s: Span) -> IResult<Span, EnumBaseType> {
}
#[parser]
pub fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
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)?;
Ok((
@ -463,7 +463,7 @@ pub fn enum_base_type_type(s: Span) -> IResult<Span, EnumBaseType> {
}
#[parser]
pub fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
pub(crate) fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
let (s, a) = enum_identifier(s)?;
let (s, b) = opt(bracket(pair(
integral_number,
@ -475,14 +475,14 @@ pub fn enum_name_declaration(s: Span) -> IResult<Span, EnumNameDeclaration> {
#[packrat_parser]
#[parser]
pub fn class_scope(s: Span) -> IResult<Span, ClassScope> {
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]
pub fn class_type(s: Span) -> IResult<Span, ClassType> {
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)?;
let (s, c) = many0(triple(
@ -494,7 +494,7 @@ pub fn class_type(s: Span) -> IResult<Span, ClassType> {
}
#[parser]
pub fn integer_type(s: Span) -> IResult<Span, IntegerType> {
pub(crate) fn integer_type(s: Span) -> IResult<Span, IntegerType> {
alt((
map(integer_vector_type, |x| {
IntegerType::IntegerVectorType(Box::new(x))
@ -506,7 +506,7 @@ pub fn integer_type(s: Span) -> IResult<Span, IntegerType> {
}
#[parser]
pub fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
pub(crate) fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
alt((
map(keyword("byte"), |x| IntegerAtomType::Byte(Box::new(x))),
map(keyword("shortint"), |x| {
@ -524,7 +524,7 @@ pub fn integer_atom_type(s: Span) -> IResult<Span, IntegerAtomType> {
}
#[parser]
pub fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
pub(crate) fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
alt((
map(keyword("bit"), |x| IntegerVectorType::Bit(Box::new(x))),
map(keyword("logic"), |x| IntegerVectorType::Logic(Box::new(x))),
@ -533,7 +533,7 @@ pub fn integer_vector_type(s: Span) -> IResult<Span, IntegerVectorType> {
}
#[parser]
pub fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
pub(crate) fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
alt((
map(keyword("shortreal"), |x| {
NonIntegerType::Shortreal(Box::new(x))
@ -546,7 +546,7 @@ pub fn non_integer_type(s: Span) -> IResult<Span, NonIntegerType> {
}
#[parser]
pub fn net_type(s: Span) -> IResult<Span, NetType> {
pub(crate) fn net_type(s: Span) -> IResult<Span, NetType> {
alt((
map(keyword("supply0"), |x| NetType::Supply0(Box::new(x))),
map(keyword("supply1"), |x| NetType::Supply1(Box::new(x))),
@ -564,7 +564,7 @@ pub fn net_type(s: Span) -> IResult<Span, NetType> {
}
#[parser]
pub fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
pub(crate) fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
alt((
net_port_type_data_type,
map(net_type_identifier, |x| {
@ -575,7 +575,7 @@ pub fn net_port_type(s: Span) -> IResult<Span, NetPortType> {
}
#[parser]
pub fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
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)?;
Ok((
@ -585,7 +585,7 @@ pub fn net_port_type_data_type(s: Span) -> IResult<Span, NetPortType> {
}
#[parser]
pub fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType> {
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)?;
Ok((
@ -595,13 +595,13 @@ pub fn net_port_type_interconnect(s: Span) -> IResult<Span, NetPortType> {
}
#[parser]
pub fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
pub(crate) fn variable_port_type(s: Span) -> IResult<Span, VariablePortType> {
let (s, a) = var_data_type(s)?;
Ok((s, VariablePortType { nodes: (a,) }))
}
#[parser]
pub fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
pub(crate) fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
alt((
map(data_type, |x| VarDataType::DataType(Box::new(x))),
var_data_type_var,
@ -609,7 +609,7 @@ pub fn var_data_type(s: Span) -> IResult<Span, VarDataType> {
}
#[parser]
pub fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
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)?;
Ok((
@ -619,7 +619,7 @@ pub fn var_data_type_var(s: Span) -> IResult<Span, VarDataType> {
}
#[parser]
pub fn signing(s: Span) -> IResult<Span, Signing> {
pub(crate) fn signing(s: Span) -> IResult<Span, Signing> {
alt((
map(keyword("signed"), |x| Signing::Signed(Box::new(x))),
map(keyword("unsigned"), |x| Signing::Unsigned(Box::new(x))),
@ -628,7 +628,7 @@ pub fn signing(s: Span) -> IResult<Span, Signing> {
#[packrat_parser]
#[parser]
pub fn simple_type(s: Span) -> IResult<Span, SimpleType> {
pub(crate) fn simple_type(s: Span) -> IResult<Span, SimpleType> {
alt((
map(integer_type, |x| SimpleType::IntegerType(Box::new(x))),
map(non_integer_type, |x| {
@ -644,7 +644,7 @@ pub fn simple_type(s: Span) -> IResult<Span, SimpleType> {
}
#[parser]
pub fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
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)?;
let (s, c) = data_type_or_void(s)?;
@ -659,7 +659,7 @@ pub fn struct_union_member(s: Span) -> IResult<Span, StructUnionMember> {
}
#[parser]
pub fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
pub(crate) fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
alt((
map(data_type, |x| DataTypeOrVoid::DataType(Box::new(x))),
map(keyword("void"), |x| DataTypeOrVoid::Void(Box::new(x))),
@ -667,7 +667,7 @@ pub fn data_type_or_void(s: Span) -> IResult<Span, DataTypeOrVoid> {
}
#[parser]
pub fn struct_union(s: Span) -> IResult<Span, StructUnion> {
pub(crate) fn struct_union(s: Span) -> IResult<Span, StructUnion> {
alt((
map(keyword("struct"), |x| StructUnion::Struct(Box::new(x))),
map(pair(keyword("union"), keyword("tagged")), |x| {
@ -678,12 +678,12 @@ pub fn struct_union(s: Span) -> IResult<Span, StructUnion> {
}
#[parser]
pub fn type_reference(s: Span) -> IResult<Span, TypeReference> {
pub(crate) fn type_reference(s: Span) -> IResult<Span, TypeReference> {
alt((type_reference_expression, type_reference_data_type))(s)
}
#[parser]
pub fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
pub(crate) fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
let (s, a) = keyword("type")(s)?;
let (s, b) = paren(expression)(s)?;
Ok((
@ -693,7 +693,7 @@ pub fn type_reference_expression(s: Span) -> IResult<Span, TypeReference> {
}
#[parser]
pub fn type_reference_data_type(s: Span) -> IResult<Span, TypeReference> {
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)?;
Ok((

View File

@ -41,7 +41,7 @@ pub struct OutputDeclarationNet {
#[derive(Clone, Debug, Node)]
pub struct OutputDeclarationVariable {
pub nodes: (Keyword, VariablePortType, ListOfVariableIdentifiers),
pub nodes: (Keyword, VariablePortType, ListOfVariablePortIdentifiers),
}
#[derive(Clone, Debug, Node)]
@ -61,7 +61,7 @@ pub struct RefDeclaration {
// -----------------------------------------------------------------------------
#[parser(Ambiguous)]
pub fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
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)?;
let (s, c) = list_of_port_identifiers(s)?;
@ -69,12 +69,12 @@ pub fn inout_declaration(s: Span) -> IResult<Span, InoutDeclaration> {
}
#[parser]
pub fn input_declaration(s: Span) -> IResult<Span, InputDeclaration> {
pub(crate) fn input_declaration(s: Span) -> IResult<Span, InputDeclaration> {
alt((input_declaration_net, input_declaration_variable))(s)
}
#[parser(Ambiguous)]
pub fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration> {
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)?;
let (s, c) = list_of_port_identifiers(s)?;
@ -85,7 +85,7 @@ pub fn input_declaration_net(s: Span) -> IResult<Span, InputDeclaration> {
}
#[parser(Ambiguous)]
pub fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclaration> {
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)?;
let (s, c) = list_of_variable_identifiers(s)?;
@ -96,12 +96,12 @@ pub fn input_declaration_variable(s: Span) -> IResult<Span, InputDeclaration> {
}
#[parser]
pub fn output_declaration(s: Span) -> IResult<Span, OutputDeclaration> {
pub(crate) fn output_declaration(s: Span) -> IResult<Span, OutputDeclaration> {
alt((output_declaration_net, output_declaration_variable))(s)
}
#[parser(Ambiguous)]
pub fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration> {
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)?;
let (s, c) = list_of_port_identifiers(s)?;
@ -112,10 +112,10 @@ pub fn output_declaration_net(s: Span) -> IResult<Span, OutputDeclaration> {
}
#[parser(Ambiguous)]
pub fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclaration> {
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)?;
let (s, c) = list_of_variable_identifiers(s)?;
let (s, c) = list_of_variable_port_identifiers(s)?;
Ok((
s,
OutputDeclaration::Variable(Box::new(OutputDeclarationVariable { nodes: (a, b, c) })),
@ -123,7 +123,7 @@ pub fn output_declaration_variable(s: Span) -> IResult<Span, OutputDeclaration>
}
#[parser]
pub fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePortDeclaration> {
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)?;
let (s, c) = list_of_interface_identifiers(s)?;
@ -131,7 +131,7 @@ pub fn interface_port_declaration(s: Span) -> IResult<Span, InterfacePortDeclara
}
#[parser(Ambiguous)]
pub fn ref_declaration(s: Span) -> IResult<Span, RefDeclaration> {
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)?;
let (s, c) = list_of_variable_identifiers(s)?;
@ -139,7 +139,7 @@ pub fn ref_declaration(s: Span) -> IResult<Span, RefDeclaration> {
}
#[parser]
pub fn implicit_var(s: Span) -> IResult<Span, VariablePortType> {
pub(crate) fn implicit_var(s: Span) -> IResult<Span, VariablePortType> {
let (s, a) = keyword("var")(s)?;
Ok((
s,

View File

@ -87,7 +87,7 @@ pub struct ChargeStrengthLarge {
// -----------------------------------------------------------------------------
#[parser]
pub fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
alt((
drive_strength01,
drive_strength10,
@ -99,7 +99,7 @@ pub fn drive_strength(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
s,
@ -108,7 +108,7 @@ pub fn drive_strength01(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
s,
@ -117,7 +117,7 @@ pub fn drive_strength10(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength0, symbol(","), keyword("highz1")))(s)?;
Ok((
s,
@ -126,7 +126,7 @@ pub fn drive_strength0z(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(strength1, symbol(","), keyword("highz0")))(s)?;
Ok((
s,
@ -135,7 +135,7 @@ pub fn drive_strength1z(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(keyword("highz0"), symbol(","), strength1))(s)?;
Ok((
s,
@ -144,7 +144,7 @@ pub fn drive_strengthz1(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
pub(crate) fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
let (s, a) = paren(triple(keyword("highz1"), symbol(","), strength0))(s)?;
Ok((
s,
@ -153,7 +153,7 @@ pub fn drive_strengthz0(s: Span) -> IResult<Span, DriveStrength> {
}
#[parser]
pub fn strength0(s: Span) -> IResult<Span, Strength0> {
pub(crate) fn strength0(s: Span) -> IResult<Span, Strength0> {
alt((
map(keyword("supply0"), |x| Strength0::Supply0(Box::new(x))),
map(keyword("strong0"), |x| Strength0::Strong0(Box::new(x))),
@ -163,7 +163,7 @@ pub fn strength0(s: Span) -> IResult<Span, Strength0> {
}
#[parser]
pub fn strength1(s: Span) -> IResult<Span, Strength1> {
pub(crate) fn strength1(s: Span) -> IResult<Span, Strength1> {
alt((
map(keyword("supply1"), |x| Strength1::Supply1(Box::new(x))),
map(keyword("strong1"), |x| Strength1::Strong1(Box::new(x))),
@ -173,7 +173,7 @@ pub fn strength1(s: Span) -> IResult<Span, Strength1> {
}
#[parser]
pub fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
pub(crate) fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
alt((
charge_strength_small,
charge_strength_medium,
@ -182,7 +182,7 @@ pub fn charge_strength(s: Span) -> IResult<Span, ChargeStrength> {
}
#[parser]
pub fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
pub(crate) fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("small"))(s)?;
Ok((
s,
@ -191,7 +191,7 @@ pub fn charge_strength_small(s: Span) -> IResult<Span, ChargeStrength> {
}
#[parser]
pub fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
pub(crate) fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("medium"))(s)?;
Ok((
s,
@ -200,7 +200,7 @@ pub fn charge_strength_medium(s: Span) -> IResult<Span, ChargeStrength> {
}
#[parser]
pub fn charge_strength_large(s: Span) -> IResult<Span, ChargeStrength> {
pub(crate) fn charge_strength_large(s: Span) -> IResult<Span, ChargeStrength> {
let (s, a) = paren(keyword("large"))(s)?;
Ok((
s,

View File

@ -98,7 +98,7 @@ pub struct TaskPrototype {
// -----------------------------------------------------------------------------
#[parser]
pub fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
pub(crate) fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
let (s, a) = keyword("task")(s)?;
let (s, b) = opt(lifetime)(s)?;
let (s, c) = task_body_declaration(s)?;
@ -106,7 +106,7 @@ pub fn task_declaration(s: Span) -> IResult<Span, TaskDeclaration> {
}
#[parser]
pub fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
pub(crate) fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
alt((
task_body_declaration_without_port,
task_body_declaration_with_port,
@ -114,7 +114,7 @@ pub fn task_body_declaration(s: Span) -> IResult<Span, TaskBodyDeclaration> {
}
#[parser]
pub fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -131,7 +131,7 @@ pub fn task_body_declaration_without_port(s: Span) -> IResult<Span, TaskBodyDecl
}
#[parser]
pub fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBodyDeclaration> {
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)?;
let (s, c) = paren(opt(tf_port_list))(s)?;
@ -149,7 +149,7 @@ pub fn task_body_declaration_with_port(s: Span) -> IResult<Span, TaskBodyDeclara
}
#[parser]
pub fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
pub(crate) fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
alt((
map(block_item_declaration, |x| {
TfItemDeclaration::BlockItemDeclaration(Box::new(x))
@ -161,13 +161,13 @@ pub fn tf_item_declaration(s: Span) -> IResult<Span, TfItemDeclaration> {
}
#[parser]
pub fn tf_port_list(s: Span) -> IResult<Span, TfPortList> {
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)]
pub fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
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)?;
let (s, c) = opt(var)(s)?;
@ -186,7 +186,7 @@ pub fn tf_port_item(s: Span) -> IResult<Span, TfPortItem> {
}
#[parser]
pub fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
pub(crate) fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
alt((
map(port_direction, |x| {
TfPortDirection::PortDirection(Box::new(x))
@ -198,7 +198,7 @@ pub fn tf_port_direction(s: Span) -> IResult<Span, TfPortDirection> {
}
#[parser(Ambiguous)]
pub fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
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)?;
let (s, c) = opt(var)(s)?;
@ -214,7 +214,7 @@ pub fn tf_port_declaration(s: Span) -> IResult<Span, TfPortDeclaration> {
}
#[parser]
pub fn task_prototype(s: Span) -> IResult<Span, TaskPrototype> {
pub(crate) fn task_prototype(s: Span) -> IResult<Span, TaskPrototype> {
let (s, a) = keyword("task")(s)?;
let (s, b) = task_identifier(s)?;
let (s, c) = opt(paren(opt(tf_port_list)))(s)?;

View File

@ -217,7 +217,7 @@ pub enum Lifetime {
// -----------------------------------------------------------------------------
#[parser]
pub fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
pub(crate) fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
alt((
data_declaration_variable,
map(type_declaration, |x| {
@ -233,7 +233,7 @@ pub fn data_declaration(s: Span) -> IResult<Span, DataDeclaration> {
}
#[parser(Ambiguous)]
pub fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
pub(crate) fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
let (s, a) = opt(r#const)(s)?;
let (s, b) = opt(var)(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -249,13 +249,13 @@ pub fn data_declaration_variable(s: Span) -> IResult<Span, DataDeclaration> {
}
#[parser]
pub fn r#const(s: Span) -> IResult<Span, Const> {
pub(crate) fn r#const(s: Span) -> IResult<Span, Const> {
let (s, a) = keyword("const")(s)?;
Ok((s, Const { nodes: (a,) }))
}
#[parser]
pub fn package_import_declaration(s: Span) -> IResult<Span, PackageImportDeclaration> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -263,12 +263,12 @@ pub fn package_import_declaration(s: Span) -> IResult<Span, PackageImportDeclara
}
#[parser]
pub fn package_import_item(s: Span) -> IResult<Span, PackageImportItem> {
pub(crate) fn package_import_item(s: Span) -> IResult<Span, PackageImportItem> {
alt((package_import_item_identifier, package_import_item_asterisk))(s)
}
#[parser]
pub fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportItem> {
pub(crate) fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportItem> {
let (s, a) = package_identifier(s)?;
let (s, b) = symbol("::")(s)?;
let (s, c) = identifier(s)?;
@ -279,7 +279,7 @@ pub fn package_import_item_identifier(s: Span) -> IResult<Span, PackageImportIte
}
#[parser]
pub fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem> {
pub(crate) fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem> {
let (s, a) = package_identifier(s)?;
let (s, b) = symbol("::")(s)?;
let (s, c) = symbol("*")(s)?;
@ -290,7 +290,7 @@ pub fn package_import_item_asterisk(s: Span) -> IResult<Span, PackageImportItem>
}
#[parser]
pub fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclaration> {
pub(crate) fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclaration> {
alt((
package_export_declaration_asterisk,
package_export_declaration_item,
@ -298,7 +298,7 @@ pub fn package_export_declaration(s: Span) -> IResult<Span, PackageExportDeclara
}
#[parser]
pub fn package_export_declaration_asterisk(s: Span) -> IResult<Span, PackageExportDeclaration> {
pub(crate) fn package_export_declaration_asterisk(s: Span) -> IResult<Span, PackageExportDeclaration> {
let (s, a) = keyword("export")(s)?;
let (s, b) = symbol("*::*")(s)?;
let (s, c) = symbol(";")(s)?;
@ -311,7 +311,7 @@ pub fn package_export_declaration_asterisk(s: Span) -> IResult<Span, PackageExpo
}
#[parser]
pub fn package_export_declaration_item(s: Span) -> IResult<Span, PackageExportDeclaration> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -322,7 +322,7 @@ pub fn package_export_declaration_item(s: Span) -> IResult<Span, PackageExportDe
}
#[parser]
pub fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
pub(crate) fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
let (s, a) = keyword("genvar")(s)?;
let (s, b) = list_of_genvar_identifiers(s)?;
let (s, c) = symbol(";")(s)?;
@ -330,7 +330,7 @@ pub fn genvar_declaration(s: Span) -> IResult<Span, GenvarDeclaration> {
}
#[parser]
pub fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
pub(crate) fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
alt((
net_declaration_interconnect,
net_declaration_net_type,
@ -339,7 +339,7 @@ pub fn net_declaration(s: Span) -> IResult<Span, NetDeclaration> {
}
#[parser(Ambiguous)]
pub fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
pub(crate) fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
let (s, a) = net_type(s)?;
let (s, b) = opt(strength)(s)?;
let (s, c) = opt(vector_scalar)(s)?;
@ -356,7 +356,7 @@ pub fn net_declaration_net_type(s: Span) -> IResult<Span, NetDeclaration> {
}
#[parser]
pub fn strength(s: Span) -> IResult<Span, Strength> {
pub(crate) fn strength(s: Span) -> IResult<Span, Strength> {
alt((
map(drive_strength, |x| Strength::Drive(Box::new(x))),
map(charge_strength, |x| Strength::Charge(Box::new(x))),
@ -364,7 +364,7 @@ pub fn strength(s: Span) -> IResult<Span, Strength> {
}
#[parser]
pub fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
pub(crate) fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
alt((
map(keyword("vectored"), |x| VectorScalar::Vectored(Box::new(x))),
map(keyword("scalared"), |x| VectorScalar::Scalared(Box::new(x))),
@ -372,7 +372,7 @@ pub fn vector_scalar(s: Span) -> IResult<Span, VectorScalar> {
}
#[parser]
pub fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetDeclaration> {
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)?;
let (s, c) = list_of_net_decl_assignments(s)?;
@ -386,7 +386,7 @@ pub fn net_declaration_net_type_identifier(s: Span) -> IResult<Span, NetDeclarat
}
#[parser]
pub fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
pub(crate) fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
let (s, a) = keyword("interconnect")(s)?;
let (s, b) = implicit_data_type(s)?;
let (s, c) = opt(pair(symbol("#"), delay_value))(s)?;
@ -407,7 +407,7 @@ pub fn net_declaration_interconnect(s: Span) -> IResult<Span, NetDeclaration> {
}
#[parser]
pub fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
pub(crate) fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
alt((
type_declaration_data_type,
type_declaration_interface,
@ -416,7 +416,7 @@ pub fn type_declaration(s: Span) -> IResult<Span, TypeDeclaration> {
}
#[parser]
pub fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
pub(crate) fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
let (s, a) = keyword("typedef")(s)?;
let (s, b) = data_type(s)?;
let (s, c) = type_identifier(s)?;
@ -431,7 +431,7 @@ pub fn type_declaration_data_type(s: Span) -> IResult<Span, TypeDeclaration> {
}
#[parser]
pub fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
pub(crate) fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
let (s, a) = keyword("typedef")(s)?;
let (s, b) = interface_instance_identifier(s)?;
let (s, c) = constant_bit_select(s)?;
@ -448,7 +448,7 @@ pub fn type_declaration_interface(s: Span) -> IResult<Span, TypeDeclaration> {
}
#[parser]
pub fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaration> {
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)?;
let (s, c) = type_identifier(s)?;
@ -462,7 +462,7 @@ pub fn type_declaration_reserved(s: Span) -> IResult<Span, TypeDeclaration> {
}
#[parser]
pub fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword> {
pub(crate) fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword> {
alt((
map(keyword("enum"), |x| {
TypeDeclarationKeyword::Enum(Box::new(x))
@ -483,7 +483,7 @@ pub fn type_declaration_keyword(s: Span) -> IResult<Span, TypeDeclarationKeyword
}
#[parser]
pub fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
pub(crate) fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
alt((
net_type_declaration_data_type,
net_type_declaration_net_type,
@ -491,7 +491,7 @@ pub fn net_type_declaration(s: Span) -> IResult<Span, NetTypeDeclaration> {
}
#[parser]
pub fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
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)?;
let (s, c) = net_type_identifier(s)?;
@ -510,7 +510,7 @@ pub fn net_type_declaration_data_type(s: Span) -> IResult<Span, NetTypeDeclarati
}
#[parser]
pub fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDeclaration> {
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)?;
let (s, c) = net_type_identifier(s)?;
@ -525,7 +525,7 @@ pub fn net_type_declaration_net_type(s: Span) -> IResult<Span, NetTypeDeclaratio
}
#[parser]
pub fn lifetime(s: Span) -> IResult<Span, Lifetime> {
pub(crate) fn lifetime(s: Span) -> IResult<Span, Lifetime> {
alt((
map(keyword("static"), |x| Lifetime::Static(Box::new(x))),
map(keyword("automatic"), |x| Lifetime::Automatic(Box::new(x))),

View File

@ -94,31 +94,31 @@ pub struct EmptyUnpackedArrayConcatenation {
// -----------------------------------------------------------------------------
#[parser]
pub fn concatenation(s: Span) -> IResult<Span, Concatenation> {
pub(crate) fn concatenation(s: Span) -> IResult<Span, Concatenation> {
let (s, a) = brace(list(symbol(","), expression))(s)?;
Ok((s, Concatenation { nodes: (a,) }))
}
#[parser]
pub fn constant_concatenation(s: Span) -> IResult<Span, ConstantConcatenation> {
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]
pub fn constant_multiple_concatenation(s: Span) -> IResult<Span, ConstantMultipleConcatenation> {
pub(crate) fn constant_multiple_concatenation(s: Span) -> IResult<Span, ConstantMultipleConcatenation> {
let (s, a) = brace(pair(constant_expression, constant_concatenation))(s)?;
Ok((s, ConstantMultipleConcatenation { nodes: (a,) }))
}
#[parser]
pub fn module_path_concatenation(s: Span) -> IResult<Span, ModulePathConcatenation> {
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]
pub fn module_path_multiple_concatenation(
pub(crate) fn module_path_multiple_concatenation(
s: Span,
) -> IResult<Span, ModulePathMultipleConcatenation> {
let (s, a) = brace(pair(constant_expression, module_path_concatenation))(s)?;
@ -126,13 +126,13 @@ pub fn module_path_multiple_concatenation(
}
#[parser]
pub fn multiple_concatenation(s: Span) -> IResult<Span, MultipleConcatenation> {
pub(crate) fn multiple_concatenation(s: Span) -> IResult<Span, MultipleConcatenation> {
let (s, a) = brace(pair(expression, concatenation))(s)?;
Ok((s, MultipleConcatenation { nodes: (a,) }))
}
#[parser]
pub fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
pub(crate) fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation> {
let (s, a) = brace(triple(
stream_operator,
opt(slice_size),
@ -142,7 +142,7 @@ pub fn streaming_concatenation(s: Span) -> IResult<Span, StreamingConcatenation>
}
#[parser]
pub fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
pub(crate) fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
alt((
map(symbol(">>"), |x| StreamOperator { nodes: (x,) }),
map(symbol("<<"), |x| StreamOperator { nodes: (x,) }),
@ -150,7 +150,7 @@ pub fn stream_operator(s: Span) -> IResult<Span, StreamOperator> {
}
#[parser]
pub fn slice_size(s: Span) -> IResult<Span, SliceSize> {
pub(crate) fn slice_size(s: Span) -> IResult<Span, SliceSize> {
alt((
map(simple_type, |x| SliceSize::SimpleType(Box::new(x))),
map(constant_expression, |x| {
@ -160,20 +160,20 @@ pub fn slice_size(s: Span) -> IResult<Span, SliceSize> {
}
#[parser]
pub fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation> {
pub(crate) fn stream_concatenation(s: Span) -> IResult<Span, StreamConcatenation> {
let (s, a) = brace(list(symbol(","), stream_expression))(s)?;
Ok((s, StreamConcatenation { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn stream_expression(s: Span) -> IResult<Span, StreamExpression> {
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]
pub fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpression> {
pub(crate) fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpression> {
alt((
map(expression, |x| {
ArrayRangeExpression::Expression(Box::new(x))
@ -185,7 +185,7 @@ pub fn array_range_expression(s: Span) -> IResult<Span, ArrayRangeExpression> {
}
#[parser(MaybeRecursive)]
pub fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
pub(crate) fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = expression(s)?;
@ -196,7 +196,7 @@ pub fn array_range_expression_colon(s: Span) -> IResult<Span, ArrayRangeExpressi
}
#[parser(MaybeRecursive)]
pub fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
pub(crate) fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol("+:")(s)?;
let (s, c) = expression(s)?;
@ -209,7 +209,7 @@ pub fn array_range_expression_plus_colon(s: Span) -> IResult<Span, ArrayRangeExp
}
#[parser(MaybeRecursive)]
pub fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
pub(crate) fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol("-:")(s)?;
let (s, c) = expression(s)?;
@ -222,7 +222,7 @@ pub fn array_range_expression_minus_colon(s: Span) -> IResult<Span, ArrayRangeEx
}
#[parser]
pub fn empty_unpacked_array_concatenation(
pub(crate) fn empty_unpacked_array_concatenation(
s: Span,
) -> IResult<Span, EmptyUnpackedArrayConcatenation> {
let (s, a) = symbol("{")(s)?;

View File

@ -75,12 +75,12 @@ pub struct NonrangeVariableLvalue {
#[packrat_parser]
#[parser]
pub fn net_lvalue(s: Span) -> IResult<Span, NetLvalue> {
pub(crate) fn net_lvalue(s: Span) -> IResult<Span, NetLvalue> {
alt((net_lvalue_identifier, net_lvalue_lvalue, net_lvalue_pattern))(s)
}
#[parser]
pub fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
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)?;
Ok((
@ -90,7 +90,7 @@ pub fn net_lvalue_identifier(s: Span) -> IResult<Span, NetLvalue> {
}
#[parser]
pub fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
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)?;
Ok((
@ -100,7 +100,7 @@ pub fn net_lvalue_pattern(s: Span) -> IResult<Span, NetLvalue> {
}
#[parser]
pub fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
pub(crate) fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
let (s, a) = brace(list(symbol(","), net_lvalue))(s)?;
Ok((
s,
@ -110,7 +110,7 @@ pub fn net_lvalue_lvalue(s: Span) -> IResult<Span, NetLvalue> {
#[packrat_parser]
#[parser]
pub fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
pub(crate) fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
alt((
variable_lvalue_identifier,
variable_lvalue_lvalue,
@ -122,7 +122,7 @@ pub fn variable_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
}
#[parser]
pub fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalue> {
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)?;
let (s, c) = select(s)?;
@ -133,7 +133,7 @@ pub fn variable_lvalue_identifier(s: Span) -> IResult<Span, VariableLvalue> {
}
#[parser]
pub fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue> {
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)?;
Ok((
@ -143,7 +143,7 @@ pub fn variable_lvalue_pattern(s: Span) -> IResult<Span, VariableLvalue> {
}
#[parser]
pub fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
pub(crate) fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
let (s, a) = brace(list(symbol(","), variable_lvalue))(s)?;
Ok((
s,
@ -152,7 +152,7 @@ pub fn variable_lvalue_lvalue(s: Span) -> IResult<Span, VariableLvalue> {
}
#[parser]
pub fn nonrange_variable_lvalue(s: Span) -> IResult<Span, NonrangeVariableLvalue> {
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)?;
let (s, c) = nonrange_select(s)?;

View File

@ -263,12 +263,12 @@ pub struct GenvarExpression {
// -----------------------------------------------------------------------------
#[parser]
pub fn inc_or_dec_expression(s: Span) -> IResult<Span, IncOrDecExpression> {
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]
pub fn inc_or_dec_expression_prefix(s: Span) -> IResult<Span, IncOrDecExpression> {
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)?;
let (s, c) = variable_lvalue(s)?;
@ -279,7 +279,7 @@ pub fn inc_or_dec_expression_prefix(s: Span) -> IResult<Span, IncOrDecExpression
}
#[parser(MaybeRecursive)]
pub fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression> {
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)?;
let (s, c) = inc_or_dec_operator(s)?;
@ -290,7 +290,7 @@ pub fn inc_or_dec_expression_suffix(s: Span) -> IResult<Span, IncOrDecExpression
}
#[parser(MaybeRecursive)]
pub fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
pub(crate) fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
let (s, a) = cond_predicate(s)?;
let (s, b) = symbol("?")(s)?;
let (s, c) = many0(attribute_instance)(s)?;
@ -307,7 +307,7 @@ pub fn conditional_expression(s: Span) -> IResult<Span, ConditionalExpression> {
#[packrat_parser]
#[parser]
pub fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
pub(crate) fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
alt((
constant_expression_unary,
constant_expression_binary,
@ -319,7 +319,7 @@ pub fn constant_expression(s: Span) -> IResult<Span, ConstantExpression> {
}
#[parser]
pub fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
pub(crate) fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
let (s, a) = unary_operator(s)?;
let (s, b) = many0(attribute_instance)(s)?;
let (s, c) = constant_primary(s)?;
@ -330,7 +330,7 @@ pub fn constant_expression_unary(s: Span) -> IResult<Span, ConstantExpression> {
}
#[parser(MaybeRecursive)]
pub fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
pub(crate) fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression> {
let (s, a) = constant_expression(s)?;
let (s, b) = binary_operator(s)?;
let (s, c) = many0(attribute_instance)(s)?;
@ -344,7 +344,7 @@ pub fn constant_expression_binary(s: Span) -> IResult<Span, ConstantExpression>
}
#[parser(MaybeRecursive)]
pub fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
pub(crate) fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression> {
let (s, a) = constant_expression(s)?;
let (s, b) = symbol("?")(s)?;
let (s, c) = many0(attribute_instance)(s)?;
@ -360,7 +360,7 @@ pub fn constant_expression_ternary(s: Span) -> IResult<Span, ConstantExpression>
}
#[parser]
pub fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmaxExpression> {
pub(crate) fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmaxExpression> {
alt((
constant_mintypmax_expression_ternary,
map(constant_expression, |x| {
@ -370,7 +370,7 @@ pub fn constant_mintypmax_expression(s: Span) -> IResult<Span, ConstantMintypmax
}
#[parser(MaybeRecursive)]
pub fn constant_mintypmax_expression_ternary(
pub(crate) fn constant_mintypmax_expression_ternary(
s: Span,
) -> IResult<Span, ConstantMintypmaxExpression> {
let (s, a) = constant_expression(s)?;
@ -387,7 +387,7 @@ pub fn constant_mintypmax_expression_ternary(
}
#[parser]
pub fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpression> {
pub(crate) fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpression> {
alt((
map(symbol("$"), |x| {
ConstantParamExpression::Dollar(Box::new(x))
@ -402,7 +402,7 @@ pub fn constant_param_expression(s: Span) -> IResult<Span, ConstantParamExpressi
}
#[parser]
pub fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
pub(crate) fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
alt((
map(symbol("$"), |x| ParamExpression::Dollar(Box::new(x))),
map(mintypmax_expression, |x| {
@ -413,7 +413,7 @@ pub fn param_expression(s: Span) -> IResult<Span, ParamExpression> {
}
#[parser]
pub fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpression> {
pub(crate) fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpression> {
alt((
map(constant_part_select_range, |x| {
ConstantRangeExpression::ConstantPartSelectRange(Box::new(x))
@ -425,7 +425,7 @@ pub fn constant_range_expression(s: Span) -> IResult<Span, ConstantRangeExpressi
}
#[parser]
pub fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRange> {
pub(crate) fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRange> {
alt((
map(constant_range, |x| {
ConstantPartSelectRange::ConstantRange(Box::new(x))
@ -437,7 +437,7 @@ pub fn constant_part_select_range(s: Span) -> IResult<Span, ConstantPartSelectRa
}
#[parser(MaybeRecursive)]
pub fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
pub(crate) fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
let (s, a) = constant_expression(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = constant_expression(s)?;
@ -445,7 +445,7 @@ pub fn constant_range(s: Span) -> IResult<Span, ConstantRange> {
}
#[parser(MaybeRecursive)]
pub fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
pub(crate) fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
let (s, a) = constant_expression(s)?;
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
let (s, c) = constant_expression(s)?;
@ -454,7 +454,7 @@ pub fn constant_indexed_range(s: Span) -> IResult<Span, ConstantIndexedRange> {
#[packrat_parser]
#[parser]
pub fn expression(s: Span) -> IResult<Span, Expression> {
pub(crate) fn expression(s: Span) -> IResult<Span, Expression> {
alt((
expression_unary,
map(inc_or_dec_expression, |x| {
@ -476,7 +476,7 @@ pub fn expression(s: Span) -> IResult<Span, Expression> {
}
#[parser]
pub fn expression_unary(s: Span) -> IResult<Span, Expression> {
pub(crate) fn expression_unary(s: Span) -> IResult<Span, Expression> {
let (s, x) = unary_operator(s)?;
let (s, y) = many0(attribute_instance)(s)?;
let (s, z) = primary(s)?;
@ -487,7 +487,7 @@ pub fn expression_unary(s: Span) -> IResult<Span, Expression> {
}
#[parser]
pub fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
pub(crate) fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
let (s, a) = paren(operator_assignment)(s)?;
Ok((
s,
@ -496,7 +496,7 @@ pub fn expression_operator_assignment(s: Span) -> IResult<Span, Expression> {
}
#[parser(MaybeRecursive)]
pub fn expression_binary(s: Span) -> IResult<Span, Expression> {
pub(crate) fn expression_binary(s: Span) -> IResult<Span, Expression> {
let (s, a) = expression(s)?;
let (s, b) = binary_operator(s)?;
let (s, c) = many0(attribute_instance)(s)?;
@ -510,7 +510,7 @@ pub fn expression_binary(s: Span) -> IResult<Span, Expression> {
}
#[parser]
pub fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
pub(crate) fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression> {
let (s, a) = keyword("tagged")(s)?;
let (s, b) = member_identifier(s)?;
let (s, c) = opt(expression)(s)?;
@ -518,7 +518,7 @@ pub fn tagged_union_expression(s: Span) -> IResult<Span, TaggedUnionExpression>
}
#[parser(MaybeRecursive)]
pub fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
pub(crate) fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
let (s, a) = expression(s)?;
let (s, b) = keyword("inside")(s)?;
let (s, c) = brace(open_range_list)(s)?;
@ -526,7 +526,7 @@ pub fn inside_expression(s: Span) -> IResult<Span, InsideExpression> {
}
#[parser]
pub fn value_range(s: Span) -> IResult<Span, ValueRange> {
pub(crate) fn value_range(s: Span) -> IResult<Span, ValueRange> {
alt((
value_range_binary,
map(expression, |x| ValueRange::Expression(Box::new(x))),
@ -534,7 +534,7 @@ pub fn value_range(s: Span) -> IResult<Span, ValueRange> {
}
#[parser]
pub fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
pub(crate) fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
let (s, a) = bracket(triple(expression, symbol(":"), expression))(s)?;
Ok((
s,
@ -543,7 +543,7 @@ pub fn value_range_binary(s: Span) -> IResult<Span, ValueRange> {
}
#[parser]
pub fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
pub(crate) fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
alt((
mintypmax_expression_ternary,
map(expression, |x| MintypmaxExpression::Expression(Box::new(x))),
@ -551,7 +551,7 @@ pub fn mintypmax_expression(s: Span) -> IResult<Span, MintypmaxExpression> {
}
#[parser(MaybeRecursive)]
pub fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpression> {
pub(crate) fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = expression(s)?;
@ -566,7 +566,7 @@ pub fn mintypmax_expression_ternary(s: Span) -> IResult<Span, MintypmaxExpressio
}
#[parser(MaybeRecursive)]
pub fn module_path_conditional_expression(
pub(crate) fn module_path_conditional_expression(
s: Span,
) -> IResult<Span, ModulePathConditionalExpression> {
let (s, a) = module_path_expression(s)?;
@ -584,7 +584,7 @@ pub fn module_path_conditional_expression(
}
#[parser]
pub fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
pub(crate) fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
alt((
map(module_path_primary, |x| {
ModulePathExpression::ModulePathPrimary(Box::new(x))
@ -598,7 +598,7 @@ pub fn module_path_expression(s: Span) -> IResult<Span, ModulePathExpression> {
}
#[parser]
pub fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathExpression> {
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)?;
let (s, c) = module_path_primary(s)?;
@ -609,7 +609,7 @@ pub fn module_path_expression_unary(s: Span) -> IResult<Span, ModulePathExpressi
}
#[parser(MaybeRecursive)]
pub fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePathExpression> {
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)?;
let (s, c) = many0(attribute_instance)(s)?;
@ -623,7 +623,7 @@ pub fn module_path_expression_binary(s: Span) -> IResult<Span, ModulePathExpress
}
#[parser]
pub fn module_path_mintypmax_expression(s: Span) -> IResult<Span, ModulePathMintypmaxExpression> {
pub(crate) fn module_path_mintypmax_expression(s: Span) -> IResult<Span, ModulePathMintypmaxExpression> {
alt((
module_path_mintypmax_expression_ternary,
map(module_path_expression, |x| {
@ -633,7 +633,7 @@ pub fn module_path_mintypmax_expression(s: Span) -> IResult<Span, ModulePathMint
}
#[parser(MaybeRecursive)]
pub fn module_path_mintypmax_expression_ternary(
pub(crate) fn module_path_mintypmax_expression_ternary(
s: Span,
) -> IResult<Span, ModulePathMintypmaxExpression> {
let (s, a) = module_path_expression(s)?;
@ -650,7 +650,7 @@ pub fn module_path_mintypmax_expression_ternary(
}
#[parser]
pub fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
pub(crate) fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
alt((
map(constant_range, |x| {
PartSelectRange::ConstantRange(Box::new(x))
@ -662,7 +662,7 @@ pub fn part_select_range(s: Span) -> IResult<Span, PartSelectRange> {
}
#[parser(MaybeRecursive)]
pub fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
pub(crate) fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
let (s, a) = expression(s)?;
let (s, b) = alt((symbol("+:"), symbol("-:")))(s)?;
let (s, c) = constant_expression(s)?;
@ -670,7 +670,7 @@ pub fn indexed_range(s: Span) -> IResult<Span, IndexedRange> {
}
#[parser]
pub fn genvar_expression(s: Span) -> IResult<Span, GenvarExpression> {
pub(crate) fn genvar_expression(s: Span) -> IResult<Span, GenvarExpression> {
let (s, a) = constant_expression(s)?;
Ok((s, GenvarExpression { nodes: (a,) }))
}

View File

@ -165,7 +165,7 @@ pub struct UnbasedUnsizedLiteral {
#[packrat_parser]
#[parser]
pub fn number(s: Span) -> IResult<Span, Number> {
pub(crate) fn number(s: Span) -> IResult<Span, Number> {
alt((
map(real_number, |x| Number::RealNumber(Box::new(x))),
map(integral_number, |x| Number::IntegralNumber(Box::new(x))),
@ -173,7 +173,7 @@ pub fn number(s: Span) -> IResult<Span, Number> {
}
#[parser]
pub fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
pub(crate) fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
alt((
map(octal_number, |x| IntegralNumber::OctalNumber(Box::new(x))),
map(binary_number, |x| IntegralNumber::BinaryNumber(Box::new(x))),
@ -185,7 +185,7 @@ pub fn integral_number(s: Span) -> IResult<Span, IntegralNumber> {
}
#[parser]
pub fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
pub(crate) fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
alt((
decimal_number_base_unsigned,
decimal_number_base_x_number,
@ -197,7 +197,7 @@ pub fn decimal_number(s: Span) -> IResult<Span, DecimalNumber> {
}
#[parser]
pub fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
pub(crate) fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = decimal_base(s)?;
let (s, c) = unsigned_number(s)?;
@ -208,7 +208,7 @@ pub fn decimal_number_base_unsigned(s: Span) -> IResult<Span, DecimalNumber> {
}
#[parser]
pub fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumber> {
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)?;
let (s, c) = x_number(s)?;
@ -219,7 +219,7 @@ pub fn decimal_number_base_x_number(s: Span) -> IResult<Span, DecimalNumber> {
}
#[parser]
pub fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumber> {
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)?;
let (s, c) = z_number(s)?;
@ -230,7 +230,7 @@ pub fn decimal_number_base_z_number(s: Span) -> IResult<Span, DecimalNumber> {
}
#[parser]
pub fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
pub(crate) fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = binary_base(s)?;
let (s, c) = binary_value(s)?;
@ -238,7 +238,7 @@ pub fn binary_number(s: Span) -> IResult<Span, BinaryNumber> {
}
#[parser]
pub fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
pub(crate) fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = octal_base(s)?;
let (s, c) = octal_value(s)?;
@ -246,7 +246,7 @@ pub fn octal_number(s: Span) -> IResult<Span, OctalNumber> {
}
#[parser]
pub fn hex_number(s: Span) -> IResult<Span, HexNumber> {
pub(crate) fn hex_number(s: Span) -> IResult<Span, HexNumber> {
let (s, a) = opt(size)(s)?;
let (s, b) = hex_base(s)?;
let (s, c) = hex_value(s)?;
@ -254,7 +254,7 @@ pub fn hex_number(s: Span) -> IResult<Span, HexNumber> {
}
#[parser]
pub fn sign(s: Span) -> IResult<Span, Sign> {
pub(crate) fn sign(s: Span) -> IResult<Span, Sign> {
alt((
map(symbol("+"), |x| Sign::Plus(Box::new(x))),
map(symbol("-"), |x| Sign::Minus(Box::new(x))),
@ -262,19 +262,19 @@ pub fn sign(s: Span) -> IResult<Span, Sign> {
}
#[parser]
pub fn size(s: Span) -> IResult<Span, Size> {
pub(crate) fn size(s: Span) -> IResult<Span, Size> {
let (s, a) = non_zero_unsigned_number(s)?;
Ok((s, Size { nodes: (a,) }))
}
#[parser]
pub fn non_zero_unsigned_number(s: Span) -> IResult<Span, NonZeroUnsignedNumber> {
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]
pub fn non_zero_unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -283,7 +283,7 @@ pub fn non_zero_unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn real_number(s: Span) -> IResult<Span, RealNumber> {
pub(crate) fn real_number(s: Span) -> IResult<Span, RealNumber> {
alt((
real_number_floating,
map(fixed_point_number, |x| {
@ -293,7 +293,7 @@ pub fn real_number(s: Span) -> IResult<Span, RealNumber> {
}
#[parser]
pub fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
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)?;
let (s, c) = exp(s)?;
@ -308,7 +308,7 @@ pub fn real_number_floating(s: Span) -> IResult<Span, RealNumber> {
}
#[parser]
pub fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
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 {
nodes: (x.into(), vec![]),
@ -318,19 +318,19 @@ pub fn fixed_point_number(s: Span) -> IResult<Span, FixedPointNumber> {
}
#[parser]
pub fn exp(s: Span) -> IResult<Span, Exp> {
pub(crate) fn exp(s: Span) -> IResult<Span, Exp> {
let (s, a) = alt((symbol("e"), symbol("E")))(s)?;
Ok((s, Exp { nodes: (a,) }))
}
#[parser]
pub fn unsigned_number(s: Span) -> IResult<Span, UnsignedNumber> {
pub(crate) fn unsigned_number(s: Span) -> IResult<Span, UnsignedNumber> {
let (s, a) = ws(unsigned_number_impl)(s)?;
Ok((s, UnsignedNumber { nodes: a }))
}
#[parser]
pub fn unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -339,13 +339,13 @@ pub fn unsigned_number_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
pub(crate) fn binary_value(s: Span) -> IResult<Span, BinaryValue> {
let (s, a) = ws(binary_value_impl)(s)?;
Ok((s, BinaryValue { nodes: a }))
}
#[parser]
pub fn binary_value_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -354,13 +354,13 @@ pub fn binary_value_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn octal_value(s: Span) -> IResult<Span, OctalValue> {
pub(crate) fn octal_value(s: Span) -> IResult<Span, OctalValue> {
let (s, a) = ws(octal_value_impl)(s)?;
Ok((s, OctalValue { nodes: a }))
}
#[parser]
pub fn octal_value_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -369,13 +369,13 @@ pub fn octal_value_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn hex_value(s: Span) -> IResult<Span, HexValue> {
pub(crate) fn hex_value(s: Span) -> IResult<Span, HexValue> {
let (s, a) = ws(hex_value_impl)(s)?;
Ok((s, HexValue { nodes: a }))
}
#[parser]
pub fn hex_value_impl(s: Span) -> IResult<Span, Locate> {
pub(crate) fn hex_value_impl(s: Span) -> IResult<Span, Locate> {
let (s, a) = is_a("0123456789abcdefABCDEFxXzZ?")(s)?;
let (s, a) = fold_many0(
alt((tag("_"), is_a("0123456789abcdefABCDEFxXzZ?"))),
@ -386,61 +386,61 @@ pub fn hex_value_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
pub(crate) fn decimal_base(s: Span) -> IResult<Span, DecimalBase> {
let (s, a) = ws(decimal_base_impl)(s)?;
Ok((s, DecimalBase { nodes: a }))
}
#[parser]
pub fn decimal_base_impl(s: Span) -> IResult<Span, Locate> {
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, a.into()))
}
#[parser]
pub fn binary_base(s: Span) -> IResult<Span, BinaryBase> {
pub(crate) fn binary_base(s: Span) -> IResult<Span, BinaryBase> {
let (s, a) = ws(binary_base_impl)(s)?;
Ok((s, BinaryBase { nodes: a }))
}
#[parser]
pub fn binary_base_impl(s: Span) -> IResult<Span, Locate> {
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, a.into()))
}
#[parser]
pub fn octal_base(s: Span) -> IResult<Span, OctalBase> {
pub(crate) fn octal_base(s: Span) -> IResult<Span, OctalBase> {
let (s, a) = ws(octal_base_impl)(s)?;
Ok((s, OctalBase { nodes: a }))
}
#[parser]
pub fn octal_base_impl(s: Span) -> IResult<Span, Locate> {
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, a.into()))
}
#[parser]
pub fn hex_base(s: Span) -> IResult<Span, HexBase> {
pub(crate) fn hex_base(s: Span) -> IResult<Span, HexBase> {
let (s, a) = ws(hex_base_impl)(s)?;
Ok((s, HexBase { nodes: a }))
}
#[parser]
pub fn hex_base_impl(s: Span) -> IResult<Span, Locate> {
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, a.into()))
}
#[parser]
pub fn x_number(s: Span) -> IResult<Span, XNumber> {
pub(crate) fn x_number(s: Span) -> IResult<Span, XNumber> {
let (s, a) = ws(x_number_impl)(s)?;
Ok((s, XNumber { nodes: a }))
}
#[parser]
pub fn x_number_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -449,13 +449,13 @@ pub fn x_number_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn z_number(s: Span) -> IResult<Span, ZNumber> {
pub(crate) fn z_number(s: Span) -> IResult<Span, ZNumber> {
let (s, a) = ws(z_number_impl)(s)?;
Ok((s, ZNumber { nodes: a }))
}
#[parser]
pub fn z_number_impl(s: Span) -> IResult<Span, Locate> {
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| {
concat(acc, item).unwrap()
@ -464,7 +464,7 @@ pub fn z_number_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn unbased_unsized_literal(s: Span) -> IResult<Span, UnbasedUnsizedLiteral> {
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

@ -35,7 +35,7 @@ pub struct BinaryModulePathOperator {
#[packrat_parser]
#[parser]
pub fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
pub(crate) fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
let (s, a) = alt((
symbol("+"),
symbol("-"),
@ -53,7 +53,7 @@ pub fn unary_operator(s: Span) -> IResult<Span, UnaryOperator> {
}
#[parser]
pub fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
pub(crate) fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
let (s, a) = alt((
alt((
symbol("+"),
@ -93,13 +93,13 @@ pub fn binary_operator(s: Span) -> IResult<Span, BinaryOperator> {
}
#[parser]
pub fn inc_or_dec_operator(s: Span) -> IResult<Span, IncOrDecOperator> {
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]
pub fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePathOperator> {
pub(crate) fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePathOperator> {
let (s, a) = alt((
symbol("!"),
symbol("&"),
@ -115,7 +115,7 @@ pub fn unary_module_path_operator(s: Span) -> IResult<Span, UnaryModulePathOpera
}
#[parser]
pub fn binary_module_path_operator(s: Span) -> IResult<Span, BinaryModulePathOperator> {
pub(crate) fn binary_module_path_operator(s: Span) -> IResult<Span, BinaryModulePathOperator> {
let (s, a) = alt((
symbol("=="),
symbol("!="),

View File

@ -254,7 +254,7 @@ pub struct Cast {
#[packrat_parser]
#[parser]
pub fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
alt((
map(keyword("null"), |x| ConstantPrimary::Null(Box::new(x))),
map(primary_literal, |x| {
@ -289,7 +289,7 @@ pub fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
}
#[parser]
pub fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -299,7 +299,7 @@ pub fn constant_primary_ps_parameter(s: Span) -> IResult<Span, ConstantPrimary>
}
#[parser]
pub fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -309,7 +309,7 @@ pub fn constant_primary_specparam(s: Span) -> IResult<Span, ConstantPrimary> {
}
#[parser]
pub fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -319,7 +319,7 @@ pub fn constant_primary_formal_port(s: Span) -> IResult<Span, ConstantPrimary> {
}
#[parser]
pub fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -329,7 +329,7 @@ pub fn constant_primary_enum(s: Span) -> IResult<Span, ConstantPrimary> {
}
#[parser]
pub fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -339,7 +339,7 @@ pub fn constant_primary_concatenation(s: Span) -> IResult<Span, ConstantPrimary>
}
#[parser]
pub fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, ConstantPrimary> {
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)?;
Ok((
@ -351,7 +351,7 @@ pub fn constant_primary_multiple_concatenation(s: Span) -> IResult<Span, Constan
}
#[parser]
pub fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
pub(crate) fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantPrimary> {
let (s, a) = paren(constant_mintypmax_expression)(s)?;
Ok((
s,
@ -362,7 +362,7 @@ pub fn constant_primary_mintypmax_expression(s: Span) -> IResult<Span, ConstantP
}
#[parser]
pub fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
pub(crate) fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
alt((
map(number, |x| ModulePathPrimary::Number(Box::new(x))),
map(identifier, |x| ModulePathPrimary::Identifier(Box::new(x))),
@ -380,7 +380,9 @@ pub fn module_path_primary(s: Span) -> IResult<Span, ModulePathPrimary> {
}
#[parser]
pub fn module_path_primary_mintypmax_expression(s: Span) -> IResult<Span, ModulePathPrimary> {
pub(crate) fn module_path_primary_mintypmax_expression(
s: Span,
) -> IResult<Span, ModulePathPrimary> {
let (s, a) = paren(module_path_mintypmax_expression)(s)?;
Ok((
s,
@ -390,7 +392,7 @@ pub fn module_path_primary_mintypmax_expression(s: Span) -> IResult<Span, Module
#[packrat_parser]
#[parser]
pub fn primary(s: Span) -> IResult<Span, Primary> {
pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
alt((
map(keyword("this"), |x| Primary::This(Box::new(x))),
map(symbol("$"), |x| Primary::Dollar(Box::new(x))),
@ -401,6 +403,7 @@ pub fn primary(s: Span) -> IResult<Span, Primary> {
Primary::EmptyUnpackedArrayConcatenation(Box::new(x))
}),
primary_concatenation,
primary_multiple_concatenation,
map(function_subroutine_call, |x| {
Primary::FunctionSubroutineCall(Box::new(x))
}),
@ -420,7 +423,7 @@ pub fn primary(s: Span) -> IResult<Span, Primary> {
}
#[parser]
pub fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
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)?;
let (s, c) = select(s)?;
@ -431,7 +434,7 @@ pub fn primary_hierarchical(s: Span) -> IResult<Span, Primary> {
}
#[parser]
pub fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
pub(crate) fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
let (s, a) = concatenation(s)?;
let (s, b) = opt(bracket(range_expression))(s)?;
Ok((
@ -441,7 +444,7 @@ pub fn primary_concatenation(s: Span) -> IResult<Span, Primary> {
}
#[parser]
pub fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
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)?;
Ok((
@ -451,7 +454,7 @@ pub fn primary_multiple_concatenation(s: Span) -> IResult<Span, Primary> {
}
#[parser]
pub fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
pub(crate) fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
let (s, a) = paren(mintypmax_expression)(s)?;
Ok((
s,
@ -460,7 +463,9 @@ pub fn primary_mintypmax_expression(s: Span) -> IResult<Span, Primary> {
}
#[parser]
pub fn class_qualifier_or_package_scope(s: Span) -> IResult<Span, ClassQualifierOrPackageScope> {
pub(crate) fn class_qualifier_or_package_scope(
s: Span,
) -> IResult<Span, ClassQualifierOrPackageScope> {
alt((
map(class_qualifier, |x| {
ClassQualifierOrPackageScope::ClassQualifier(Box::new(x))
@ -472,14 +477,14 @@ pub fn class_qualifier_or_package_scope(s: Span) -> IResult<Span, ClassQualifier
}
#[parser(MaybeRecursive)]
pub fn class_qualifier(s: Span) -> IResult<Span, ClassQualifier> {
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]
pub fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
pub(crate) fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
alt((
map(expression, |x| RangeExpression::Expression(Box::new(x))),
map(part_select_range, |x| {
@ -490,7 +495,7 @@ pub fn range_expression(s: Span) -> IResult<Span, RangeExpression> {
#[packrat_parser]
#[parser]
pub fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
pub(crate) fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
alt((
map(time_literal, |x| PrimaryLiteral::TimeLiteral(Box::new(x))),
map(number, |x| PrimaryLiteral::Number(Box::new(x))),
@ -504,12 +509,12 @@ pub fn primary_literal(s: Span) -> IResult<Span, PrimaryLiteral> {
}
#[parser]
pub fn time_literal(s: Span) -> IResult<Span, TimeLiteral> {
pub(crate) fn time_literal(s: Span) -> IResult<Span, TimeLiteral> {
alt((time_literal_unsigned, time_literal_fixed_point))(s)
}
#[parser]
pub fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
pub(crate) fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
let (s, a) = unsigned_number(s)?;
let (s, b) = time_unit(s)?;
Ok((
@ -519,7 +524,7 @@ pub fn time_literal_unsigned(s: Span) -> IResult<Span, TimeLiteral> {
}
#[parser]
pub fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
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)?;
Ok((
@ -529,7 +534,7 @@ pub fn time_literal_fixed_point(s: Span) -> IResult<Span, TimeLiteral> {
}
#[parser]
pub fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
pub(crate) fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
alt((
map(keyword("s"), |x| TimeUnit::S(Box::new(x))),
map(keyword("ms"), |x| TimeUnit::MS(Box::new(x))),
@ -541,7 +546,7 @@ pub fn time_unit(s: Span) -> IResult<Span, TimeUnit> {
}
#[parser]
pub fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
pub(crate) fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
alt((
map(
triple(keyword("this"), symbol("."), keyword("super")),
@ -555,13 +560,13 @@ pub fn implicit_class_handle(s: Span) -> IResult<Span, ImplicitClassHandle> {
}
#[parser]
pub fn bit_select(s: Span) -> IResult<Span, BitSelect> {
pub(crate) fn bit_select(s: Span) -> IResult<Span, BitSelect> {
let (s, a) = many0(bracket(expression))(s)?;
Ok((s, BitSelect { nodes: (a,) }))
}
#[parser]
pub fn select(s: Span) -> IResult<Span, Select> {
pub(crate) fn select(s: Span) -> IResult<Span, Select> {
let (s, a) = opt(triple(
many0(triple(symbol("."), member_identifier, bit_select)),
symbol("."),
@ -573,7 +578,7 @@ pub fn select(s: Span) -> IResult<Span, Select> {
}
#[parser]
pub fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
pub(crate) fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
let (s, a) = opt(triple(
many0(triple(symbol("."), member_identifier, bit_select)),
symbol("."),
@ -584,13 +589,13 @@ pub fn nonrange_select(s: Span) -> IResult<Span, NonrangeSelect> {
}
#[parser]
pub fn constant_bit_select(s: Span) -> IResult<Span, ConstantBitSelect> {
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]
pub fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
pub(crate) fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
let (s, a) = opt(triple(
many0(triple(symbol("."), member_identifier, constant_bit_select)),
symbol("."),
@ -602,7 +607,7 @@ pub fn constant_select(s: Span) -> IResult<Span, ConstantSelect> {
}
#[parser(MaybeRecursive)]
pub fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
pub(crate) fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
let (s, a) = casting_type(s)?;
let (s, b) = symbol("'")(s)?;
let (s, c) = paren(constant_expression)(s)?;
@ -610,13 +615,13 @@ pub fn constant_cast(s: Span) -> IResult<Span, ConstantCast> {
}
#[parser]
pub fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
pub(crate) fn constant_let_expression(s: Span) -> IResult<Span, ConstantLetExpression> {
let (s, a) = let_expression(s)?;
Ok((s, ConstantLetExpression { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn cast(s: Span) -> IResult<Span, Cast> {
pub(crate) fn cast(s: Span) -> IResult<Span, Cast> {
let (s, a) = casting_type(s)?;
let (s, b) = symbol("'")(s)?;
let (s, c) = paren(expression)(s)?;

View File

@ -16,13 +16,13 @@ pub struct StringLiteral {
// -----------------------------------------------------------------------------
#[parser]
pub fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
pub(crate) fn string_literal(s: Span) -> IResult<Span, StringLiteral> {
let (s, a) = ws(string_literal_impl)(s)?;
Ok((s, StringLiteral { nodes: a }))
}
#[parser]
pub fn string_literal_impl(s: Span) -> IResult<Span, Locate> {
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)?;
let (s, c) = tag("\"")(s)?;

View File

@ -170,13 +170,13 @@ pub enum ArrayMethodName {
// -----------------------------------------------------------------------------
#[parser]
pub fn constant_function_call(s: Span) -> IResult<Span, ConstantFunctionCall> {
pub(crate) fn constant_function_call(s: Span) -> IResult<Span, ConstantFunctionCall> {
let (s, a) = function_subroutine_call(s)?;
Ok((s, ConstantFunctionCall { nodes: (a,) }))
}
#[parser]
pub fn tf_call(s: Span) -> IResult<Span, TfCall> {
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)?;
let (s, c) = opt(paren(list_of_arguments))(s)?;
@ -184,7 +184,7 @@ pub fn tf_call(s: Span) -> IResult<Span, TfCall> {
}
#[parser]
pub fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
pub(crate) fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
alt((
system_tf_call_arg_optional,
system_tf_call_arg_data_type,
@ -193,7 +193,7 @@ pub fn system_tf_call(s: Span) -> IResult<Span, SystemTfCall> {
}
#[parser]
pub fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall> {
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)?;
Ok((
@ -203,7 +203,7 @@ pub fn system_tf_call_arg_optional(s: Span) -> IResult<Span, SystemTfCall> {
}
#[parser]
pub fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCall> {
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)?;
Ok((
@ -213,7 +213,7 @@ pub fn system_tf_call_arg_data_type(s: Span) -> IResult<Span, SystemTfCall> {
}
#[parser]
pub fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCall> {
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(
list(symbol(","), opt(expression)),
@ -227,7 +227,7 @@ pub fn system_tf_call_arg_expression(s: Span) -> IResult<Span, SystemTfCall> {
#[packrat_parser]
#[parser]
pub fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
pub(crate) fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
alt((
map(tf_call, |x| SubroutineCall::TfCall(Box::new(x))),
map(system_tf_call, |x| {
@ -239,7 +239,7 @@ pub fn subroutine_call(s: Span) -> IResult<Span, SubroutineCall> {
}
#[parser]
pub fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
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)?;
Ok((
@ -249,17 +249,17 @@ pub fn subroutine_call_randomize(s: Span) -> IResult<Span, SubroutineCall> {
}
#[parser]
pub fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
pub(crate) fn function_subroutine_call(s: Span) -> IResult<Span, FunctionSubroutineCall> {
map(subroutine_call, |x| FunctionSubroutineCall { nodes: (x,) })(s)
}
#[parser]
pub fn list_of_arguments(s: Span) -> IResult<Span, ListOfArguments> {
pub(crate) fn list_of_arguments(s: Span) -> IResult<Span, ListOfArguments> {
alt((list_of_arguments_ordered, list_of_arguments_named))(s)
}
#[parser(MaybeRecursive)]
pub fn list_of_arguments_ordered(s: Span) -> IResult<Span, ListOfArguments> {
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((
symbol(","),
@ -274,7 +274,7 @@ pub fn list_of_arguments_ordered(s: Span) -> IResult<Span, ListOfArguments> {
}
#[parser]
pub fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
pub(crate) fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
let (s, a) = symbol(".")(s)?;
let (s, b) = identifier(s)?;
let (s, c) = paren(opt(expression))(s)?;
@ -293,7 +293,7 @@ pub fn list_of_arguments_named(s: Span) -> IResult<Span, ListOfArguments> {
}
#[parser(MaybeRecursive)]
pub fn method_call(s: Span) -> IResult<Span, MethodCall> {
pub(crate) fn method_call(s: Span) -> IResult<Span, MethodCall> {
let (s, a) = method_call_root(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = method_call_body(s)?;
@ -302,7 +302,7 @@ pub fn method_call(s: Span) -> IResult<Span, MethodCall> {
}
#[parser]
pub fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
pub(crate) fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
alt((
method_call_body_user,
map(built_in_method_call, |x| {
@ -312,7 +312,7 @@ pub fn method_call_body(s: Span) -> IResult<Span, MethodCallBody> {
}
#[parser]
pub fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
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)?;
let (s, c) = opt(paren(list_of_arguments))(s)?;
@ -323,7 +323,7 @@ pub fn method_call_body_user(s: Span) -> IResult<Span, MethodCallBody> {
}
#[parser]
pub fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
pub(crate) fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
alt((
map(array_manipulation_call, |x| {
BuiltInMethodCall::ArrayManipulationCall(Box::new(x))
@ -335,7 +335,7 @@ pub fn built_in_method_call(s: Span) -> IResult<Span, BuiltInMethodCall> {
}
#[parser]
pub fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulationCall> {
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)?;
let (s, c) = opt(paren(list_of_arguments))(s)?;
@ -349,7 +349,7 @@ pub fn array_manipulation_call(s: Span) -> IResult<Span, ArrayManipulationCall>
}
#[parser]
pub fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
pub(crate) fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
let (s, a) = keyword("randomize")(s)?;
let (s, b) = many0(attribute_instance)(s)?;
let (s, c) = opt(paren(opt(variable_identifier_list_or_null)))(s)?;
@ -367,7 +367,7 @@ pub fn randomize_call(s: Span) -> IResult<Span, RandomizeCall> {
}
#[parser]
pub fn variable_identifier_list_or_null(s: Span) -> IResult<Span, VariableIdentifierListOrNull> {
pub(crate) fn variable_identifier_list_or_null(s: Span) -> IResult<Span, VariableIdentifierListOrNull> {
alt((
map(variable_identifier_list, |x| {
VariableIdentifierListOrNull::VariableIdentifierList(Box::new(x))
@ -379,7 +379,7 @@ pub fn variable_identifier_list_or_null(s: Span) -> IResult<Span, VariableIdenti
}
#[parser]
pub fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
pub(crate) fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
alt((
map(primary, |x| MethodCallRoot::Primary(Box::new(x))),
map(implicit_class_handle, |x| {
@ -389,7 +389,7 @@ pub fn method_call_root(s: Span) -> IResult<Span, MethodCallRoot> {
}
#[parser]
pub fn array_method_name(s: Span) -> IResult<Span, ArrayMethodName> {
pub(crate) fn array_method_name(s: Span) -> IResult<Span, ArrayMethodName> {
alt((
map(keyword("unique"), |x| ArrayMethodName::Unique(Box::new(x))),
map(keyword("and"), |x| ArrayMethodName::And(Box::new(x))),

View File

@ -19,7 +19,7 @@ pub struct AttrSpec {
// -----------------------------------------------------------------------------
#[parser]
pub fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
pub(crate) fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
let (s, a) = symbol("(*")(s)?;
let (s, b) = list(symbol(","), attr_spec)(s)?;
let (s, c) = symbol("*)")(s)?;
@ -27,7 +27,7 @@ pub fn attribute_instance(s: Span) -> IResult<Span, AttributeInstance> {
}
#[parser]
pub fn attr_spec(s: Span) -> IResult<Span, AttrSpec> {
pub(crate) fn attr_spec(s: Span) -> IResult<Span, AttrSpec> {
let (s, a) = identifier(s)?;
let (s, b) = opt(pair(symbol("="), constant_expression))(s)?;
Ok((s, AttrSpec { nodes: (a, b) }))

View File

@ -14,12 +14,12 @@ pub struct Comment {
// -----------------------------------------------------------------------------
#[parser]
pub fn comment(s: Span) -> IResult<Span, Comment> {
pub(crate) fn comment(s: Span) -> IResult<Span, Comment> {
alt((one_line_comment, block_comment))(s)
}
#[parser]
pub fn one_line_comment(s: Span) -> IResult<Span, Comment> {
pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
let (s, a) = tag("//")(s)?;
let (s, b) = is_not("\n")(s)?;
let a = concat(a, b).unwrap();
@ -27,7 +27,7 @@ pub fn one_line_comment(s: Span) -> IResult<Span, Comment> {
}
#[parser]
pub fn block_comment(s: Span) -> IResult<Span, Comment> {
pub(crate) fn block_comment(s: Span) -> IResult<Span, Comment> {
let (s, a) = tag("/*")(s)?;
let (s, b) = is_not("*/")(s)?;
let (s, c) = tag("*/")(s)?;

View File

@ -11,9 +11,10 @@ use nom_packrat::packrat_parser;
// -----------------------------------------------------------------------------
pub const AZ_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
pub const AZ09_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
pub const AZ09_DOLLAR: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";
pub(crate) const AZ_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
pub(crate) const AZ09_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
pub(crate) const AZ09_DOLLAR: &str =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";
#[derive(Clone, Debug, Node)]
pub struct ArrayIdentifier {
@ -540,32 +541,33 @@ pub enum PackageScopeOrClassScope {
// -----------------------------------------------------------------------------
#[allow(dead_code)]
#[parser]
pub fn array_identifier(s: Span) -> IResult<Span, ArrayIdentifier> {
pub(crate) fn array_identifier(s: Span) -> IResult<Span, ArrayIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ArrayIdentifier { nodes: (a,) }))
}
#[parser]
pub fn block_identifier(s: Span) -> IResult<Span, BlockIdentifier> {
pub(crate) fn block_identifier(s: Span) -> IResult<Span, BlockIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, BlockIdentifier { nodes: (a,) }))
}
#[parser]
pub fn bin_identifier(s: Span) -> IResult<Span, BinIdentifier> {
pub(crate) fn bin_identifier(s: Span) -> IResult<Span, BinIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, BinIdentifier { nodes: (a,) }))
}
#[parser]
pub fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
pub(crate) fn c_identifier(s: Span) -> IResult<Span, CIdentifier> {
let (s, a) = ws(c_identifier_impl)(s)?;
Ok((s, CIdentifier { nodes: a }))
}
#[parser]
pub fn c_identifier_impl(s: Span) -> IResult<Span, Locate> {
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)?;
let a = if let Some(b) = b {
@ -581,154 +583,160 @@ pub fn c_identifier_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn cell_identifier(s: Span) -> IResult<Span, CellIdentifier> {
pub(crate) fn cell_identifier(s: Span) -> IResult<Span, CellIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CellIdentifier { nodes: (a,) }))
}
#[parser]
pub fn checker_identifier(s: Span) -> IResult<Span, CheckerIdentifier> {
pub(crate) fn checker_identifier(s: Span) -> IResult<Span, CheckerIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CheckerIdentifier { nodes: (a,) }))
}
#[parser]
pub fn class_identifier(s: Span) -> IResult<Span, ClassIdentifier> {
pub(crate) fn class_identifier(s: Span) -> IResult<Span, ClassIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ClassIdentifier { nodes: (a,) }))
}
#[parser]
pub fn class_variable_identifier(s: Span) -> IResult<Span, ClassVariableIdentifier> {
pub(crate) fn class_variable_identifier(s: Span) -> IResult<Span, ClassVariableIdentifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, ClassVariableIdentifier { nodes: (a,) }))
}
#[parser]
pub fn clocking_identifier(s: Span) -> IResult<Span, ClockingIdentifier> {
pub(crate) fn clocking_identifier(s: Span) -> IResult<Span, ClockingIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ClockingIdentifier { nodes: (a,) }))
}
#[parser]
pub fn config_identifier(s: Span) -> IResult<Span, ConfigIdentifier> {
pub(crate) fn config_identifier(s: Span) -> IResult<Span, ConfigIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConfigIdentifier { nodes: (a,) }))
}
#[parser]
pub fn const_identifier(s: Span) -> IResult<Span, ConstIdentifier> {
pub(crate) fn const_identifier(s: Span) -> IResult<Span, ConstIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConstIdentifier { nodes: (a,) }))
}
#[parser]
pub fn constraint_identifier(s: Span) -> IResult<Span, ConstraintIdentifier> {
pub(crate) fn constraint_identifier(s: Span) -> IResult<Span, ConstraintIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ConstraintIdentifier { nodes: (a,) }))
}
#[parser]
pub fn covergroup_identifier(s: Span) -> IResult<Span, CovergroupIdentifier> {
pub(crate) fn covergroup_identifier(s: Span) -> IResult<Span, CovergroupIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CovergroupIdentifier { nodes: (a,) }))
}
#[allow(dead_code)]
#[parser]
pub fn covergroup_variable_identifier(s: Span) -> IResult<Span, CovergroupVariableIdentifier> {
pub(crate) fn covergroup_variable_identifier(
s: Span,
) -> IResult<Span, CovergroupVariableIdentifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, CovergroupVariableIdentifier { nodes: (a,) }))
}
#[parser]
pub fn cover_point_identifier(s: Span) -> IResult<Span, CoverPointIdentifier> {
pub(crate) fn cover_point_identifier(s: Span) -> IResult<Span, CoverPointIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CoverPointIdentifier { nodes: (a,) }))
}
#[parser]
pub fn cross_identifier(s: Span) -> IResult<Span, CrossIdentifier> {
pub(crate) fn cross_identifier(s: Span) -> IResult<Span, CrossIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, CrossIdentifier { nodes: (a,) }))
}
#[parser]
pub fn dynamic_array_variable_identifier(s: Span) -> IResult<Span, DynamicArrayVariableIdentifier> {
pub(crate) fn dynamic_array_variable_identifier(
s: Span,
) -> IResult<Span, DynamicArrayVariableIdentifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, DynamicArrayVariableIdentifier { nodes: (a,) }))
}
#[parser]
pub fn enum_identifier(s: Span) -> IResult<Span, EnumIdentifier> {
pub(crate) fn enum_identifier(s: Span) -> IResult<Span, EnumIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, EnumIdentifier { nodes: (a,) }))
}
#[parser]
pub fn escaped_identifier(s: Span) -> IResult<Span, EscapedIdentifier> {
pub(crate) fn escaped_identifier(s: Span) -> IResult<Span, EscapedIdentifier> {
let (s, a) = ws(escaped_identifier_impl)(s)?;
Ok((s, EscapedIdentifier { nodes: a }))
}
#[parser]
pub fn escaped_identifier_impl(s: Span) -> IResult<Span, Locate> {
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)?;
let a = concat(a, b).unwrap();
Ok((s, a.into()))
}
#[allow(dead_code)]
#[parser]
pub fn formal_identifier(s: Span) -> IResult<Span, FormalIdentifier> {
pub(crate) fn formal_identifier(s: Span) -> IResult<Span, FormalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FormalIdentifier { nodes: (a,) }))
}
#[parser]
pub fn formal_port_identifier(s: Span) -> IResult<Span, FormalPortIdentifier> {
pub(crate) fn formal_port_identifier(s: Span) -> IResult<Span, FormalPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FormalPortIdentifier { nodes: (a,) }))
}
#[parser]
pub fn function_identifier(s: Span) -> IResult<Span, FunctionIdentifier> {
pub(crate) fn function_identifier(s: Span) -> IResult<Span, FunctionIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, FunctionIdentifier { nodes: (a,) }))
}
#[parser]
pub fn generate_block_identifier(s: Span) -> IResult<Span, GenerateBlockIdentifier> {
pub(crate) fn generate_block_identifier(s: Span) -> IResult<Span, GenerateBlockIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, GenerateBlockIdentifier { nodes: (a,) }))
}
#[parser]
pub fn genvar_identifier(s: Span) -> IResult<Span, GenvarIdentifier> {
pub(crate) fn genvar_identifier(s: Span) -> IResult<Span, GenvarIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, GenvarIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_array_identifier(s: Span) -> IResult<Span, HierarchicalArrayIdentifier> {
pub(crate) fn hierarchical_array_identifier(s: Span) -> IResult<Span, HierarchicalArrayIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalArrayIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_block_identifier(s: Span) -> IResult<Span, HierarchicalBlockIdentifier> {
pub(crate) fn hierarchical_block_identifier(s: Span) -> IResult<Span, HierarchicalBlockIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalBlockIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_event_identifier(s: Span) -> IResult<Span, HierarchicalEventIdentifier> {
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]
pub fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier> {
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)?;
let (s, c) = identifier(s)?;
@ -736,20 +744,20 @@ pub fn hierarchical_identifier(s: Span) -> IResult<Span, HierarchicalIdentifier>
}
#[parser]
pub fn root(s: Span) -> IResult<Span, Root> {
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]
pub fn hierarchical_net_identifier(s: Span) -> IResult<Span, HierarchicalNetIdentifier> {
pub(crate) fn hierarchical_net_identifier(s: Span) -> IResult<Span, HierarchicalNetIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalNetIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_parameter_identifier(
pub(crate) fn hierarchical_parameter_identifier(
s: Span,
) -> IResult<Span, HierarchicalParameterIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
@ -757,38 +765,44 @@ pub fn hierarchical_parameter_identifier(
}
#[parser]
pub fn hierarchical_property_identifier(s: Span) -> IResult<Span, HierarchicalPropertyIdentifier> {
pub(crate) fn hierarchical_property_identifier(
s: Span,
) -> IResult<Span, HierarchicalPropertyIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalPropertyIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_sequence_identifier(s: Span) -> IResult<Span, HierarchicalSequenceIdentifier> {
pub(crate) fn hierarchical_sequence_identifier(
s: Span,
) -> IResult<Span, HierarchicalSequenceIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalSequenceIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_task_identifier(s: Span) -> IResult<Span, HierarchicalTaskIdentifier> {
pub(crate) fn hierarchical_task_identifier(s: Span) -> IResult<Span, HierarchicalTaskIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalTaskIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_tf_identifier(s: Span) -> IResult<Span, HierarchicalTfIdentifier> {
pub(crate) fn hierarchical_tf_identifier(s: Span) -> IResult<Span, HierarchicalTfIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalTfIdentifier { nodes: (a,) }))
}
#[parser]
pub fn hierarchical_variable_identifier(s: Span) -> IResult<Span, HierarchicalVariableIdentifier> {
pub(crate) fn hierarchical_variable_identifier(
s: Span,
) -> IResult<Span, HierarchicalVariableIdentifier> {
let (s, a) = hierarchical_identifier(s)?;
Ok((s, HierarchicalVariableIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
pub fn identifier(s: Span) -> IResult<Span, Identifier> {
pub(crate) fn identifier(s: Span) -> IResult<Span, Identifier> {
alt((
map(escaped_identifier, |x| {
Identifier::EscapedIdentifier(Box::new(x))
@ -800,98 +814,98 @@ pub fn identifier(s: Span) -> IResult<Span, Identifier> {
}
#[parser]
pub fn index_variable_identifier(s: Span) -> IResult<Span, IndexVariableIdentifier> {
pub(crate) fn index_variable_identifier(s: Span) -> IResult<Span, IndexVariableIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, IndexVariableIdentifier { nodes: (a,) }))
}
#[parser]
pub fn interface_identifier(s: Span) -> IResult<Span, InterfaceIdentifier> {
pub(crate) fn interface_identifier(s: Span) -> IResult<Span, InterfaceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InterfaceIdentifier { nodes: (a,) }))
}
#[parser]
pub fn interface_instance_identifier(s: Span) -> IResult<Span, InterfaceInstanceIdentifier> {
pub(crate) fn interface_instance_identifier(s: Span) -> IResult<Span, InterfaceInstanceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InterfaceInstanceIdentifier { nodes: (a,) }))
}
#[parser]
pub fn inout_port_identifier(s: Span) -> IResult<Span, InoutPortIdentifier> {
pub(crate) fn inout_port_identifier(s: Span) -> IResult<Span, InoutPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InoutPortIdentifier { nodes: (a,) }))
}
#[parser]
pub fn input_port_identifier(s: Span) -> IResult<Span, InputPortIdentifier> {
pub(crate) fn input_port_identifier(s: Span) -> IResult<Span, InputPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InputPortIdentifier { nodes: (a,) }))
}
#[parser]
pub fn instance_identifier(s: Span) -> IResult<Span, InstanceIdentifier> {
pub(crate) fn instance_identifier(s: Span) -> IResult<Span, InstanceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, InstanceIdentifier { nodes: (a,) }))
}
#[parser]
pub fn library_identifier(s: Span) -> IResult<Span, LibraryIdentifier> {
pub(crate) fn library_identifier(s: Span) -> IResult<Span, LibraryIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, LibraryIdentifier { nodes: (a,) }))
}
#[parser]
pub fn member_identifier(s: Span) -> IResult<Span, MemberIdentifier> {
pub(crate) fn member_identifier(s: Span) -> IResult<Span, MemberIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, MemberIdentifier { nodes: (a,) }))
}
#[parser]
pub fn method_identifier(s: Span) -> IResult<Span, MethodIdentifier> {
pub(crate) fn method_identifier(s: Span) -> IResult<Span, MethodIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, MethodIdentifier { nodes: (a,) }))
}
#[parser]
pub fn modport_identifier(s: Span) -> IResult<Span, ModportIdentifier> {
pub(crate) fn modport_identifier(s: Span) -> IResult<Span, ModportIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ModportIdentifier { nodes: (a,) }))
}
#[parser]
pub fn module_identifier(s: Span) -> IResult<Span, ModuleIdentifier> {
pub(crate) fn module_identifier(s: Span) -> IResult<Span, ModuleIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ModuleIdentifier { nodes: (a,) }))
}
#[parser]
pub fn net_identifier(s: Span) -> IResult<Span, NetIdentifier> {
pub(crate) fn net_identifier(s: Span) -> IResult<Span, NetIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, NetIdentifier { nodes: (a,) }))
}
#[parser]
pub fn net_type_identifier(s: Span) -> IResult<Span, NetTypeIdentifier> {
pub(crate) fn net_type_identifier(s: Span) -> IResult<Span, NetTypeIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, NetTypeIdentifier { nodes: (a,) }))
}
#[parser]
pub fn output_port_identifier(s: Span) -> IResult<Span, OutputPortIdentifier> {
pub(crate) fn output_port_identifier(s: Span) -> IResult<Span, OutputPortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, OutputPortIdentifier { nodes: (a,) }))
}
#[parser]
pub fn package_identifier(s: Span) -> IResult<Span, PackageIdentifier> {
pub(crate) fn package_identifier(s: Span) -> IResult<Span, PackageIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PackageIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
pub fn package_scope(s: Span) -> IResult<Span, PackageScope> {
pub(crate) fn package_scope(s: Span) -> IResult<Span, PackageScope> {
alt((
package_scope_package,
map(unit, |x| PackageScope::Unit(Box::new(x))),
@ -899,7 +913,7 @@ pub fn package_scope(s: Span) -> IResult<Span, PackageScope> {
}
#[parser]
pub fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
pub(crate) fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
let (s, a) = package_identifier(s)?;
let (s, b) = symbol("::")(s)?;
Ok((
@ -909,72 +923,72 @@ pub fn package_scope_package(s: Span) -> IResult<Span, PackageScope> {
}
#[parser]
pub fn unit(s: Span) -> IResult<Span, Unit> {
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]
pub fn parameter_identifier(s: Span) -> IResult<Span, ParameterIdentifier> {
pub(crate) fn parameter_identifier(s: Span) -> IResult<Span, ParameterIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ParameterIdentifier { nodes: (a,) }))
}
#[parser]
pub fn port_identifier(s: Span) -> IResult<Span, PortIdentifier> {
pub(crate) fn port_identifier(s: Span) -> IResult<Span, PortIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PortIdentifier { nodes: (a,) }))
}
#[parser]
pub fn production_identifier(s: Span) -> IResult<Span, ProductionIdentifier> {
pub(crate) fn production_identifier(s: Span) -> IResult<Span, ProductionIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ProductionIdentifier { nodes: (a,) }))
}
#[parser]
pub fn program_identifier(s: Span) -> IResult<Span, ProgramIdentifier> {
pub(crate) fn program_identifier(s: Span) -> IResult<Span, ProgramIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, ProgramIdentifier { nodes: (a,) }))
}
#[parser]
pub fn property_identifier(s: Span) -> IResult<Span, PropertyIdentifier> {
pub(crate) fn property_identifier(s: Span) -> IResult<Span, PropertyIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, PropertyIdentifier { nodes: (a,) }))
}
#[parser]
pub fn ps_class_identifier(s: Span) -> IResult<Span, PsClassIdentifier> {
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]
pub fn ps_covergroup_identifier(s: Span) -> IResult<Span, PsCovergroupIdentifier> {
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]
pub fn ps_checker_identifier(s: Span) -> IResult<Span, PsCheckerIdentifier> {
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]
pub fn ps_identifier(s: Span) -> IResult<Span, PsIdentifier> {
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]
pub fn ps_or_hierarchical_array_identifier(
pub(crate) fn ps_or_hierarchical_array_identifier(
s: Span,
) -> IResult<Span, PsOrHierarchicalArrayIdentifier> {
let (s, a) = opt(implicit_class_handle_or_class_scope_or_package_scope)(s)?;
@ -983,7 +997,9 @@ pub fn ps_or_hierarchical_array_identifier(
}
#[parser]
pub fn ps_or_hierarchical_net_identifier(s: Span) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
pub(crate) fn ps_or_hierarchical_net_identifier(
s: Span,
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
alt((
ps_or_hierarchical_net_identifier_package_scope,
map(hierarchical_net_identifier, |x| {
@ -993,7 +1009,7 @@ pub fn ps_or_hierarchical_net_identifier(s: Span) -> IResult<Span, PsOrHierarchi
}
#[parser]
pub fn ps_or_hierarchical_net_identifier_package_scope(
pub(crate) fn ps_or_hierarchical_net_identifier_package_scope(
s: Span,
) -> IResult<Span, PsOrHierarchicalNetIdentifier> {
let (s, a) = opt(package_scope)(s)?;
@ -1007,7 +1023,7 @@ pub fn ps_or_hierarchical_net_identifier_package_scope(
}
#[parser]
pub fn ps_or_hierarchical_property_identifier(
pub(crate) fn ps_or_hierarchical_property_identifier(
s: Span,
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
alt((
@ -1019,7 +1035,7 @@ pub fn ps_or_hierarchical_property_identifier(
}
#[parser]
pub fn ps_or_hierarchical_property_identifier_package_scope(
pub(crate) fn ps_or_hierarchical_property_identifier_package_scope(
s: Span,
) -> IResult<Span, PsOrHierarchicalPropertyIdentifier> {
let (s, a) = opt(package_scope)(s)?;
@ -1033,7 +1049,7 @@ pub fn ps_or_hierarchical_property_identifier_package_scope(
}
#[parser]
pub fn ps_or_hierarchical_sequence_identifier(
pub(crate) fn ps_or_hierarchical_sequence_identifier(
s: Span,
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
alt((
@ -1045,7 +1061,7 @@ pub fn ps_or_hierarchical_sequence_identifier(
}
#[parser]
pub fn ps_or_hierarchical_sequence_identifier_package_scope(
pub(crate) fn ps_or_hierarchical_sequence_identifier_package_scope(
s: Span,
) -> IResult<Span, PsOrHierarchicalSequenceIdentifier> {
let (s, a) = opt(package_scope)(s)?;
@ -1059,7 +1075,9 @@ pub fn ps_or_hierarchical_sequence_identifier_package_scope(
}
#[parser]
pub fn ps_or_hierarchical_tf_identifier(s: Span) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
pub(crate) fn ps_or_hierarchical_tf_identifier(
s: Span,
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
alt((
ps_or_hierarchical_tf_identifier_package_scope,
map(hierarchical_tf_identifier, |x| {
@ -1069,7 +1087,7 @@ pub fn ps_or_hierarchical_tf_identifier(s: Span) -> IResult<Span, PsOrHierarchic
}
#[parser]
pub fn ps_or_hierarchical_tf_identifier_package_scope(
pub(crate) fn ps_or_hierarchical_tf_identifier_package_scope(
s: Span,
) -> IResult<Span, PsOrHierarchicalTfIdentifier> {
let (s, a) = opt(package_scope)(s)?;
@ -1084,7 +1102,7 @@ pub fn ps_or_hierarchical_tf_identifier_package_scope(
#[packrat_parser]
#[parser]
pub fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdentifier> {
pub(crate) fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdentifier> {
alt((
ps_parameter_identifier_scope,
ps_parameter_identifier_generate,
@ -1092,7 +1110,7 @@ pub fn ps_parameter_identifier(s: Span) -> IResult<Span, PsParameterIdentifier>
}
#[parser]
pub fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParameterIdentifier> {
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)?;
Ok((
@ -1102,7 +1120,7 @@ pub fn ps_parameter_identifier_scope(s: Span) -> IResult<Span, PsParameterIdenti
}
#[parser]
pub fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIdentifier> {
pub(crate) fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIdentifier> {
let (s, a) = many0(triple(
generate_block_identifier,
opt(bracket(constant_expression)),
@ -1117,32 +1135,32 @@ pub fn ps_parameter_identifier_generate(s: Span) -> IResult<Span, PsParameterIde
#[packrat_parser]
#[parser]
pub fn ps_type_identifier(s: Span) -> IResult<Span, PsTypeIdentifier> {
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]
pub fn sequence_identifier(s: Span) -> IResult<Span, SequenceIdentifier> {
pub(crate) fn sequence_identifier(s: Span) -> IResult<Span, SequenceIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SequenceIdentifier { nodes: (a,) }))
}
#[parser]
pub fn signal_identifier(s: Span) -> IResult<Span, SignalIdentifier> {
pub(crate) fn signal_identifier(s: Span) -> IResult<Span, SignalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SignalIdentifier { nodes: (a,) }))
}
#[parser]
pub fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
pub(crate) fn simple_identifier(s: Span) -> IResult<Span, SimpleIdentifier> {
let (s, a) = ws(simple_identifier_impl)(s)?;
Ok((s, SimpleIdentifier { nodes: a }))
}
#[parser]
pub fn simple_identifier_impl(s: Span) -> IResult<Span, Locate> {
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)?;
let a = if let Some(b) = b {
@ -1158,19 +1176,19 @@ pub fn simple_identifier_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn specparam_identifier(s: Span) -> IResult<Span, SpecparamIdentifier> {
pub(crate) fn specparam_identifier(s: Span) -> IResult<Span, SpecparamIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, SpecparamIdentifier { nodes: (a,) }))
}
#[parser]
pub fn system_tf_identifier(s: Span) -> IResult<Span, SystemTfIdentifier> {
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]
pub fn system_tf_identifier_impl(s: Span) -> IResult<Span, Locate> {
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)?;
let a = concat(a, b).unwrap();
@ -1178,50 +1196,50 @@ pub fn system_tf_identifier_impl(s: Span) -> IResult<Span, Locate> {
}
#[parser]
pub fn task_identifier(s: Span) -> IResult<Span, TaskIdentifier> {
pub(crate) fn task_identifier(s: Span) -> IResult<Span, TaskIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TaskIdentifier { nodes: (a,) }))
}
#[parser]
pub fn tf_identifier(s: Span) -> IResult<Span, TfIdentifier> {
pub(crate) fn tf_identifier(s: Span) -> IResult<Span, TfIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TfIdentifier { nodes: (a,) }))
}
#[parser]
pub fn terminal_identifier(s: Span) -> IResult<Span, TerminalIdentifier> {
pub(crate) fn terminal_identifier(s: Span) -> IResult<Span, TerminalIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TerminalIdentifier { nodes: (a,) }))
}
#[parser]
pub fn topmodule_identifier(s: Span) -> IResult<Span, TopmoduleIdentifier> {
pub(crate) fn topmodule_identifier(s: Span) -> IResult<Span, TopmoduleIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TopmoduleIdentifier { nodes: (a,) }))
}
#[parser]
pub fn type_identifier(s: Span) -> IResult<Span, TypeIdentifier> {
pub(crate) fn type_identifier(s: Span) -> IResult<Span, TypeIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, TypeIdentifier { nodes: (a,) }))
}
#[parser]
pub fn udp_identifier(s: Span) -> IResult<Span, UdpIdentifier> {
pub(crate) fn udp_identifier(s: Span) -> IResult<Span, UdpIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, UdpIdentifier { nodes: (a,) }))
}
#[packrat_parser]
#[parser]
pub fn variable_identifier(s: Span) -> IResult<Span, VariableIdentifier> {
pub(crate) fn variable_identifier(s: Span) -> IResult<Span, VariableIdentifier> {
let (s, a) = identifier(s)?;
Ok((s, VariableIdentifier { nodes: (a,) }))
}
#[parser]
pub fn implicit_class_handle_or_class_scope_or_package_scope(
pub(crate) fn implicit_class_handle_or_class_scope_or_package_scope(
s: Span,
) -> IResult<Span, ImplicitClassHandleOrClassScopeOrPackageScope> {
alt((
@ -1238,7 +1256,7 @@ pub fn implicit_class_handle_or_class_scope_or_package_scope(
}
#[parser]
pub fn implicit_class_handle_or_package_scope(
pub(crate) fn implicit_class_handle_or_package_scope(
s: Span,
) -> IResult<Span, ImplicitClassHandleOrPackageScope> {
alt((
@ -1252,7 +1270,7 @@ pub fn implicit_class_handle_or_package_scope(
}
#[parser]
pub fn implicit_class_handle_or_class_scope(
pub(crate) fn implicit_class_handle_or_class_scope(
s: Span,
) -> IResult<Span, ImplicitClassHandleOrClassScope> {
alt((
@ -1266,7 +1284,7 @@ pub fn implicit_class_handle_or_class_scope(
}
#[parser]
pub fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScopeOrClassScope> {
pub(crate) fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScopeOrClassScope> {
alt((
map(package_scope, |x| {
PackageScopeOrClassScope::PackageScope(Box::new(x))
@ -1278,7 +1296,7 @@ pub fn package_scope_or_class_scope(s: Span) -> IResult<Span, PackageScopeOrClas
}
#[parser]
pub fn local_or_package_scope_or_class_scope(
pub(crate) fn local_or_package_scope_or_class_scope(
s: Span,
) -> IResult<Span, LocalOrPackageScopeOrClassScope> {
alt((
@ -1295,7 +1313,7 @@ pub fn local_or_package_scope_or_class_scope(
}
#[parser]
pub fn local(s: Span) -> IResult<Span, Local> {
pub(crate) fn local(s: Span) -> IResult<Span, Local> {
let (s, a) = keyword("local")(s)?;
let (s, b) = symbol("::")(s)?;
Ok((s, Local { nodes: (a, b) }))

View File

@ -62,7 +62,7 @@ pub struct NamedCheckerPortConnectionAsterisk {
// -----------------------------------------------------------------------------
#[parser]
pub fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
pub(crate) fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
let (s, a) = ps_checker_identifier(s)?;
let (s, b) = name_of_instance(s)?;
let (s, c) = paren(opt(list_of_checker_port_connections))(s)?;
@ -76,7 +76,7 @@ pub fn checker_instantiation(s: Span) -> IResult<Span, CheckerInstantiation> {
}
#[parser]
pub fn list_of_checker_port_connections(s: Span) -> IResult<Span, ListOfCheckerPortConnections> {
pub(crate) fn list_of_checker_port_connections(s: Span) -> IResult<Span, ListOfCheckerPortConnections> {
alt((
list_of_checker_port_connections_ordered,
list_of_checker_port_connections_named,
@ -84,7 +84,7 @@ pub fn list_of_checker_port_connections(s: Span) -> IResult<Span, ListOfCheckerP
}
#[parser(MaybeRecursive)]
pub fn list_of_checker_port_connections_ordered(
pub(crate) fn list_of_checker_port_connections_ordered(
s: Span,
) -> IResult<Span, ListOfCheckerPortConnections> {
let (s, a) = list(symbol(","), ordered_checker_port_connection)(s)?;
@ -97,7 +97,7 @@ pub fn list_of_checker_port_connections_ordered(
}
#[parser]
pub fn list_of_checker_port_connections_named(
pub(crate) fn list_of_checker_port_connections_named(
s: Span,
) -> IResult<Span, ListOfCheckerPortConnections> {
let (s, a) = list(symbol(","), named_checker_port_connection)(s)?;
@ -110,14 +110,14 @@ pub fn list_of_checker_port_connections_named(
}
#[parser(MaybeRecursive)]
pub fn ordered_checker_port_connection(s: Span) -> IResult<Span, OrderedCheckerPortConnection> {
pub(crate) fn ordered_checker_port_connection(s: Span) -> IResult<Span, OrderedCheckerPortConnection> {
let (s, x) = many0(attribute_instance)(s)?;
let (s, y) = opt(property_actual_arg)(s)?;
Ok((s, OrderedCheckerPortConnection { nodes: (x, y) }))
}
#[parser]
pub fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheckerPortConnection> {
pub(crate) fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheckerPortConnection> {
alt((
named_checker_port_connection_identifier,
named_checker_port_connection_asterisk,
@ -125,7 +125,7 @@ pub fn named_checker_port_connection(s: Span) -> IResult<Span, NamedCheckerPortC
}
#[parser]
pub fn named_checker_port_connection_identifier(
pub(crate) fn named_checker_port_connection_identifier(
s: Span,
) -> IResult<Span, NamedCheckerPortConnection> {
let (s, a) = many0(attribute_instance)(s)?;
@ -141,7 +141,7 @@ pub fn named_checker_port_connection_identifier(
}
#[parser]
pub fn named_checker_port_connection_asterisk(
pub(crate) fn named_checker_port_connection_asterisk(
s: Span,
) -> IResult<Span, NamedCheckerPortConnection> {
let (s, a) = many0(attribute_instance)(s)?;

View File

@ -130,7 +130,7 @@ pub enum GenerateItem {
// -----------------------------------------------------------------------------
#[parser]
pub fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
pub(crate) fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
let (s, a) = keyword("generate")(s)?;
let (s, b) = many0(generate_item)(s)?;
let (s, c) = keyword("endgenerate")(s)?;
@ -138,7 +138,7 @@ pub fn generate_region(s: Span) -> IResult<Span, GenerateRegion> {
}
#[parser]
pub fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct> {
pub(crate) fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct> {
let (s, a) = keyword("for")(s)?;
let (s, b) = paren(tuple((
generate_initialization,
@ -152,7 +152,7 @@ pub fn loop_generate_construct(s: Span) -> IResult<Span, LoopGenerateConstruct>
}
#[parser]
pub fn generate_initialization(s: Span) -> IResult<Span, GenvarInitialization> {
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)?;
let (s, c) = symbol("=")(s)?;
@ -166,7 +166,7 @@ pub fn generate_initialization(s: Span) -> IResult<Span, GenvarInitialization> {
}
#[parser]
pub fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
pub(crate) fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
alt((
genvar_iteration_assignment,
genvar_iteration_prefix,
@ -175,7 +175,7 @@ pub fn genvar_iteration(s: Span) -> IResult<Span, GenvarIteration> {
}
#[parser]
pub fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
pub(crate) fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
let (s, a) = genvar_identifier(s)?;
let (s, b) = assignment_operator(s)?;
let (s, c) = genvar_expression(s)?;
@ -186,7 +186,7 @@ pub fn genvar_iteration_assignment(s: Span) -> IResult<Span, GenvarIteration> {
}
#[parser]
pub fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration> {
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)?;
Ok((
@ -196,7 +196,7 @@ pub fn genvar_iteration_prefix(s: Span) -> IResult<Span, GenvarIteration> {
}
#[parser]
pub fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration> {
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)?;
Ok((
@ -206,7 +206,7 @@ pub fn genvar_iteration_suffix(s: Span) -> IResult<Span, GenvarIteration> {
}
#[parser]
pub fn conditional_generate_construct(s: Span) -> IResult<Span, ConditionalGenerateConstruct> {
pub(crate) fn conditional_generate_construct(s: Span) -> IResult<Span, ConditionalGenerateConstruct> {
alt((
map(if_generate_construct, |x| {
ConditionalGenerateConstruct::If(Box::new(x))
@ -218,7 +218,7 @@ pub fn conditional_generate_construct(s: Span) -> IResult<Span, ConditionalGener
}
#[parser]
pub fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
pub(crate) fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
let (s, a) = keyword("if")(s)?;
let (s, b) = paren(constant_expression)(s)?;
let (s, c) = generate_block(s)?;
@ -232,7 +232,7 @@ pub fn if_generate_construct(s: Span) -> IResult<Span, IfGenerateConstruct> {
}
#[parser]
pub fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct> {
pub(crate) fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct> {
let (s, a) = keyword("case")(s)?;
let (s, b) = paren(constant_expression)(s)?;
let (s, c) = many1(case_generate_item)(s)?;
@ -246,12 +246,12 @@ pub fn case_generate_construct(s: Span) -> IResult<Span, CaseGenerateConstruct>
}
#[parser]
pub fn case_generate_item(s: Span) -> IResult<Span, CaseGenerateItem> {
pub(crate) fn case_generate_item(s: Span) -> IResult<Span, CaseGenerateItem> {
alt((case_generate_item_nondefault, case_generate_item_default))(s)
}
#[parser(MaybeRecursive)]
pub fn case_generate_item_nondefault(s: Span) -> IResult<Span, CaseGenerateItem> {
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)?;
let (s, c) = generate_block(s)?;
@ -262,7 +262,7 @@ pub fn case_generate_item_nondefault(s: Span) -> IResult<Span, CaseGenerateItem>
}
#[parser]
pub fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
pub(crate) fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
let (s, a) = keyword("default")(s)?;
let (s, b) = opt(symbol(":"))(s)?;
let (s, c) = generate_block(s)?;
@ -273,7 +273,7 @@ pub fn case_generate_item_default(s: Span) -> IResult<Span, CaseGenerateItem> {
}
#[parser]
pub fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
pub(crate) fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
alt((
map(generate_item, |x| GenerateBlock::GenerateItem(Box::new(x))),
generate_block_multiple,
@ -281,7 +281,7 @@ pub fn generate_block(s: Span) -> IResult<Span, GenerateBlock> {
}
#[parser]
pub fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
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)?;
let (s, c) = opt(pair(symbol(":"), generate_block_identifier))(s)?;
@ -297,7 +297,7 @@ pub fn generate_block_multiple(s: Span) -> IResult<Span, GenerateBlock> {
}
#[parser]
pub fn generate_item(s: Span) -> IResult<Span, GenerateItem> {
pub(crate) fn generate_item(s: Span) -> IResult<Span, GenerateItem> {
alt((
map(module_or_generate_item, |x| {
GenerateItem::ModuleOrGenerateItem(Box::new(x))

View File

@ -18,7 +18,7 @@ pub struct InterfaceInstantiation {
// -----------------------------------------------------------------------------
#[parser]
pub fn interface_instantiation(s: Span) -> IResult<Span, InterfaceInstantiation> {
pub(crate) fn interface_instantiation(s: Span) -> IResult<Span, InterfaceInstantiation> {
let (s, a) = interface_identifier(s)?;
let (s, b) = opt(parameter_value_assignment)(s)?;
let (s, c) = list(symbol(","), hierarchical_instance)(s)?;

View File

@ -103,7 +103,7 @@ pub struct NamedPortConnectionAsterisk {
// -----------------------------------------------------------------------------
#[parser]
pub fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
pub(crate) fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
let (s, a) = module_identifier(s)?;
let (s, b) = opt(parameter_value_assignment)(s)?;
let (s, c) = list(symbol(","), hierarchical_instance)(s)?;
@ -117,14 +117,14 @@ pub fn module_instantiation(s: Span) -> IResult<Span, ModuleInstantiation> {
}
#[parser]
pub fn parameter_value_assignment(s: Span) -> IResult<Span, ParameterValueAssignment> {
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]
pub fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfParameterAssignments> {
pub(crate) fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfParameterAssignments> {
alt((
list_of_parameter_assignments_ordered,
list_of_parameter_assignments_named,
@ -132,7 +132,7 @@ pub fn list_of_parameter_assignments(s: Span) -> IResult<Span, ListOfParameterAs
}
#[parser(MaybeRecursive)]
pub fn list_of_parameter_assignments_ordered(s: Span) -> IResult<Span, ListOfParameterAssignments> {
pub(crate) fn list_of_parameter_assignments_ordered(s: Span) -> IResult<Span, ListOfParameterAssignments> {
let (s, a) = list(symbol(","), ordered_parameter_assignment)(s)?;
Ok((
s,
@ -143,7 +143,7 @@ pub fn list_of_parameter_assignments_ordered(s: Span) -> IResult<Span, ListOfPar
}
#[parser]
pub fn list_of_parameter_assignments_named(s: Span) -> IResult<Span, ListOfParameterAssignments> {
pub(crate) fn list_of_parameter_assignments_named(s: Span) -> IResult<Span, ListOfParameterAssignments> {
let (s, a) = list(symbol(","), named_parameter_assignment)(s)?;
Ok((
s,
@ -154,13 +154,13 @@ pub fn list_of_parameter_assignments_named(s: Span) -> IResult<Span, ListOfParam
}
#[parser]
pub fn ordered_parameter_assignment(s: Span) -> IResult<Span, OrderedParameterAssignment> {
pub(crate) fn ordered_parameter_assignment(s: Span) -> IResult<Span, OrderedParameterAssignment> {
let (s, x) = param_expression(s)?;
Ok((s, OrderedParameterAssignment { nodes: (x,) }))
}
#[parser]
pub fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssignment> {
pub(crate) fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssignment> {
let (s, a) = symbol(".")(s)?;
let (s, b) = parameter_identifier(s)?;
let (s, c) = paren(opt(param_expression))(s)?;
@ -168,21 +168,21 @@ pub fn named_parameter_assignment(s: Span) -> IResult<Span, NamedParameterAssign
}
#[parser]
pub fn hierarchical_instance(s: Span) -> IResult<Span, HierarchicalInstance> {
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]
pub fn name_of_instance(s: Span) -> IResult<Span, NameOfInstance> {
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]
pub fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConnections> {
pub(crate) fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConnections> {
alt((
list_of_port_connections_ordered,
list_of_port_connections_named,
@ -190,7 +190,7 @@ pub fn list_of_port_connections(s: Span) -> IResult<Span, ListOfPortConnections>
}
#[parser(MaybeRecursive)]
pub fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConnections> {
pub(crate) fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConnections> {
let (s, a) = list(symbol(","), ordered_port_connection)(s)?;
Ok((
s,
@ -199,7 +199,7 @@ pub fn list_of_port_connections_ordered(s: Span) -> IResult<Span, ListOfPortConn
}
#[parser]
pub fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnections> {
pub(crate) fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnections> {
let (s, a) = list(symbol(","), named_port_connection)(s)?;
Ok((
s,
@ -208,14 +208,14 @@ pub fn list_of_port_connections_named(s: Span) -> IResult<Span, ListOfPortConnec
}
#[parser(MaybeRecursive)]
pub fn ordered_port_connection(s: Span) -> IResult<Span, OrderedPortConnection> {
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]
pub fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnection> {
pub(crate) fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnection> {
alt((
named_port_connection_identifier,
named_port_connection_asterisk,
@ -223,7 +223,7 @@ pub fn named_port_connection(s: Span) -> IResult<Span, NamedPortConnection> {
}
#[parser]
pub fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConnection> {
pub(crate) fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConnection> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = port_identifier(s)?;
@ -237,7 +237,7 @@ pub fn named_port_connection_identifier(s: Span) -> IResult<Span, NamedPortConne
}
#[parser]
pub fn named_port_connection_asterisk(s: Span) -> IResult<Span, NamedPortConnection> {
pub(crate) fn named_port_connection_asterisk(s: Span) -> IResult<Span, NamedPortConnection> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = symbol(".*")(s)?;
Ok((

View File

@ -18,7 +18,7 @@ pub struct ProgramInstantiation {
// -----------------------------------------------------------------------------
#[parser]
pub fn program_instantiation(s: Span) -> IResult<Span, ProgramInstantiation> {
pub(crate) fn program_instantiation(s: Span) -> IResult<Span, ProgramInstantiation> {
let (s, a) = program_identifier(s)?;
let (s, b) = opt(parameter_value_assignment)(s)?;
let (s, c) = list(symbol(","), hierarchical_instance)(s)?;

View File

@ -43,13 +43,13 @@ pub struct PassSwitchtype {
// -----------------------------------------------------------------------------
#[parser]
pub fn cmos_switchtype(s: Span) -> IResult<Span, CmosSwitchtype> {
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]
pub fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
pub(crate) fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
let (s, a) = alt((
keyword("bufif0"),
keyword("bufif1"),
@ -60,7 +60,7 @@ pub fn enable_gatetype(s: Span) -> IResult<Span, EnableGatetype> {
}
#[parser]
pub fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
pub(crate) fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
let (s, a) = alt((
keyword("nmos"),
keyword("pmos"),
@ -71,7 +71,7 @@ pub fn mos_switchtype(s: Span) -> IResult<Span, MosSwitchtype> {
}
#[parser]
pub fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
pub(crate) fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
let (s, a) = alt((
keyword("and"),
keyword("nand"),
@ -84,13 +84,13 @@ pub fn n_input_gatetype(s: Span) -> IResult<Span, NInputGatetype> {
}
#[parser]
pub fn n_output_gatetype(s: Span) -> IResult<Span, NOutputGatetype> {
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]
pub fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
pub(crate) fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
let (s, a) = alt((
keyword("tranif0"),
keyword("tranif1"),
@ -101,7 +101,7 @@ pub fn pass_en_switchtype(s: Span) -> IResult<Span, PassEnSwitchtype> {
}
#[parser]
pub fn pass_switchtype(s: Span) -> IResult<Span, PassSwitchtype> {
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

@ -192,7 +192,7 @@ pub struct PullGateInstance {
// -----------------------------------------------------------------------------
#[parser]
pub fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
alt((
gate_instantiation_cmos,
gate_instantiation_enable,
@ -207,7 +207,7 @@ pub fn gate_instantiation(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
let (s, a) = cmos_switchtype(s)?;
let (s, b) = opt(delay3)(s)?;
let (s, c) = list(symbol(","), cmos_switch_instance)(s)?;
@ -221,7 +221,7 @@ pub fn gate_instantiation_cmos(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
let (s, a) = enable_gatetype(s)?;
let (s, b) = opt(drive_strength)(s)?;
let (s, c) = opt(delay3)(s)?;
@ -236,7 +236,7 @@ pub fn gate_instantiation_enable(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
let (s, a) = mos_switchtype(s)?;
let (s, b) = opt(delay3)(s)?;
let (s, c) = list(symbol(","), mos_switch_instance)(s)?;
@ -250,7 +250,7 @@ pub fn gate_instantiation_mos(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantiation> {
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)?;
let (s, c) = opt(delay2)(s)?;
@ -265,7 +265,7 @@ pub fn gate_instantiation_n_input(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstantiation> {
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)?;
let (s, c) = opt(delay2)(s)?;
@ -280,7 +280,7 @@ pub fn gate_instantiation_n_output(s: Span) -> IResult<Span, GateInstantiation>
}
#[parser]
pub fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantiation> {
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)?;
let (s, c) = list(symbol(","), pass_enable_switch_instance)(s)?;
@ -294,7 +294,7 @@ pub fn gate_instantiation_pass_en(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiation> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -305,7 +305,7 @@ pub fn gate_instantiation_pass(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation> {
let (s, a) = keyword("pulldown")(s)?;
let (s, b) = opt(pulldown_strength)(s)?;
let (s, c) = list(symbol(","), pull_gate_instance)(s)?;
@ -319,7 +319,7 @@ pub fn gate_instantiation_pulldown(s: Span) -> IResult<Span, GateInstantiation>
}
#[parser]
pub fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
pub(crate) fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
let (s, a) = keyword("pullup")(s)?;
let (s, b) = opt(pullup_strength)(s)?;
let (s, c) = list(symbol(","), pull_gate_instance)(s)?;
@ -333,7 +333,7 @@ pub fn gate_instantiation_pullup(s: Span) -> IResult<Span, GateInstantiation> {
}
#[parser]
pub fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
pub(crate) fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(tuple((
output_terminal,
@ -348,7 +348,7 @@ pub fn cmos_switch_instance(s: Span) -> IResult<Span, CmosSwitchInstance> {
}
#[parser]
pub fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
pub(crate) fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(tuple((
output_terminal,
@ -361,7 +361,7 @@ pub fn enable_gate_instance(s: Span) -> IResult<Span, EnableGateInstance> {
}
#[parser]
pub fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
pub(crate) fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(tuple((
output_terminal,
@ -374,7 +374,7 @@ pub fn mos_switch_instance(s: Span) -> IResult<Span, MosSwitchInstance> {
}
#[parser]
pub fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance> {
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((
output_terminal,
@ -385,7 +385,7 @@ pub fn n_input_gate_instance(s: Span) -> IResult<Span, NInputGateInstance> {
}
#[parser]
pub fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstance> {
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((
list(symbol(","), output_terminal),
@ -396,14 +396,14 @@ pub fn n_output_gate_instance(s: Span) -> IResult<Span, NOutputGateInstance> {
}
#[parser]
pub fn pass_switch_instance(s: Span) -> IResult<Span, PassSwitchInstance> {
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]
pub fn pass_enable_switch_instance(s: Span) -> IResult<Span, PassEnableSwitchInstance> {
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((
inout_terminal,
@ -416,7 +416,7 @@ pub fn pass_enable_switch_instance(s: Span) -> IResult<Span, PassEnableSwitchIns
}
#[parser]
pub fn pull_gate_instance(s: Span) -> IResult<Span, PullGateInstance> {
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)?;
Ok((s, PullGateInstance { nodes: (a, b) }))

View File

@ -52,12 +52,12 @@ pub struct PullupStrength1 {
// -----------------------------------------------------------------------------
#[parser]
pub fn pulldown_strength(s: Span) -> IResult<Span, PulldownStrength> {
pub(crate) fn pulldown_strength(s: Span) -> IResult<Span, PulldownStrength> {
alt((pulldown_strength01, pulldown_strength10, pulldown_strength0))(s)
}
#[parser]
pub fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
pub(crate) fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
s,
@ -66,7 +66,7 @@ pub fn pulldown_strength01(s: Span) -> IResult<Span, PulldownStrength> {
}
#[parser]
pub fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
pub(crate) fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
s,
@ -75,7 +75,7 @@ pub fn pulldown_strength10(s: Span) -> IResult<Span, PulldownStrength> {
}
#[parser]
pub fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
pub(crate) fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
let (s, a) = paren(strength0)(s)?;
Ok((
s,
@ -84,12 +84,12 @@ pub fn pulldown_strength0(s: Span) -> IResult<Span, PulldownStrength> {
}
#[parser]
pub fn pullup_strength(s: Span) -> IResult<Span, PullupStrength> {
pub(crate) fn pullup_strength(s: Span) -> IResult<Span, PullupStrength> {
alt((pullup_strength01, pullup_strength10, pullup_strength1))(s)
}
#[parser]
pub fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
pub(crate) fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(triple(strength0, symbol(","), strength1))(s)?;
Ok((
s,
@ -98,7 +98,7 @@ pub fn pullup_strength01(s: Span) -> IResult<Span, PullupStrength> {
}
#[parser]
pub fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
pub(crate) fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(triple(strength1, symbol(","), strength0))(s)?;
Ok((
s,
@ -107,7 +107,7 @@ pub fn pullup_strength10(s: Span) -> IResult<Span, PullupStrength> {
}
#[parser]
pub fn pullup_strength1(s: Span) -> IResult<Span, PullupStrength> {
pub(crate) fn pullup_strength1(s: Span) -> IResult<Span, PullupStrength> {
let (s, a) = paren(strength1)(s)?;
Ok((
s,

View File

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

View File

@ -87,13 +87,13 @@ pub enum CheckerGenerateItem {
// -----------------------------------------------------------------------------
#[parser]
pub fn checker_port_list(s: Span) -> IResult<Span, CheckerPortList> {
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]
pub fn checker_port_item(s: Span) -> IResult<Span, CheckerPortItem> {
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)?;
let (s, c) = property_formal_type(s)?;
@ -109,7 +109,7 @@ pub fn checker_port_item(s: Span) -> IResult<Span, CheckerPortItem> {
}
#[parser]
pub fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
pub(crate) fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
alt((
map(keyword("input"), |x| {
CheckerPortDirection::Input(Box::new(x))
@ -121,7 +121,7 @@ pub fn checker_port_direction(s: Span) -> IResult<Span, CheckerPortDirection> {
}
#[parser]
pub fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem> {
pub(crate) fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem> {
alt((
map(checker_or_generate_item_declaration, |x| {
CheckerOrGenerateItem::CheckerOrGenerateItemDeclaration(Box::new(x))
@ -148,7 +148,7 @@ pub fn checker_or_generate_item(s: Span) -> IResult<Span, CheckerOrGenerateItem>
}
#[parser]
pub fn checker_or_generate_item_declaration(
pub(crate) fn checker_or_generate_item_declaration(
s: Span,
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
alt((
@ -180,7 +180,7 @@ pub fn checker_or_generate_item_declaration(
}
#[parser]
pub fn checker_or_generate_item_declaration_data(
pub(crate) fn checker_or_generate_item_declaration_data(
s: Span,
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
let (s, a) = opt(rand)(s)?;
@ -194,13 +194,13 @@ pub fn checker_or_generate_item_declaration_data(
}
#[parser]
pub fn rand(s: Span) -> IResult<Span, Rand> {
pub(crate) fn rand(s: Span) -> IResult<Span, Rand> {
let (s, a) = keyword("rand")(s)?;
Ok((s, Rand { nodes: (a,) }))
}
#[parser]
pub fn checker_or_generate_item_declaration_clocking(
pub(crate) fn checker_or_generate_item_declaration_clocking(
s: Span,
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
let (s, a) = keyword("default")(s)?;
@ -218,7 +218,7 @@ pub fn checker_or_generate_item_declaration_clocking(
}
#[parser]
pub fn checker_or_generate_item_declaration_disable(
pub(crate) fn checker_or_generate_item_declaration_disable(
s: Span,
) -> IResult<Span, CheckerOrGenerateItemDeclaration> {
let (s, a) = keyword("default")(s)?;
@ -237,7 +237,7 @@ pub fn checker_or_generate_item_declaration_disable(
}
#[parser]
pub fn checker_generate_item(s: Span) -> IResult<Span, CheckerGenerateItem> {
pub(crate) fn checker_generate_item(s: Span) -> IResult<Span, CheckerGenerateItem> {
alt((
map(loop_generate_construct, |x| {
CheckerGenerateItem::LoopGenerateConstruct(Box::new(x))

View File

@ -187,7 +187,7 @@ pub struct New {
// -----------------------------------------------------------------------------
#[parser]
pub fn class_item(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item(s: Span) -> IResult<Span, ClassItem> {
alt((
class_item_property,
class_item_method,
@ -205,7 +205,7 @@ pub fn class_item(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = class_property(s)?;
Ok((
@ -215,7 +215,7 @@ pub fn class_item_property(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = class_method(s)?;
Ok((
@ -225,7 +225,7 @@ pub fn class_item_method(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = class_constraint(s)?;
Ok((
@ -235,7 +235,7 @@ pub fn class_item_constraint(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = class_declaration(s)?;
Ok((
@ -245,7 +245,7 @@ pub fn class_item_declaration(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
pub(crate) fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = covergroup_declaration(s)?;
Ok((
@ -255,12 +255,12 @@ pub fn class_item_covergroup(s: Span) -> IResult<Span, ClassItem> {
}
#[parser]
pub fn class_property(s: Span) -> IResult<Span, ClassProperty> {
pub(crate) fn class_property(s: Span) -> IResult<Span, ClassProperty> {
alt((class_property_non_const, class_property_const))(s)
}
#[parser]
pub fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty> {
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)?;
Ok((
@ -270,7 +270,7 @@ pub fn class_property_non_const(s: Span) -> IResult<Span, ClassProperty> {
}
#[parser]
pub fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
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)?;
let (s, c) = data_type(s)?;
@ -286,7 +286,7 @@ pub fn class_property_const(s: Span) -> IResult<Span, ClassProperty> {
}
#[parser]
pub fn class_method(s: Span) -> IResult<Span, ClassMethod> {
pub(crate) fn class_method(s: Span) -> IResult<Span, ClassMethod> {
alt((
class_method_task,
class_method_function,
@ -298,7 +298,7 @@ pub fn class_method(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
pub(crate) fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
let (s, a) = many0(method_qualifier)(s)?;
let (s, b) = task_declaration(s)?;
Ok((
@ -308,7 +308,7 @@ pub fn class_method_task(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
pub(crate) fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
let (s, a) = many0(method_qualifier)(s)?;
let (s, b) = function_declaration(s)?;
Ok((
@ -318,7 +318,7 @@ pub fn class_method_function(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
pub(crate) fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
let (s, a) = keyword("pure")(s)?;
let (s, b) = keyword("virtual")(s)?;
let (s, c) = many0(class_item_qualifier)(s)?;
@ -333,7 +333,7 @@ pub fn class_method_pure_virtual(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod> {
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)?;
let (s, c) = method_prototype(s)?;
@ -347,7 +347,7 @@ pub fn class_method_extern_method(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
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)?;
Ok((
@ -357,7 +357,7 @@ pub fn class_method_constructor(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMethod> {
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)?;
let (s, c) = class_constructor_prototype(s)?;
@ -368,7 +368,7 @@ pub fn class_method_extern_constructor(s: Span) -> IResult<Span, ClassMethod> {
}
#[parser]
pub fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPrototype> {
pub(crate) fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPrototype> {
let (s, a) = keyword("function")(s)?;
let (s, b) = keyword("new")(s)?;
let (s, c) = opt(paren(opt(tf_port_list)))(s)?;
@ -382,7 +382,7 @@ pub fn class_constructor_prototype(s: Span) -> IResult<Span, ClassConstructorPro
}
#[parser]
pub fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
pub(crate) fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
alt((
map(constraint_prototype, |x| {
ClassConstraint::ConstraintPrototype(Box::new(x))
@ -394,7 +394,7 @@ pub fn class_constraint(s: Span) -> IResult<Span, ClassConstraint> {
}
#[parser]
pub fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
pub(crate) fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
alt((
map(keyword("static"), |x| {
ClassItemQualifier::Static(Box::new(x))
@ -407,7 +407,7 @@ pub fn class_item_qualifier(s: Span) -> IResult<Span, ClassItemQualifier> {
}
#[parser]
pub fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
pub(crate) fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
alt((
map(random_qualifier, |x| {
PropertyQualifier::RandomQualifier(Box::new(x))
@ -419,7 +419,7 @@ pub fn property_qualifier(s: Span) -> IResult<Span, PropertyQualifier> {
}
#[parser]
pub fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
pub(crate) fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
alt((
map(keyword("randc"), |x| RandomQualifier::Randc(Box::new(x))),
map(keyword("rand"), |x| RandomQualifier::Rand(Box::new(x))),
@ -427,7 +427,7 @@ pub fn random_qualifier(s: Span) -> IResult<Span, RandomQualifier> {
}
#[parser]
pub fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
pub(crate) fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
alt((
map(pair(keyword("pure"), keyword("virtual")), |x| {
MethodQualifier::PureVirtual(Box::new(x))
@ -442,7 +442,7 @@ pub fn method_qualifier(s: Span) -> IResult<Span, MethodQualifier> {
}
#[parser]
pub fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
pub(crate) fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
alt((
map(task_prototype, |x| {
MethodPrototype::TaskPrototype(Box::new(x))
@ -454,7 +454,7 @@ pub fn method_prototype(s: Span) -> IResult<Span, MethodPrototype> {
}
#[parser]
pub fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorDeclaration> {
pub(crate) fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorDeclaration> {
let (s, a) = keyword("function")(s)?;
let (s, b) = opt(class_scope)(s)?;
let (s, c) = keyword("new")(s)?;
@ -480,7 +480,7 @@ pub fn class_constructor_declaration(s: Span) -> IResult<Span, ClassConstructorD
}
#[parser]
pub fn new(s: Span) -> IResult<Span, New> {
pub(crate) fn new(s: Span) -> IResult<Span, New> {
let (s, a) = keyword("new")(s)?;
Ok((s, New { nodes: (a,) }))
}

View File

@ -135,7 +135,7 @@ pub struct Config {
// -----------------------------------------------------------------------------
#[parser]
pub fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
pub(crate) fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
let (s, a) = keyword("config")(s)?;
let (s, b) = config_identifier(s)?;
let (s, c) = symbol(";")(s)?;
@ -153,7 +153,7 @@ pub fn config_declaration(s: Span) -> IResult<Span, ConfigDeclaration> {
}
#[parser]
pub fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
pub(crate) fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
let (s, a) = keyword("design")(s)?;
let (s, b) = many0(pair(
opt(pair(library_identifier, symbol("."))),
@ -164,7 +164,7 @@ pub fn design_statement(s: Span) -> IResult<Span, DesignStatement> {
}
#[parser]
pub fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
pub(crate) fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
alt((
config_rule_statement_default,
config_rule_statement_inst_lib,
@ -175,7 +175,7 @@ pub fn config_rule_statement(s: Span) -> IResult<Span, ConfigRuleStatement> {
}
#[parser]
pub fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStatement> {
pub(crate) fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStatement> {
let (s, a) = default_clause(s)?;
let (s, b) = liblist_clause(s)?;
let (s, c) = symbol(";")(s)?;
@ -186,7 +186,7 @@ pub fn config_rule_statement_default(s: Span) -> IResult<Span, ConfigRuleStateme
}
#[parser]
pub fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -197,7 +197,7 @@ pub fn config_rule_statement_inst_lib(s: Span) -> IResult<Span, ConfigRuleStatem
}
#[parser]
pub fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -208,7 +208,7 @@ pub fn config_rule_statement_inst_use(s: Span) -> IResult<Span, ConfigRuleStatem
}
#[parser]
pub fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRuleStatement> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -219,7 +219,7 @@ pub fn config_rule_statement_cell_lib(s: Span) -> IResult<Span, ConfigRuleStatem
}
#[parser]
pub fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRuleStatement> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -230,27 +230,27 @@ pub fn config_rule_statement_cell_use(s: Span) -> IResult<Span, ConfigRuleStatem
}
#[parser]
pub fn default_clause(s: Span) -> IResult<Span, DefaultClause> {
pub(crate) fn default_clause(s: Span) -> IResult<Span, DefaultClause> {
let (s, a) = keyword("default")(s)?;
Ok((s, DefaultClause { nodes: (a,) }))
}
#[parser]
pub fn inst_clause(s: Span) -> IResult<Span, InstClause> {
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]
pub fn inst_name(s: Span) -> IResult<Span, InstName> {
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]
pub fn cell_clause(s: Span) -> IResult<Span, CellClause> {
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)?;
let (s, c) = cell_identifier(s)?;
@ -258,19 +258,19 @@ pub fn cell_clause(s: Span) -> IResult<Span, CellClause> {
}
#[parser]
pub fn liblist_clause(s: Span) -> IResult<Span, LiblistClause> {
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]
pub fn use_clause(s: Span) -> IResult<Span, UseClause> {
pub(crate) fn use_clause(s: Span) -> IResult<Span, UseClause> {
alt((use_clause_cell, use_clause_named, use_clause_cell_named))(s)
}
#[parser]
pub fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
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)?;
let (s, c) = cell_identifier(s)?;
@ -284,7 +284,7 @@ pub fn use_clause_cell(s: Span) -> IResult<Span, UseClause> {
}
#[parser]
pub fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
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)?;
let (s, c) = opt(pair(symbol(":"), config))(s)?;
@ -295,7 +295,7 @@ pub fn use_clause_named(s: Span) -> IResult<Span, UseClause> {
}
#[parser]
pub fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
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)?;
let (s, c) = cell_identifier(s)?;
@ -310,7 +310,7 @@ pub fn use_clause_cell_named(s: Span) -> IResult<Span, UseClause> {
}
#[parser]
pub fn config(s: Span) -> IResult<Span, Config> {
pub(crate) fn config(s: Span) -> IResult<Span, Config> {
let (s, a) = keyword("config")(s)?;
Ok((s, Config { nodes: (a,) }))
}

View File

@ -180,7 +180,7 @@ pub struct IdentifierList {
// -----------------------------------------------------------------------------
#[parser]
pub fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
pub(crate) fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
let (s, a) = opt(r#static)(s)?;
let (s, b) = keyword("constraint")(s)?;
let (s, c) = constraint_identifier(s)?;
@ -194,19 +194,19 @@ pub fn constraint_declaration(s: Span) -> IResult<Span, ConstraintDeclaration> {
}
#[parser]
pub fn r#static(s: Span) -> IResult<Span, Static> {
pub(crate) fn r#static(s: Span) -> IResult<Span, Static> {
let (s, a) = keyword("static")(s)?;
Ok((s, Static { nodes: (a,) }))
}
#[parser]
pub fn constraint_block(s: Span) -> IResult<Span, ConstraintBlock> {
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]
pub fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockItem> {
pub(crate) fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockItem> {
alt((
constraint_block_item_solve,
map(constraint_expression, |x| {
@ -216,7 +216,7 @@ pub fn constraint_block_item(s: Span) -> IResult<Span, ConstraintBlockItem> {
}
#[parser]
pub fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBlockItem> {
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)?;
let (s, c) = keyword("before")(s)?;
@ -231,13 +231,13 @@ pub fn constraint_block_item_solve(s: Span) -> IResult<Span, ConstraintBlockItem
}
#[parser]
pub fn solve_before_list(s: Span) -> IResult<Span, SolveBeforeList> {
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]
pub fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
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)?;
let (s, c) = select(s)?;
@ -245,7 +245,7 @@ pub fn constraint_primary(s: Span) -> IResult<Span, ConstraintPrimary> {
}
#[parser]
pub fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
alt((
constraint_expression_expression,
map(pair(uniqueness_constraint, symbol(";")), |x| {
@ -259,7 +259,7 @@ pub fn constraint_expression(s: Span) -> IResult<Span, ConstraintExpression> {
}
#[parser(MaybeRecursive)]
pub fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = opt(soft)(s)?;
let (s, b) = expression_or_dist(s)?;
let (s, c) = symbol(";")(s)?;
@ -272,13 +272,13 @@ pub fn constraint_expression_expression(s: Span) -> IResult<Span, ConstraintExpr
}
#[parser]
pub fn soft(s: Span) -> IResult<Span, Soft> {
pub(crate) fn soft(s: Span) -> IResult<Span, Soft> {
let (s, a) = keyword("soft")(s)?;
Ok((s, Soft { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = expression(s)?;
let (s, b) = symbol("->")(s)?;
let (s, c) = constraint_set(s)?;
@ -289,7 +289,7 @@ pub fn constraint_expression_arrow(s: Span) -> IResult<Span, ConstraintExpressio
}
#[parser]
pub fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = keyword("if")(s)?;
let (s, b) = paren(expression)(s)?;
let (s, c) = constraint_set(s)?;
@ -303,7 +303,7 @@ pub fn constraint_expression_if(s: Span) -> IResult<Span, ConstraintExpression>
}
#[parser]
pub fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = keyword("foreach")(s)?;
let (s, b) = paren(pair(
ps_or_hierarchical_array_identifier,
@ -317,7 +317,7 @@ pub fn constraint_expression_foreach(s: Span) -> IResult<Span, ConstraintExpress
}
#[parser]
pub fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpression> {
pub(crate) fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpression> {
let (s, a) = keyword("disable")(s)?;
let (s, b) = keyword("soft")(s)?;
let (s, c) = constraint_primary(s)?;
@ -331,14 +331,14 @@ pub fn constraint_expression_disable(s: Span) -> IResult<Span, ConstraintExpress
}
#[parser]
pub fn uniqueness_constraint(s: Span) -> IResult<Span, UniquenessConstraint> {
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]
pub fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
pub(crate) fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
alt((
map(constraint_expression, |x| {
ConstraintSet::ConstraintExpression(Box::new(x))
@ -348,7 +348,7 @@ pub fn constraint_set(s: Span) -> IResult<Span, ConstraintSet> {
}
#[parser]
pub fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
pub(crate) fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
let (s, a) = brace(many0(constraint_expression))(s)?;
Ok((
s,
@ -357,25 +357,25 @@ pub fn constraint_set_brace(s: Span) -> IResult<Span, ConstraintSet> {
}
#[parser(MaybeRecursive)]
pub fn dist_list(s: Span) -> IResult<Span, DistList> {
pub(crate) fn dist_list(s: Span) -> IResult<Span, DistList> {
let (s, a) = list(symbol(","), dist_item)(s)?;
Ok((s, DistList { nodes: (a,) }))
}
#[parser(MaybeRecursive)]
pub fn dist_item(s: Span) -> IResult<Span, DistItem> {
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]
pub fn dist_weight(s: Span) -> IResult<Span, DistWeight> {
pub(crate) fn dist_weight(s: Span) -> IResult<Span, DistWeight> {
alt((dist_weight_equal, dist_weight_divide))(s)
}
#[parser]
pub fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
pub(crate) fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
let (s, a) = symbol(":=")(s)?;
let (s, b) = expression(s)?;
Ok((
@ -385,7 +385,7 @@ pub fn dist_weight_equal(s: Span) -> IResult<Span, DistWeight> {
}
#[parser]
pub fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
pub(crate) fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
let (s, a) = symbol(":/")(s)?;
let (s, b) = expression(s)?;
Ok((
@ -395,7 +395,7 @@ pub fn dist_weight_divide(s: Span) -> IResult<Span, DistWeight> {
}
#[parser]
pub fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype> {
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)?;
let (s, c) = keyword("constraint")(s)?;
@ -410,7 +410,7 @@ pub fn constraint_prototype(s: Span) -> IResult<Span, ConstraintPrototype> {
}
#[parser]
pub fn constraint_prototype_qualifier(s: Span) -> IResult<Span, ConstraintPrototypeQualifier> {
pub(crate) fn constraint_prototype_qualifier(s: Span) -> IResult<Span, ConstraintPrototypeQualifier> {
alt((
map(keyword("extern"), |x| {
ConstraintPrototypeQualifier::Extern(Box::new(x))
@ -422,7 +422,7 @@ pub fn constraint_prototype_qualifier(s: Span) -> IResult<Span, ConstraintProtot
}
#[parser]
pub fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintDeclaration> {
pub(crate) fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintDeclaration> {
let (s, a) = opt(r#static)(s)?;
let (s, b) = keyword("constraint")(s)?;
let (s, c) = class_scope(s)?;
@ -437,7 +437,7 @@ pub fn extern_constraint_declaration(s: Span) -> IResult<Span, ExternConstraintD
}
#[parser]
pub fn identifier_list(s: Span) -> IResult<Span, IdentifierList> {
pub(crate) fn identifier_list(s: Span) -> IResult<Span, IdentifierList> {
let (s, a) = list(symbol(","), identifier)(s)?;
Ok((s, IdentifierList { nodes: (a,) }))
}

View File

@ -59,7 +59,7 @@ pub enum NonPortInterfaceItem {
// -----------------------------------------------------------------------------
#[parser]
pub fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
pub(crate) fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
alt((
interface_or_generate_item_module,
interface_or_generate_item_extern,
@ -67,7 +67,7 @@ pub fn interface_or_generate_item(s: Span) -> IResult<Span, InterfaceOrGenerateI
}
#[parser(MaybeRecursive)]
pub fn interface_or_generate_item_module(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
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)?;
Ok((
@ -77,7 +77,7 @@ pub fn interface_or_generate_item_module(s: Span) -> IResult<Span, InterfaceOrGe
}
#[parser]
pub fn interface_or_generate_item_extern(s: Span) -> IResult<Span, InterfaceOrGenerateItem> {
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)?;
Ok((
@ -87,12 +87,12 @@ pub fn interface_or_generate_item_extern(s: Span) -> IResult<Span, InterfaceOrGe
}
#[parser]
pub fn extern_tf_declaration(s: Span) -> IResult<Span, ExternTfDeclaration> {
pub(crate) fn extern_tf_declaration(s: Span) -> IResult<Span, ExternTfDeclaration> {
alt((extern_tf_declaration_method, extern_tf_declaration_task))(s)
}
#[parser]
pub fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaration> {
pub(crate) fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaration> {
let (s, a) = keyword("extern")(s)?;
let (s, b) = method_prototype(s)?;
let (s, c) = symbol(";")(s)?;
@ -103,7 +103,7 @@ pub fn extern_tf_declaration_method(s: Span) -> IResult<Span, ExternTfDeclaratio
}
#[parser]
pub fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration> {
pub(crate) fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration> {
let (s, a) = keyword("extern")(s)?;
let (s, b) = keyword("forkjoin")(s)?;
let (s, c) = task_prototype(s)?;
@ -117,7 +117,7 @@ pub fn extern_tf_declaration_task(s: Span) -> IResult<Span, ExternTfDeclaration>
}
#[parser]
pub fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
pub(crate) fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
InterfaceItem::PortDeclaration(Box::new(x))
@ -129,7 +129,7 @@ pub fn interface_item(s: Span) -> IResult<Span, InterfaceItem> {
}
#[parser]
pub fn non_port_interface_item(s: Span) -> IResult<Span, NonPortInterfaceItem> {
pub(crate) fn non_port_interface_item(s: Span) -> IResult<Span, NonPortInterfaceItem> {
alt((
map(generate_region, |x| {
NonPortInterfaceItem::GenerateRegion(Box::new(x))

View File

@ -45,13 +45,13 @@ pub struct FilePathSpec {
// -----------------------------------------------------------------------------
#[parser]
pub fn library_text(s: Span) -> IResult<Span, LibraryText> {
pub(crate) fn library_text(s: Span) -> IResult<Span, LibraryText> {
let (s, a) = many0(library_description)(s)?;
Ok((s, LibraryText { nodes: (a,) }))
}
#[parser]
pub fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
pub(crate) fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
alt((
map(library_declaration, |x| {
LibraryDescription::LibraryDeclaration(Box::new(x))
@ -67,7 +67,7 @@ pub fn library_description(s: Span) -> IResult<Span, LibraryDescription> {
}
#[parser]
pub fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
pub(crate) fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
let (s, a) = keyword("library")(s)?;
let (s, b) = library_identifier(s)?;
let (s, c) = list(symbol(","), file_path_spec)(s)?;
@ -82,7 +82,7 @@ pub fn library_declaration(s: Span) -> IResult<Span, LibraryDeclaration> {
}
#[parser]
pub fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
pub(crate) fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
let (s, a) = keyword("include")(s)?;
let (s, b) = file_path_spec(s)?;
let (s, c) = symbol(";")(s)?;
@ -91,7 +91,7 @@ pub fn include_statement(s: Span) -> IResult<Span, IncludeStatement> {
//TODO support non literal path
#[parser]
pub fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
pub(crate) fn file_path_spec(s: Span) -> IResult<Span, FilePathSpec> {
let (s, a) = string_literal(s)?;
Ok((s, FilePathSpec { nodes: (a,) }))
}

View File

@ -194,7 +194,7 @@ pub enum BindInstantiation {
// -----------------------------------------------------------------------------
#[parser]
pub fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask> {
pub(crate) fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask> {
alt((
elaboration_system_task_fatal,
elaboration_system_task_error,
@ -204,7 +204,7 @@ pub fn elaboration_system_task(s: Span) -> IResult<Span, ElaborationSystemTask>
}
#[parser]
pub fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystemTask> {
pub(crate) fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystemTask> {
let (s, a) = keyword("$fatal")(s)?;
let (s, b) = opt(paren(pair(
finish_number,
@ -218,7 +218,7 @@ pub fn elaboration_system_task_fatal(s: Span) -> IResult<Span, ElaborationSystem
}
#[parser]
pub fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystemTask> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -229,7 +229,7 @@ pub fn elaboration_system_task_error(s: Span) -> IResult<Span, ElaborationSystem
}
#[parser]
pub fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSystemTask> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -242,7 +242,7 @@ pub fn elaboration_system_task_warning(s: Span) -> IResult<Span, ElaborationSyst
}
#[parser]
pub fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemTask> {
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)?;
let (s, c) = symbol(";")(s)?;
@ -253,7 +253,7 @@ pub fn elaboration_system_task_info(s: Span) -> IResult<Span, ElaborationSystemT
}
#[parser]
pub fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
pub(crate) fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
alt((
map(symbol("0"), |x| FinishNumber::Zero(Box::new(x))),
map(symbol("1"), |x| FinishNumber::One(Box::new(x))),
@ -262,7 +262,7 @@ pub fn finish_number(s: Span) -> IResult<Span, FinishNumber> {
}
#[parser]
pub fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
pub(crate) fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
alt((
map(module_or_generate_item_declaration, |x| {
ModuleCommonItem::ModuleOrGenerateItemDeclaration(Box::new(x))
@ -305,7 +305,7 @@ pub fn module_common_item(s: Span) -> IResult<Span, ModuleCommonItem> {
}
#[parser]
pub fn module_item(s: Span) -> IResult<Span, ModuleItem> {
pub(crate) fn module_item(s: Span) -> IResult<Span, ModuleItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
ModuleItem::PortDeclaration(Box::new(x))
@ -317,7 +317,7 @@ pub fn module_item(s: Span) -> IResult<Span, ModuleItem> {
}
#[parser]
pub fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
pub(crate) fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
alt((
module_or_generate_item_parameter,
module_or_generate_item_gate,
@ -328,7 +328,7 @@ pub fn module_or_generate_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
}
#[parser]
pub fn module_or_generate_item_parameter(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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)?;
Ok((
@ -338,7 +338,7 @@ pub fn module_or_generate_item_parameter(s: Span) -> IResult<Span, ModuleOrGener
}
#[parser]
pub fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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)?;
Ok((
@ -348,7 +348,7 @@ pub fn module_or_generate_item_gate(s: Span) -> IResult<Span, ModuleOrGenerateIt
}
#[parser]
pub fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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)?;
Ok((
@ -358,7 +358,7 @@ pub fn module_or_generate_item_udp(s: Span) -> IResult<Span, ModuleOrGenerateIte
}
#[parser]
pub fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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)?;
Ok((
@ -368,7 +368,7 @@ pub fn module_or_generate_item_module(s: Span) -> IResult<Span, ModuleOrGenerate
}
#[parser(MaybeRecursive)]
pub fn module_or_generate_item_module_item(s: Span) -> IResult<Span, ModuleOrGenerateItem> {
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)?;
Ok((
@ -380,7 +380,7 @@ pub fn module_or_generate_item_module_item(s: Span) -> IResult<Span, ModuleOrGen
}
#[parser]
pub fn module_or_generate_item_declaration(
pub(crate) fn module_or_generate_item_declaration(
s: Span,
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
alt((
@ -399,7 +399,7 @@ pub fn module_or_generate_item_declaration(
}
#[parser]
pub fn module_or_generate_item_declaration_clocking(
pub(crate) fn module_or_generate_item_declaration_clocking(
s: Span,
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
let (s, a) = keyword("default")(s)?;
@ -417,7 +417,7 @@ pub fn module_or_generate_item_declaration_clocking(
}
#[parser]
pub fn module_or_generate_item_declaration_disable(
pub(crate) fn module_or_generate_item_declaration_disable(
s: Span,
) -> IResult<Span, ModuleOrGenerateItemDeclaration> {
let (s, a) = keyword("default")(s)?;
@ -436,7 +436,7 @@ pub fn module_or_generate_item_declaration_disable(
}
#[parser]
pub fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem> {
pub(crate) fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem> {
alt((
map(generate_region, |x| {
NonPortModuleItem::GenerateRegion(Box::new(x))
@ -464,7 +464,7 @@ pub fn non_port_module_item(s: Span) -> IResult<Span, NonPortModuleItem> {
}
#[parser]
pub fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortModuleItem> {
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)?;
Ok((
@ -474,7 +474,7 @@ pub fn non_port_module_item_specparam(s: Span) -> IResult<Span, NonPortModuleIte
}
#[parser]
pub fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
pub(crate) fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
let (s, a) = keyword("defparam")(s)?;
let (s, b) = list_of_defparam_assignments(s)?;
let (s, c) = symbol(";")(s)?;
@ -482,12 +482,12 @@ pub fn parameter_override(s: Span) -> IResult<Span, ParameterOverride> {
}
#[parser]
pub fn bind_directive(s: Span) -> IResult<Span, BindDirective> {
pub(crate) fn bind_directive(s: Span) -> IResult<Span, BindDirective> {
alt((bind_directive_scope, bind_directive_instance))(s)
}
#[parser]
pub fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
pub(crate) fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
let (s, a) = keyword("bind")(s)?;
let (s, b) = bind_target_scope(s)?;
let (s, c) = opt(pair(symbol(":"), bind_target_instance_list))(s)?;
@ -502,7 +502,7 @@ pub fn bind_directive_scope(s: Span) -> IResult<Span, BindDirective> {
}
#[parser]
pub fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
pub(crate) fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
let (s, a) = keyword("bind")(s)?;
let (s, b) = bind_target_instance(s)?;
let (s, c) = bind_instantiation(s)?;
@ -516,7 +516,7 @@ pub fn bind_directive_instance(s: Span) -> IResult<Span, BindDirective> {
}
#[parser]
pub fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
pub(crate) fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
alt((
map(module_identifier, |x| {
BindTargetScope::ModuleIdentifier(Box::new(x))
@ -528,20 +528,20 @@ pub fn bind_target_scope(s: Span) -> IResult<Span, BindTargetScope> {
}
#[parser]
pub fn bind_target_instance(s: Span) -> IResult<Span, BindTargetInstance> {
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]
pub fn bind_target_instance_list(s: Span) -> IResult<Span, BindTargetInstanceList> {
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]
pub fn bind_instantiation(s: Span) -> IResult<Span, BindInstantiation> {
pub(crate) fn bind_instantiation(s: Span) -> IResult<Span, BindInstantiation> {
alt((
map(program_instantiation, |x| {
BindInstantiation::ProgramInstantiation(Box::new(x))

View File

@ -204,7 +204,7 @@ pub struct AnsiPortDeclarationParen {
// -----------------------------------------------------------------------------
#[parser]
pub fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
pub(crate) fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
alt((
parameter_port_list_assignment,
parameter_port_list_declaration,
@ -213,7 +213,7 @@ pub fn parameter_port_list(s: Span) -> IResult<Span, ParameterPortList> {
}
#[parser]
pub fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortList> {
pub(crate) fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortList> {
let (s, a) = symbol("#")(s)?;
let (s, b) = paren(pair(
list_of_param_assignments,
@ -226,7 +226,7 @@ pub fn parameter_port_list_assignment(s: Span) -> IResult<Span, ParameterPortLis
}
#[parser]
pub fn parameter_port_list_declaration(s: Span) -> IResult<Span, ParameterPortList> {
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)?;
Ok((
@ -236,7 +236,7 @@ pub fn parameter_port_list_declaration(s: Span) -> IResult<Span, ParameterPortLi
}
#[parser]
pub fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
pub(crate) fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
let (s, a) = symbol("#")(s)?;
let (s, b) = symbol("(")(s)?;
let (s, c) = symbol(")")(s)?;
@ -244,7 +244,7 @@ pub fn parameter_port_list_empty(s: Span) -> IResult<Span, ParameterPortList> {
}
#[parser]
pub fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclaration> {
pub(crate) fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclaration> {
alt((
map(parameter_declaration, |x| {
ParameterPortDeclaration::ParameterDeclaration(Box::new(x))
@ -258,7 +258,7 @@ pub fn parameter_port_declaration(s: Span) -> IResult<Span, ParameterPortDeclara
}
#[parser]
pub fn parameter_port_declaration_param_list(s: Span) -> IResult<Span, ParameterPortDeclaration> {
pub(crate) fn parameter_port_declaration_param_list(s: Span) -> IResult<Span, ParameterPortDeclaration> {
let (s, a) = data_type(s)?;
let (s, b) = list_of_param_assignments(s)?;
Ok((
@ -270,7 +270,7 @@ pub fn parameter_port_declaration_param_list(s: Span) -> IResult<Span, Parameter
}
#[parser]
pub fn parameter_port_declaration_type_list(s: Span) -> IResult<Span, ParameterPortDeclaration> {
pub(crate) fn parameter_port_declaration_type_list(s: Span) -> IResult<Span, ParameterPortDeclaration> {
let (s, a) = keyword("type")(s)?;
let (s, b) = list_of_type_assignments(s)?;
Ok((
@ -282,13 +282,13 @@ pub fn parameter_port_declaration_type_list(s: Span) -> IResult<Span, ParameterP
}
#[parser]
pub fn list_of_ports(s: Span) -> IResult<Span, ListOfPorts> {
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]
pub fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDeclarations> {
pub(crate) fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDeclarations> {
let (s, a) = paren(opt(list(
symbol(","),
pair(many0(attribute_instance), ansi_port_declaration),
@ -297,7 +297,7 @@ pub fn list_of_port_declarations(s: Span) -> IResult<Span, ListOfPortDeclaration
}
#[parser]
pub fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
pub(crate) fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
alt((
port_declaration_inout,
port_declaration_input,
@ -308,7 +308,7 @@ pub fn port_declaration(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
pub(crate) fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = inout_declaration(s)?;
Ok((
@ -318,7 +318,7 @@ pub fn port_declaration_inout(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
pub(crate) fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = input_declaration(s)?;
Ok((
@ -328,7 +328,7 @@ pub fn port_declaration_input(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
pub(crate) fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = output_declaration(s)?;
Ok((
@ -338,7 +338,7 @@ pub fn port_declaration_output(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
pub(crate) fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = ref_declaration(s)?;
Ok((
@ -348,7 +348,7 @@ pub fn port_declaration_ref(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclaration> {
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)?;
Ok((
@ -358,18 +358,18 @@ pub fn port_declaration_interface(s: Span) -> IResult<Span, PortDeclaration> {
}
#[parser]
pub fn port(s: Span) -> IResult<Span, Port> {
pub(crate) fn port(s: Span) -> IResult<Span, Port> {
alt((port_non_named, port_named))(s)
}
#[parser(MaybeRecursive)]
pub fn port_non_named(s: Span) -> IResult<Span, Port> {
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]
pub fn port_named(s: Span) -> IResult<Span, Port> {
pub(crate) fn port_named(s: Span) -> IResult<Span, Port> {
let (s, a) = symbol(".")(s)?;
let (s, b) = port_identifier(s)?;
let (s, c) = paren(opt(port_expression))(s)?;
@ -377,7 +377,7 @@ pub fn port_named(s: Span) -> IResult<Span, Port> {
}
#[parser]
pub fn port_expression(s: Span) -> IResult<Span, PortExpression> {
pub(crate) fn port_expression(s: Span) -> IResult<Span, PortExpression> {
alt((
map(port_reference, |x| {
PortExpression::PortReference(Box::new(x))
@ -387,7 +387,7 @@ pub fn port_expression(s: Span) -> IResult<Span, PortExpression> {
}
#[parser]
pub fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
pub(crate) fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
let (s, a) = brace(list(symbol(","), port_reference))(s)?;
Ok((
s,
@ -396,14 +396,14 @@ pub fn port_expressio_named(s: Span) -> IResult<Span, PortExpression> {
}
#[parser]
pub fn port_reference(s: Span) -> IResult<Span, PortReference> {
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]
pub fn port_direction(s: Span) -> IResult<Span, PortDirection> {
pub(crate) fn port_direction(s: Span) -> IResult<Span, PortDirection> {
alt((
map(keyword("input"), |x| PortDirection::Input(Box::new(x))),
map(keyword("output"), |x| PortDirection::Output(Box::new(x))),
@ -413,21 +413,21 @@ pub fn port_direction(s: Span) -> IResult<Span, PortDirection> {
}
#[parser]
pub fn net_port_header(s: Span) -> IResult<Span, NetPortHeader> {
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]
pub fn variable_port_header(s: Span) -> IResult<Span, VariablePortHeader> {
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]
pub fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeader> {
pub(crate) fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeader> {
alt((
interface_port_header_identifier,
interface_port_header_interface,
@ -435,7 +435,7 @@ pub fn interface_port_header(s: Span) -> IResult<Span, InterfacePortHeader> {
}
#[parser]
pub fn interface_port_header_identifier(s: Span) -> IResult<Span, InterfacePortHeader> {
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)?;
Ok((
@ -445,7 +445,7 @@ pub fn interface_port_header_identifier(s: Span) -> IResult<Span, InterfacePortH
}
#[parser]
pub fn interface_port_header_interface(s: Span) -> IResult<Span, InterfacePortHeader> {
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)?;
Ok((
@ -455,7 +455,7 @@ pub fn interface_port_header_interface(s: Span) -> IResult<Span, InterfacePortHe
}
#[parser]
pub fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
pub(crate) fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
alt((
ansi_port_declaration_net,
ansi_port_declaration_port,
@ -464,7 +464,7 @@ pub fn ansi_port_declaration(s: Span) -> IResult<Span, AnsiPortDeclaration> {
}
#[parser]
pub fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclaration> {
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)?;
let (s, c) = many0(unpacked_dimension)(s)?;
@ -478,7 +478,7 @@ pub fn ansi_port_declaration_net(s: Span) -> IResult<Span, AnsiPortDeclaration>
}
#[parser]
pub fn net_port_header_or_interface_port_header(
pub(crate) fn net_port_header_or_interface_port_header(
s: Span,
) -> IResult<Span, NetPortHeaderOrInterfacePortHeader> {
alt((
@ -492,7 +492,7 @@ pub fn net_port_header_or_interface_port_header(
}
#[parser]
pub fn ansi_port_declaration_port(s: Span) -> IResult<Span, AnsiPortDeclaration> {
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)?;
let (s, c) = many0(variable_dimension)(s)?;
@ -506,7 +506,7 @@ pub fn ansi_port_declaration_port(s: Span) -> IResult<Span, AnsiPortDeclaration>
}
#[parser]
pub fn ansi_port_declaration_paren(s: Span) -> IResult<Span, AnsiPortDeclaration> {
pub(crate) fn ansi_port_declaration_paren(s: Span) -> IResult<Span, AnsiPortDeclaration> {
let (s, a) = opt(port_direction)(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = port_identifier(s)?;

View File

@ -52,7 +52,7 @@ pub enum AnonymousProgramItem {
// -----------------------------------------------------------------------------
#[parser]
pub fn package_item(s: Span) -> IResult<Span, PackageItem> {
pub(crate) fn package_item(s: Span) -> IResult<Span, PackageItem> {
alt((
map(package_or_generate_item_declaration, |x| {
PackageItem::PackageOrGenerateItemDeclaration(Box::new(x))
@ -70,7 +70,7 @@ pub fn package_item(s: Span) -> IResult<Span, PackageItem> {
}
#[parser]
pub fn package_or_generate_item_declaration(
pub(crate) fn package_or_generate_item_declaration(
s: Span,
) -> IResult<Span, PackageOrGenerateItemDeclaration> {
alt((
@ -120,7 +120,7 @@ pub fn package_or_generate_item_declaration(
}
#[parser]
pub fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
pub(crate) fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
let (s, a) = keyword("program")(s)?;
let (s, b) = symbol(";")(s)?;
let (s, c) = many0(anonymous_program_item)(s)?;
@ -134,7 +134,7 @@ pub fn anonymous_program(s: Span) -> IResult<Span, AnonymousProgram> {
}
#[parser]
pub fn anonymous_program_item(s: Span) -> IResult<Span, AnonymousProgramItem> {
pub(crate) fn anonymous_program_item(s: Span) -> IResult<Span, AnonymousProgramItem> {
alt((
map(task_declaration, |x| {
AnonymousProgramItem::TaskDeclaration(Box::new(x))

View File

@ -61,7 +61,7 @@ pub enum ProgramGenerateItem {
// -----------------------------------------------------------------------------
#[parser]
pub fn program_item(s: Span) -> IResult<Span, ProgramItem> {
pub(crate) fn program_item(s: Span) -> IResult<Span, ProgramItem> {
alt((
map(pair(port_declaration, symbol(";")), |x| {
ProgramItem::PortDeclaration(Box::new(x))
@ -73,7 +73,7 @@ pub fn program_item(s: Span) -> IResult<Span, ProgramItem> {
}
#[parser]
pub fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
pub(crate) fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
alt((
non_port_program_item_assign,
non_port_program_item_module,
@ -90,7 +90,7 @@ pub fn non_port_program_item(s: Span) -> IResult<Span, NonPortProgramItem> {
}
#[parser]
pub fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProgramItem> {
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)?;
Ok((
@ -100,7 +100,7 @@ pub fn non_port_program_item_assign(s: Span) -> IResult<Span, NonPortProgramItem
}
#[parser(MaybeRecursive)]
pub fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProgramItem> {
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)?;
Ok((
@ -110,7 +110,7 @@ pub fn non_port_program_item_module(s: Span) -> IResult<Span, NonPortProgramItem
}
#[parser]
pub fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortProgramItem> {
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)?;
Ok((
@ -120,7 +120,7 @@ pub fn non_port_program_item_initial(s: Span) -> IResult<Span, NonPortProgramIte
}
#[parser]
pub fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgramItem> {
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)?;
Ok((
@ -130,7 +130,7 @@ pub fn non_port_program_item_final(s: Span) -> IResult<Span, NonPortProgramItem>
}
#[parser]
pub fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortProgramItem> {
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)?;
Ok((
@ -140,7 +140,7 @@ pub fn non_port_program_item_assertion(s: Span) -> IResult<Span, NonPortProgramI
}
#[parser]
pub fn program_generate_item(s: Span) -> IResult<Span, ProgramGenerateItem> {
pub(crate) fn program_generate_item(s: Span) -> IResult<Span, ProgramGenerateItem> {
alt((
map(loop_generate_construct, |x| {
ProgramGenerateItem::LoopGenerateConstruct(Box::new(x))

View File

@ -18,6 +18,7 @@ pub enum Description {
ModuleDeclaration(Box<ModuleDeclaration>),
UdpDeclaration(Box<UdpDeclaration>),
InterfaceDeclaration(Box<InterfaceDeclaration>),
InterfaceClassDeclaration(Box<InterfaceClassDeclaration>),
ProgramDeclaration(Box<ProgramDeclaration>),
PackageDeclaration(Box<PackageDeclaration>),
PackageItem(Box<DescriptionPackageItem>),
@ -415,14 +416,14 @@ pub struct TimeunitsDeclarationTimeprecisionTimeunit {
// -----------------------------------------------------------------------------
#[parser]
pub fn source_text(s: Span) -> IResult<Span, SourceText> {
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]
pub fn description(s: Span) -> IResult<Span, Description> {
pub(crate) fn description(s: Span) -> IResult<Span, Description> {
alt((
map(module_declaration, |x| {
Description::ModuleDeclaration(Box::new(x))
@ -433,6 +434,9 @@ pub fn description(s: Span) -> IResult<Span, Description> {
map(interface_declaration, |x| {
Description::InterfaceDeclaration(Box::new(x))
}),
map(interface_class_declaration, |x| {
Description::InterfaceClassDeclaration(Box::new(x))
}),
map(program_declaration, |x| {
Description::ProgramDeclaration(Box::new(x))
}),
@ -448,7 +452,7 @@ pub fn description(s: Span) -> IResult<Span, Description> {
}
#[parser(MaybeRecursive)]
pub fn description_package_item(s: Span) -> IResult<Span, Description> {
pub(crate) fn description_package_item(s: Span) -> IResult<Span, Description> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = package_item(s)?;
Ok((
@ -458,7 +462,7 @@ pub fn description_package_item(s: Span) -> IResult<Span, Description> {
}
#[parser]
pub fn description_bind_directive(s: Span) -> IResult<Span, Description> {
pub(crate) fn description_bind_directive(s: Span) -> IResult<Span, Description> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = bind_directive(s)?;
Ok((
@ -468,7 +472,7 @@ pub fn description_bind_directive(s: Span) -> IResult<Span, Description> {
}
#[parser]
pub fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
pub(crate) fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = module_keyword(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -486,7 +490,7 @@ pub fn module_nonansi_header(s: Span) -> IResult<Span, ModuleNonansiHeader> {
}
#[parser]
pub fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
pub(crate) fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = module_keyword(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -504,7 +508,7 @@ pub fn module_ansi_header(s: Span) -> IResult<Span, ModuleAnsiHeader> {
}
#[parser]
pub fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
pub(crate) fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
alt((
module_declaration_nonansi,
module_declaration_ansi,
@ -515,7 +519,7 @@ pub fn module_declaration(s: Span) -> IResult<Span, ModuleDeclaration> {
}
#[parser]
pub fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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)?;
let (s, c) = many0(module_item)(s)?;
@ -530,7 +534,7 @@ pub fn module_declaration_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
}
#[parser]
pub fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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)?;
let (s, c) = many0(non_port_module_item)(s)?;
@ -545,7 +549,7 @@ pub fn module_declaration_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
}
#[parser]
pub fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration> {
pub(crate) fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = module_keyword(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -565,7 +569,7 @@ pub fn module_declaration_wildcard(s: Span) -> IResult<Span, ModuleDeclaration>
}
#[parser]
pub fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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)?;
Ok((
@ -577,7 +581,7 @@ pub fn module_declaration_extern_nonansi(s: Span) -> IResult<Span, ModuleDeclara
}
#[parser]
pub fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDeclaration> {
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)?;
Ok((
@ -587,7 +591,7 @@ pub fn module_declaration_extern_ansi(s: Span) -> IResult<Span, ModuleDeclaratio
}
#[parser]
pub fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
pub(crate) fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
alt((
map(keyword("module"), |x| ModuleKeyword::Module(Box::new(x))),
map(keyword("macromodule"), |x| {
@ -597,7 +601,7 @@ pub fn module_keyword(s: Span) -> IResult<Span, ModuleKeyword> {
}
#[parser]
pub fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
pub(crate) fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
alt((
interface_declaration_nonansi,
interface_declaration_ansi,
@ -608,7 +612,7 @@ pub fn interface_declaration(s: Span) -> IResult<Span, InterfaceDeclaration> {
}
#[parser]
pub fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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)?;
let (s, c) = many0(interface_item)(s)?;
@ -623,7 +627,7 @@ pub fn interface_declaration_nonansi(s: Span) -> IResult<Span, InterfaceDeclarat
}
#[parser]
pub fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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)?;
let (s, c) = many0(non_port_interface_item)(s)?;
@ -638,7 +642,7 @@ pub fn interface_declaration_ansi(s: Span) -> IResult<Span, InterfaceDeclaration
}
#[parser]
pub fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclaration> {
pub(crate) fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("interface")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -658,7 +662,7 @@ pub fn interface_declaration_wildcard(s: Span) -> IResult<Span, InterfaceDeclara
}
#[parser]
pub fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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)?;
Ok((
@ -670,7 +674,7 @@ pub fn interface_declaration_extern_nonansi(s: Span) -> IResult<Span, InterfaceD
}
#[parser]
pub fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, InterfaceDeclaration> {
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)?;
Ok((
@ -682,7 +686,7 @@ pub fn interface_declaration_extern_ansi(s: Span) -> IResult<Span, InterfaceDecl
}
#[parser]
pub fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader> {
pub(crate) fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("interface")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -700,7 +704,7 @@ pub fn interface_nonansi_header(s: Span) -> IResult<Span, InterfaceNonansiHeader
}
#[parser]
pub fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
pub(crate) fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("interface")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -718,7 +722,7 @@ pub fn interface_ansi_header(s: Span) -> IResult<Span, InterfaceAnsiHeader> {
}
#[parser]
pub fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
pub(crate) fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
alt((
program_declaration_nonansi,
program_declaration_ansi,
@ -729,7 +733,7 @@ pub fn program_declaration(s: Span) -> IResult<Span, ProgramDeclaration> {
}
#[parser]
pub fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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)?;
let (s, c) = many0(program_item)(s)?;
@ -744,7 +748,7 @@ pub fn program_declaration_nonansi(s: Span) -> IResult<Span, ProgramDeclaration>
}
#[parser]
pub fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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)?;
let (s, c) = many0(non_port_program_item)(s)?;
@ -759,7 +763,7 @@ pub fn program_declaration_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
}
#[parser]
pub fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration> {
pub(crate) fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("program")(s)?;
let (s, c) = program_identifier(s)?;
@ -778,7 +782,7 @@ pub fn program_declaration_wildcard(s: Span) -> IResult<Span, ProgramDeclaration
}
#[parser]
pub fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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)?;
Ok((
@ -790,7 +794,7 @@ pub fn program_declaration_extern_nonansi(s: Span) -> IResult<Span, ProgramDecla
}
#[parser]
pub fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramDeclaration> {
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)?;
Ok((
@ -800,7 +804,7 @@ pub fn program_declaration_extern_ansi(s: Span) -> IResult<Span, ProgramDeclarat
}
#[parser]
pub fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
pub(crate) fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("prgogram")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -818,7 +822,7 @@ pub fn program_nonansi_header(s: Span) -> IResult<Span, ProgramNonansiHeader> {
}
#[parser]
pub fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
pub(crate) fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("program")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -836,7 +840,7 @@ pub fn program_ansi_header(s: Span) -> IResult<Span, ProgramAnsiHeader> {
}
#[parser]
pub fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
pub(crate) fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
let (s, a) = keyword("checker")(s)?;
let (s, b) = checker_identifier(s)?;
let (s, c) = opt(paren(opt(checker_port_list)))(s)?;
@ -853,7 +857,7 @@ pub fn checker_declaration(s: Span) -> IResult<Span, CheckerDeclaration> {
}
#[parser]
pub fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
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)?;
let (s, c) = opt(lifetime)(s)?;
@ -881,14 +885,14 @@ pub fn class_declaration(s: Span) -> IResult<Span, ClassDeclaration> {
}
#[parser]
pub fn interface_class_type(s: Span) -> IResult<Span, InterfaceClassType> {
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]
pub fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceClassDeclaration> {
pub(crate) fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceClassDeclaration> {
let (s, a) = keyword("interface")(s)?;
let (s, b) = keyword("class")(s)?;
let (s, c) = class_identifier(s)?;
@ -910,7 +914,7 @@ pub fn interface_class_declaration(s: Span) -> IResult<Span, InterfaceClassDecla
}
#[parser]
pub fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
pub(crate) fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
alt((
map(type_declaration, |x| {
InterfaceClassItem::TypeDeclaration(Box::new(x))
@ -927,7 +931,7 @@ pub fn interface_class_item(s: Span) -> IResult<Span, InterfaceClassItem> {
}
#[parser]
pub fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceClassItem> {
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)?;
Ok((
@ -937,7 +941,7 @@ pub fn interface_class_item_method(s: Span) -> IResult<Span, InterfaceClassItem>
}
#[parser]
pub fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
pub(crate) fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
let (s, a) = keyword("pure")(s)?;
let (s, b) = keyword("virtual")(s)?;
let (s, c) = method_prototype(s)?;
@ -951,7 +955,7 @@ pub fn interface_class_method(s: Span) -> IResult<Span, InterfaceClassMethod> {
}
#[parser]
pub fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
pub(crate) fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("package")(s)?;
let (s, c) = opt(lifetime)(s)?;
@ -970,7 +974,7 @@ pub fn package_declaration(s: Span) -> IResult<Span, PackageDeclaration> {
}
#[parser]
pub fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
pub(crate) fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
alt((
timeunits_declaration_timeunit_timeprecision,
timeunits_declaration_timeunit,
@ -980,7 +984,7 @@ pub fn timeunits_declaration(s: Span) -> IResult<Span, TimeunitsDeclaration> {
}
#[parser]
pub fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclaration> {
pub(crate) fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclaration> {
let (s, a) = keyword("timeunit")(s)?;
let (s, b) = time_literal(s)?;
let (s, c) = opt(pair(symbol("/"), time_literal))(s)?;
@ -994,7 +998,7 @@ pub fn timeunits_declaration_timeunit(s: Span) -> IResult<Span, TimeunitsDeclara
}
#[parser]
pub fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDeclaration> {
pub(crate) fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDeclaration> {
let (s, a) = keyword("timeprecision")(s)?;
let (s, b) = time_literal(s)?;
let (s, c) = symbol(";")(s)?;
@ -1007,7 +1011,7 @@ pub fn timeunits_declaration_timeprecision(s: Span) -> IResult<Span, TimeunitsDe
}
#[parser]
pub fn timeunits_declaration_timeunit_timeprecision(
pub(crate) fn timeunits_declaration_timeunit_timeprecision(
s: Span,
) -> IResult<Span, TimeunitsDeclaration> {
let (s, a) = keyword("timeunit")(s)?;
@ -1027,7 +1031,7 @@ pub fn timeunits_declaration_timeunit_timeprecision(
}
#[parser]
pub fn timeunits_declaration_timeprecision_timeunit(
pub(crate) fn timeunits_declaration_timeprecision_timeunit(
s: Span,
) -> IResult<Span, TimeunitsDeclaration> {
let (s, a) = keyword("timeprecision")(s)?;

View File

@ -34,7 +34,7 @@ pub struct ShowcancelledDeclaration {
// -----------------------------------------------------------------------------
#[parser]
pub fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
pub(crate) fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
let (s, a) = keyword("specify")(s)?;
let (s, b) = many0(specify_item)(s)?;
let (s, c) = keyword("endspecify")(s)?;
@ -42,7 +42,7 @@ pub fn specify_block(s: Span) -> IResult<Span, SpecifyBlock> {
}
#[parser]
pub fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
pub(crate) fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
alt((
map(specparam_declaration, |x| {
SpecifyItem::SpecparamDeclaration(Box::new(x))
@ -63,7 +63,7 @@ pub fn specify_item(s: Span) -> IResult<Span, SpecifyItem> {
}
#[parser]
pub fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
pub(crate) fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
let (s, a) = alt((
keyword("pulsestyle_onevent"),
keyword("pulsestyle_ondetect"),
@ -74,7 +74,7 @@ pub fn pulsestyle_declaration(s: Span) -> IResult<Span, PulsestyleDeclaration> {
}
#[parser]
pub fn showcancelled_declaration(s: Span) -> IResult<Span, ShowcancelledDeclaration> {
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)?;
let (s, c) = symbol(";")(s)?;

View File

@ -43,14 +43,14 @@ pub struct OutputIdentifierInterface {
// -----------------------------------------------------------------------------
#[parser]
pub fn specify_input_terminal_descriptor(s: Span) -> IResult<Span, SpecifyInputTerminalDescriptor> {
pub(crate) fn specify_input_terminal_descriptor(s: Span) -> IResult<Span, SpecifyInputTerminalDescriptor> {
let (s, a) = input_identifier(s)?;
let (s, b) = opt(bracket(constant_range_expression))(s)?;
Ok((s, SpecifyInputTerminalDescriptor { nodes: (a, b) }))
}
#[parser]
pub fn specify_output_terminal_descriptor(
pub(crate) fn specify_output_terminal_descriptor(
s: Span,
) -> IResult<Span, SpecifyOutputTerminalDescriptor> {
let (s, a) = output_identifier(s)?;
@ -59,7 +59,7 @@ pub fn specify_output_terminal_descriptor(
}
#[parser]
pub fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
pub(crate) fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
alt((
map(input_port_identifier, |x| {
InputIdentifier::InputPortIdentifier(Box::new(x))
@ -72,7 +72,7 @@ pub fn input_identifier(s: Span) -> IResult<Span, InputIdentifier> {
}
#[parser]
pub fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
pub(crate) fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
let (s, a) = interface_identifier(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = port_identifier(s)?;
@ -83,7 +83,7 @@ pub fn input_identifier_interface(s: Span) -> IResult<Span, InputIdentifier> {
}
#[parser]
pub fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
pub(crate) fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
alt((
map(output_port_identifier, |x| {
OutputIdentifier::OutputPortIdentifier(Box::new(x))
@ -96,7 +96,7 @@ pub fn output_identifier(s: Span) -> IResult<Span, OutputIdentifier> {
}
#[parser]
pub fn output_identifier_interface(s: Span) -> IResult<Span, OutputIdentifier> {
pub(crate) fn output_identifier_interface(s: Span) -> IResult<Span, OutputIdentifier> {
let (s, a) = interface_identifier(s)?;
let (s, b) = symbol(".")(s)?;
let (s, c) = port_identifier(s)?;

View File

@ -67,7 +67,7 @@ pub struct ListOfPathOutputs {
// -----------------------------------------------------------------------------
#[parser]
pub fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
pub(crate) fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
alt((
map(pair(simple_path_declaration, symbol(";")), |x| {
PathDeclaration::SimplePathDeclaration(Box::new(x))
@ -82,7 +82,7 @@ pub fn path_declaration(s: Span) -> IResult<Span, PathDeclaration> {
}
#[parser]
pub fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration> {
pub(crate) fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration> {
alt((
simple_path_declaration_parallel,
simple_path_declaration_full,
@ -90,7 +90,7 @@ pub fn simple_path_declaration(s: Span) -> IResult<Span, SimplePathDeclaration>
}
#[parser]
pub fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDeclaration> {
pub(crate) fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDeclaration> {
let (s, a) = parallel_path_description(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = path_delay_value(s)?;
@ -103,7 +103,7 @@ pub fn simple_path_declaration_parallel(s: Span) -> IResult<Span, SimplePathDecl
}
#[parser]
pub fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclaration> {
pub(crate) fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclaration> {
let (s, a) = full_path_description(s)?;
let (s, b) = symbol("=")(s)?;
let (s, c) = path_delay_value(s)?;
@ -114,7 +114,7 @@ pub fn simple_path_declaration_full(s: Span) -> IResult<Span, SimplePathDeclarat
}
#[parser]
pub fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescription> {
pub(crate) fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescription> {
let (s, a) = paren(tuple((
specify_input_terminal_descriptor,
opt(polarity_operator),
@ -125,7 +125,7 @@ pub fn parallel_path_description(s: Span) -> IResult<Span, ParallelPathDescripti
}
#[parser]
pub fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
pub(crate) fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
let (s, a) = paren(tuple((
list_of_path_inputs,
opt(polarity_operator),
@ -136,13 +136,13 @@ pub fn full_path_description(s: Span) -> IResult<Span, FullPathDescription> {
}
#[parser]
pub fn list_of_path_inputs(s: Span) -> IResult<Span, ListOfPathInputs> {
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]
pub fn list_of_path_outputs(s: Span) -> IResult<Span, ListOfPathOutputs> {
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

@ -130,7 +130,7 @@ pub struct PolarityOperator {
// -----------------------------------------------------------------------------
#[parser]
pub fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
pub(crate) fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
alt((
map(list_of_path_delay_expressions, |x| {
PathDelayValue::ListOfPathDelayExpressions(Box::new(x))
@ -140,7 +140,7 @@ pub fn path_delay_value(s: Span) -> IResult<Span, PathDelayValue> {
}
#[parser]
pub fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
pub(crate) fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
let (s, a) = paren(list_of_path_delay_expressions)(s)?;
Ok((
s,
@ -149,25 +149,25 @@ pub fn path_delay_value_paren(s: Span) -> IResult<Span, PathDelayValue> {
}
#[parser]
pub fn list_of_path_delay_expressions(s: Span) -> IResult<Span, ListOfPathDelayExpressions> {
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]
pub fn t_path_delay_expression(s: Span) -> IResult<Span, TPathDelayExpression> {
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]
pub fn path_delay_expression(s: Span) -> IResult<Span, PathDelayExpression> {
pub(crate) fn path_delay_expression(s: Span) -> IResult<Span, PathDelayExpression> {
let (s, a) = constant_mintypmax_expression(s)?;
Ok((s, PathDelayExpression { nodes: (a,) }))
}
#[parser]
pub fn edge_sensitive_path_declaration(s: Span) -> IResult<Span, EdgeSensitivePathDeclaration> {
pub(crate) fn edge_sensitive_path_declaration(s: Span) -> IResult<Span, EdgeSensitivePathDeclaration> {
alt((
edge_sensitive_path_declaration_parallel,
edge_sensitive_path_declaration_full,
@ -175,7 +175,7 @@ pub fn edge_sensitive_path_declaration(s: Span) -> IResult<Span, EdgeSensitivePa
}
#[parser]
pub fn edge_sensitive_path_declaration_parallel(
pub(crate) fn edge_sensitive_path_declaration_parallel(
s: Span,
) -> IResult<Span, EdgeSensitivePathDeclaration> {
let (s, a) = parallel_edge_sensitive_path_description(s)?;
@ -190,7 +190,7 @@ pub fn edge_sensitive_path_declaration_parallel(
}
#[parser]
pub fn edge_sensitive_path_declaration_full(
pub(crate) fn edge_sensitive_path_declaration_full(
s: Span,
) -> IResult<Span, EdgeSensitivePathDeclaration> {
let (s, a) = full_edge_sensitive_path_description(s)?;
@ -205,7 +205,7 @@ pub fn edge_sensitive_path_declaration_full(
}
#[parser]
pub fn parallel_edge_sensitive_path_description(
pub(crate) fn parallel_edge_sensitive_path_description(
s: Span,
) -> IResult<Span, ParallelEdgeSensitivePathDescription> {
let (s, a) = paren(tuple((
@ -224,7 +224,7 @@ pub fn parallel_edge_sensitive_path_description(
}
#[parser]
pub fn full_edge_sensitive_path_description(
pub(crate) fn full_edge_sensitive_path_description(
s: Span,
) -> IResult<Span, FullEdgeSensitivePathDescription> {
let (s, a) = paren(tuple((
@ -243,13 +243,13 @@ pub fn full_edge_sensitive_path_description(
}
#[parser]
pub fn data_source_expression(s: Span) -> IResult<Span, DataSourceExpression> {
pub(crate) fn data_source_expression(s: Span) -> IResult<Span, DataSourceExpression> {
let (s, a) = expression(s)?;
Ok((s, DataSourceExpression { nodes: (a,) }))
}
#[parser]
pub fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
pub(crate) fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
alt((
map(keyword("posedge"), |x| EdgeIdentifier::Posedge(Box::new(x))),
map(keyword("negedge"), |x| EdgeIdentifier::Negedge(Box::new(x))),
@ -258,7 +258,7 @@ pub fn edge_identifier(s: Span) -> IResult<Span, EdgeIdentifier> {
}
#[parser]
pub fn state_dependent_path_declaration(s: Span) -> IResult<Span, StateDependentPathDeclaration> {
pub(crate) fn state_dependent_path_declaration(s: Span) -> IResult<Span, StateDependentPathDeclaration> {
alt((
state_dependent_path_declaration_if_simple,
state_dependent_path_declaration_if_edge_sensitive,
@ -267,7 +267,7 @@ pub fn state_dependent_path_declaration(s: Span) -> IResult<Span, StateDependent
}
#[parser]
pub fn state_dependent_path_declaration_if_simple(
pub(crate) fn state_dependent_path_declaration_if_simple(
s: Span,
) -> IResult<Span, StateDependentPathDeclaration> {
let (s, a) = keyword("if")(s)?;
@ -282,7 +282,7 @@ pub fn state_dependent_path_declaration_if_simple(
}
#[parser]
pub fn state_dependent_path_declaration_if_edge_sensitive(
pub(crate) fn state_dependent_path_declaration_if_edge_sensitive(
s: Span,
) -> IResult<Span, StateDependentPathDeclaration> {
let (s, a) = keyword("if")(s)?;
@ -297,7 +297,7 @@ pub fn state_dependent_path_declaration_if_edge_sensitive(
}
#[parser]
pub fn state_dependent_path_declaration_if_none(
pub(crate) fn state_dependent_path_declaration_if_none(
s: Span,
) -> IResult<Span, StateDependentPathDeclaration> {
let (s, a) = keyword("ifnone")(s)?;
@ -311,7 +311,7 @@ pub fn state_dependent_path_declaration_if_none(
}
#[parser]
pub fn polarity_operator(s: Span) -> IResult<Span, PolarityOperator> {
pub(crate) fn polarity_operator(s: Span) -> IResult<Span, PolarityOperator> {
alt((
map(symbol("+"), |x| PolarityOperator { nodes: (x,) }),
map(symbol("-"), |x| PolarityOperator { nodes: (x,) }),

View File

@ -91,25 +91,25 @@ pub struct TimingCheckLimit {
// -----------------------------------------------------------------------------
#[parser]
pub fn timecheck_condition(s: Span) -> IResult<Span, TimecheckCondition> {
pub(crate) fn timecheck_condition(s: Span) -> IResult<Span, TimecheckCondition> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, TimecheckCondition { nodes: (a,) }))
}
#[parser]
pub fn controlled_referecne_event(s: Span) -> IResult<Span, ControlledReferenceEvent> {
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]
pub fn data_event(s: Span) -> IResult<Span, DataEvent> {
pub(crate) fn data_event(s: Span) -> IResult<Span, DataEvent> {
let (s, a) = timing_check_event(s)?;
Ok((s, DataEvent { nodes: (a,) }))
}
#[parser]
pub fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
pub(crate) fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
alt((
map(terminal_identifier, |x| {
DelayedData::TerminalIdentifier(Box::new(x))
@ -119,7 +119,7 @@ pub fn delayed_data(s: Span) -> IResult<Span, DelayedData> {
}
#[parser]
pub fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData> {
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)?;
Ok((
@ -129,7 +129,7 @@ pub fn delayed_data_with_mintypmax(s: Span) -> IResult<Span, DelayedData> {
}
#[parser]
pub fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
pub(crate) fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
alt((
map(terminal_identifier, |x| {
DelayedReference::TerminalIdentifier(Box::new(x))
@ -139,7 +139,7 @@ pub fn delayed_reference(s: Span) -> IResult<Span, DelayedReference> {
}
#[parser]
pub fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, DelayedReference> {
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)?;
Ok((
@ -149,55 +149,55 @@ pub fn delayed_reference_with_mintypmax(s: Span) -> IResult<Span, DelayedReferen
}
#[parser]
pub fn end_edge_offset(s: Span) -> IResult<Span, EndEdgeOffset> {
pub(crate) fn end_edge_offset(s: Span) -> IResult<Span, EndEdgeOffset> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, EndEdgeOffset { nodes: (a,) }))
}
#[parser]
pub fn event_based_flag(s: Span) -> IResult<Span, EventBasedFlag> {
pub(crate) fn event_based_flag(s: Span) -> IResult<Span, EventBasedFlag> {
let (s, a) = constant_expression(s)?;
Ok((s, EventBasedFlag { nodes: (a,) }))
}
#[parser]
pub fn notifier(s: Span) -> IResult<Span, Notifier> {
pub(crate) fn notifier(s: Span) -> IResult<Span, Notifier> {
let (s, a) = variable_identifier(s)?;
Ok((s, Notifier { nodes: (a,) }))
}
#[parser]
pub fn referecne_event(s: Span) -> IResult<Span, ReferenceEvent> {
pub(crate) fn referecne_event(s: Span) -> IResult<Span, ReferenceEvent> {
let (s, a) = timing_check_event(s)?;
Ok((s, ReferenceEvent { nodes: (a,) }))
}
#[parser]
pub fn remain_active_flag(s: Span) -> IResult<Span, RemainActiveFlag> {
pub(crate) fn remain_active_flag(s: Span) -> IResult<Span, RemainActiveFlag> {
let (s, a) = constant_mintypmax_expression(s)?;
Ok((s, RemainActiveFlag { nodes: (a,) }))
}
#[parser]
pub fn timestamp_condition(s: Span) -> IResult<Span, TimestampCondition> {
pub(crate) fn timestamp_condition(s: Span) -> IResult<Span, TimestampCondition> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, TimestampCondition { nodes: (a,) }))
}
#[parser]
pub fn start_edge_offset(s: Span) -> IResult<Span, StartEdgeOffset> {
pub(crate) fn start_edge_offset(s: Span) -> IResult<Span, StartEdgeOffset> {
let (s, a) = mintypmax_expression(s)?;
Ok((s, StartEdgeOffset { nodes: (a,) }))
}
#[parser]
pub fn threshold(s: Span) -> IResult<Span, Threshold> {
pub(crate) fn threshold(s: Span) -> IResult<Span, Threshold> {
let (s, a) = constant_expression(s)?;
Ok((s, Threshold { nodes: (a,) }))
}
#[parser]
pub fn timing_check_limit(s: Span) -> IResult<Span, TimingCheckLimit> {
pub(crate) fn timing_check_limit(s: Span) -> IResult<Span, TimingCheckLimit> {
let (s, a) = expression(s)?;
Ok((s, TimingCheckLimit { nodes: (a,) }))
}

View File

@ -272,7 +272,7 @@ pub struct NochargeTimingCheck {
// -----------------------------------------------------------------------------
#[parser]
pub fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
pub(crate) fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
alt((
map(setup_timing_check, |x| {
SystemTimingCheck::SetupTimingCheck(Box::new(x))
@ -314,7 +314,7 @@ pub fn system_timing_check(s: Span) -> IResult<Span, SystemTimingCheck> {
}
#[parser]
pub fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
pub(crate) fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
let (s, a) = keyword("$setup")(s)?;
let (s, b) = paren(tuple((
data_event,
@ -329,7 +329,7 @@ pub fn setup_timing_check(s: Span) -> IResult<Span, SetupTimingCheck> {
}
#[parser]
pub fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
pub(crate) fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
let (s, a) = keyword("$setup")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -344,7 +344,7 @@ pub fn hold_timing_check(s: Span) -> IResult<Span, HoldTimingCheck> {
}
#[parser]
pub fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
pub(crate) fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
let (s, a) = keyword("$setuphold")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -377,7 +377,7 @@ pub fn setuphold_timing_check(s: Span) -> IResult<Span, SetupholdTimingCheck> {
}
#[parser]
pub fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
pub(crate) fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
let (s, a) = keyword("$recovery")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -392,7 +392,7 @@ pub fn recovery_timing_check(s: Span) -> IResult<Span, RecoveryTimingCheck> {
}
#[parser]
pub fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
pub(crate) fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
let (s, a) = keyword("$removal")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -407,7 +407,7 @@ pub fn removal_timing_check(s: Span) -> IResult<Span, RemovalTimingCheck> {
}
#[parser]
pub fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
pub(crate) fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
let (s, a) = keyword("$recrem")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -440,7 +440,7 @@ pub fn recrem_timing_check(s: Span) -> IResult<Span, RecremTimingCheck> {
}
#[parser]
pub fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
pub(crate) fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
let (s, a) = keyword("$skew")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -455,7 +455,7 @@ pub fn skew_timing_check(s: Span) -> IResult<Span, SkewTimingCheck> {
}
#[parser]
pub fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
pub(crate) fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
let (s, a) = keyword("$timeskew")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -478,7 +478,7 @@ pub fn timeskew_timing_check(s: Span) -> IResult<Span, TimeskewTimingCheck> {
}
#[parser]
pub fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
pub(crate) fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
let (s, a) = keyword("$fullskew")(s)?;
let (s, b) = paren(tuple((
referecne_event,
@ -503,7 +503,7 @@ pub fn fullskew_timing_check(s: Span) -> IResult<Span, FullskewTimingCheck> {
}
#[parser]
pub fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
pub(crate) fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
let (s, a) = keyword("$period")(s)?;
let (s, b) = paren(tuple((
controlled_referecne_event,
@ -516,7 +516,7 @@ pub fn period_timing_check(s: Span) -> IResult<Span, PeriodTimingCheck> {
}
#[parser]
pub fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
pub(crate) fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
let (s, a) = keyword("$width")(s)?;
let (s, b) = paren(tuple((
controlled_referecne_event,
@ -531,7 +531,7 @@ pub fn width_timing_check(s: Span) -> IResult<Span, WidthTimingCheck> {
}
#[parser]
pub fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
pub(crate) fn nocharge_timing_check(s: Span) -> IResult<Span, NochargeTimingCheck> {
let (s, a) = keyword("$nocharge")(s)?;
let (s, b) = paren(tuple((
referecne_event,

View File

@ -85,7 +85,7 @@ pub struct ScalarConstant {
// -----------------------------------------------------------------------------
#[parser]
pub fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
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)?;
let (s, c) = opt(pair(symbol("&&&"), timing_check_condition))(s)?;
@ -93,7 +93,7 @@ pub fn timing_check_event(s: Span) -> IResult<Span, TimingCheckEvent> {
}
#[parser]
pub fn controlled_timing_check_event(s: Span) -> IResult<Span, ControlledTimingCheckEvent> {
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)?;
let (s, c) = opt(pair(symbol("&&&"), timing_check_condition))(s)?;
@ -101,7 +101,7 @@ pub fn controlled_timing_check_event(s: Span) -> IResult<Span, ControlledTimingC
}
#[parser]
pub fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventControl> {
pub(crate) fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventControl> {
alt((
map(keyword("posedge"), |x| {
TimingCheckEventControl::Posedge(Box::new(x))
@ -119,7 +119,7 @@ pub fn timing_check_event_control(s: Span) -> IResult<Span, TimingCheckEventCont
}
#[parser]
pub fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDescriptor> {
pub(crate) fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDescriptor> {
alt((
map(specify_input_terminal_descriptor, |x| {
SpecifyTerminalDescriptor::SpecifyInputTerminalDescriptor(Box::new(x))
@ -131,14 +131,14 @@ pub fn specify_terminal_descriptor(s: Span) -> IResult<Span, SpecifyTerminalDesc
}
#[parser]
pub fn edge_control_specifier(s: Span) -> IResult<Span, EdgeControlSpecifier> {
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]
pub fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
pub(crate) fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
alt((
map(keyword("01"), |x| EdgeDescriptor { nodes: (x,) }),
map(keyword("10"), |x| EdgeDescriptor { nodes: (x,) }),
@ -162,7 +162,7 @@ pub fn edge_descriptor(s: Span) -> IResult<Span, EdgeDescriptor> {
}
#[parser]
pub fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
pub(crate) fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
alt((
map(scalar_timing_check_condition, |x| {
TimingCheckCondition::ScalarTimingCheckCondition(Box::new(x))
@ -172,7 +172,7 @@ pub fn timing_check_condition(s: Span) -> IResult<Span, TimingCheckCondition> {
}
#[parser]
pub fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckCondition> {
pub(crate) fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckCondition> {
let (s, a) = paren(scalar_timing_check_condition)(s)?;
Ok((
s,
@ -181,7 +181,7 @@ pub fn timing_check_condition_paren(s: Span) -> IResult<Span, TimingCheckConditi
}
#[parser]
pub fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
pub(crate) fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
alt((
map(expression, |x| {
ScalarTimingCheckCondition::Expression(Box::new(x))
@ -192,7 +192,7 @@ pub fn scalar_timing_check_condition(s: Span) -> IResult<Span, ScalarTimingCheck
}
#[parser]
pub fn scalar_timing_check_condition_unary(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
pub(crate) fn scalar_timing_check_condition_unary(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
let (s, a) = symbol("~")(s)?;
let (s, b) = expression(s)?;
Ok((
@ -204,7 +204,7 @@ pub fn scalar_timing_check_condition_unary(s: Span) -> IResult<Span, ScalarTimin
}
#[parser]
pub fn scalar_timing_check_condition_binary(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
pub(crate) fn scalar_timing_check_condition_binary(s: Span) -> IResult<Span, ScalarTimingCheckCondition> {
let (s, a) = expression(s)?;
let (s, b) = alt((symbol("==="), symbol("=="), symbol("!=="), symbol("!=")))(s)?;
let (s, c) = scalar_constant(s)?;
@ -217,7 +217,7 @@ pub fn scalar_timing_check_condition_binary(s: Span) -> IResult<Span, ScalarTimi
}
#[parser]
pub fn scalar_constant(s: Span) -> IResult<Span, ScalarConstant> {
pub(crate) fn scalar_constant(s: Span) -> IResult<Span, ScalarConstant> {
alt((
map(keyword("1'b0"), |x| ScalarConstant { nodes: (x,) }),
map(keyword("1'b1"), |x| ScalarConstant { nodes: (x,) }),

View File

@ -118,7 +118,7 @@ pub struct EdgeSymbol {
// -----------------------------------------------------------------------------
#[parser]
pub fn udp_body(s: Span) -> IResult<Span, UdpBody> {
pub(crate) fn udp_body(s: Span) -> IResult<Span, UdpBody> {
alt((
map(combinational_body, |x| {
UdpBody::CombinationalBody(Box::new(x))
@ -128,7 +128,7 @@ pub fn udp_body(s: Span) -> IResult<Span, UdpBody> {
}
#[parser]
pub fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
pub(crate) fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
let (s, a) = keyword("table")(s)?;
let (s, b) = combinational_entry(s)?;
let (s, c) = many0(combinational_entry)(s)?;
@ -142,7 +142,7 @@ pub fn combinational_body(s: Span) -> IResult<Span, CombinationalBody> {
}
#[parser]
pub fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
pub(crate) fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
let (s, a) = level_input_list(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = output_symbol(s)?;
@ -156,7 +156,7 @@ pub fn combinational_entry(s: Span) -> IResult<Span, CombinationalEntry> {
}
#[parser]
pub fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
pub(crate) fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
let (s, a) = opt(udp_initial_statement)(s)?;
let (s, b) = keyword("table")(s)?;
let (s, c) = sequential_entry(s)?;
@ -171,7 +171,7 @@ pub fn sequential_body(s: Span) -> IResult<Span, SequentialBody> {
}
#[parser]
pub fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
pub(crate) fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
let (s, a) = keyword("initial")(s)?;
let (s, b) = output_port_identifier(s)?;
let (s, c) = symbol("=")(s)?;
@ -186,7 +186,7 @@ pub fn udp_initial_statement(s: Span) -> IResult<Span, UdpInitialStatement> {
}
#[parser]
pub fn init_val(s: Span) -> IResult<Span, InitVal> {
pub(crate) fn init_val(s: Span) -> IResult<Span, InitVal> {
alt((
map(keyword("1'b0"), |x| InitVal { nodes: (x,) }),
map(keyword("1'b1"), |x| InitVal { nodes: (x,) }),
@ -202,7 +202,7 @@ pub fn init_val(s: Span) -> IResult<Span, InitVal> {
}
#[parser]
pub fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
pub(crate) fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
let (s, a) = seq_input_list(s)?;
let (s, b) = symbol(":")(s)?;
let (s, c) = current_state(s)?;
@ -218,7 +218,7 @@ pub fn sequential_entry(s: Span) -> IResult<Span, SequentialEntry> {
}
#[parser]
pub fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
pub(crate) fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
alt((
map(level_input_list, |x| {
SeqInputList::LevelInputList(Box::new(x))
@ -230,14 +230,14 @@ pub fn seq_input_list(s: Span) -> IResult<Span, SeqInputList> {
}
#[parser]
pub fn level_input_list(s: Span) -> IResult<Span, LevelInputList> {
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]
pub fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
pub(crate) fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
let (s, a) = many0(level_symbol)(s)?;
let (s, b) = edge_indicator(s)?;
let (s, c) = many0(level_symbol)(s)?;
@ -245,7 +245,7 @@ pub fn edge_input_list(s: Span) -> IResult<Span, EdgeInputList> {
}
#[parser]
pub fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
pub(crate) fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
alt((
edge_indicator_paren,
map(edge_symbol, |x| EdgeIndicator::EdgeSymbol(Box::new(x))),
@ -253,7 +253,7 @@ pub fn edge_indicator(s: Span) -> IResult<Span, EdgeIndicator> {
}
#[parser]
pub fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
pub(crate) fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
let (s, a) = paren(pair(level_symbol, level_symbol))(s)?;
Ok((
s,
@ -262,13 +262,13 @@ pub fn edge_indicator_paren(s: Span) -> IResult<Span, EdgeIndicator> {
}
#[parser]
pub fn current_state(s: Span) -> IResult<Span, CurrentState> {
pub(crate) fn current_state(s: Span) -> IResult<Span, CurrentState> {
let (s, a) = level_symbol(s)?;
Ok((s, CurrentState { nodes: (a,) }))
}
#[parser]
pub fn next_state(s: Span) -> IResult<Span, NextState> {
pub(crate) fn next_state(s: Span) -> IResult<Span, NextState> {
alt((
map(output_symbol, |x| NextState::OutputSymbol(Box::new(x))),
map(symbol("-"), |x| NextState::Minus(Box::new(x))),
@ -276,7 +276,7 @@ pub fn next_state(s: Span) -> IResult<Span, NextState> {
}
#[parser]
pub fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
pub(crate) fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
alt((
map(keyword("0"), |x| OutputSymbol { nodes: (x,) }),
map(keyword("1"), |x| OutputSymbol { nodes: (x,) }),
@ -286,7 +286,7 @@ pub fn output_symbol(s: Span) -> IResult<Span, OutputSymbol> {
}
#[parser]
pub fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
pub(crate) fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
alt((
map(keyword("0"), |x| LevelSymbol { nodes: (x,) }),
map(keyword("1"), |x| LevelSymbol { nodes: (x,) }),
@ -299,7 +299,7 @@ pub fn level_symbol(s: Span) -> IResult<Span, LevelSymbol> {
}
#[parser]
pub fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
pub(crate) fn edge_symbol(s: Span) -> IResult<Span, EdgeSymbol> {
alt((
map(keyword("r"), |x| EdgeSymbol { nodes: (x,) }),
map(keyword("R"), |x| EdgeSymbol { nodes: (x,) }),

View File

@ -89,7 +89,7 @@ pub struct UdpDeclarationWildcard {
// -----------------------------------------------------------------------------
#[parser]
pub fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration> {
pub(crate) fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("primitive")(s)?;
let (s, c) = udp_identifier(s)?;
@ -104,7 +104,7 @@ pub fn udp_nonansi_declaration(s: Span) -> IResult<Span, UdpNonansiDeclaration>
}
#[parser]
pub fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
pub(crate) fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("primitive")(s)?;
let (s, c) = udp_identifier(s)?;
@ -119,7 +119,7 @@ pub fn udp_ansi_declaration(s: Span) -> IResult<Span, UdpAnsiDeclaration> {
}
#[parser]
pub fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
pub(crate) fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
alt((
udp_declaration_nonansi,
udp_declaration_ansi,
@ -130,7 +130,7 @@ pub fn udp_declaration(s: Span) -> IResult<Span, UdpDeclaration> {
}
#[parser]
pub fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
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)?;
let (s, c) = many0(udp_port_declaration)(s)?;
@ -146,7 +146,7 @@ pub fn udp_declaration_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
}
#[parser]
pub fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
pub(crate) fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
let (s, a) = udp_ansi_declaration(s)?;
let (s, b) = udp_body(s)?;
let (s, c) = keyword("endprimitive")(s)?;
@ -160,7 +160,7 @@ pub fn udp_declaration_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
}
#[parser]
pub fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclaration> {
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)?;
Ok((
@ -170,7 +170,7 @@ pub fn udp_declaration_extern_nonansi(s: Span) -> IResult<Span, UdpDeclaration>
}
#[parser]
pub fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
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)?;
Ok((
@ -180,7 +180,7 @@ pub fn udp_declaration_extern_ansi(s: Span) -> IResult<Span, UdpDeclaration> {
}
#[parser]
pub fn udp_declaration_wildcard(s: Span) -> IResult<Span, UdpDeclaration> {
pub(crate) fn udp_declaration_wildcard(s: Span) -> IResult<Span, UdpDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("primitive")(s)?;
let (s, c) = udp_identifier(s)?;

View File

@ -34,7 +34,7 @@ pub struct UdpInstance {
// -----------------------------------------------------------------------------
#[parser]
pub fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
pub(crate) fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
let (s, a) = udp_identifier(s)?;
let (s, b) = opt(drive_strength)(s)?;
let (s, c) = opt(delay2)(s)?;
@ -49,7 +49,7 @@ pub fn udp_instantiation(s: Span) -> IResult<Span, UdpInstantiation> {
}
#[parser]
pub fn udp_instance(s: Span) -> IResult<Span, UdpInstance> {
pub(crate) fn udp_instance(s: Span) -> IResult<Span, UdpInstance> {
let (s, a) = opt(name_of_instance)(s)?;
let (s, b) = paren(tuple((
output_terminal,

View File

@ -68,7 +68,7 @@ pub struct UdpRegDeclaration {
// -----------------------------------------------------------------------------
#[parser]
pub fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
pub(crate) fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
let (s, a) = output_port_identifier(s)?;
let (s, b) = symbol(",")(s)?;
let (s, c) = list(symbol(","), input_port_identifier)(s)?;
@ -76,7 +76,7 @@ pub fn udp_port_list(s: Span) -> IResult<Span, UdpPortList> {
}
#[parser]
pub fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortList> {
pub(crate) fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortList> {
let (s, a) = udp_output_declaration(s)?;
let (s, b) = symbol(",")(s)?;
let (s, c) = list(symbol(","), udp_input_declaration)(s)?;
@ -84,7 +84,7 @@ pub fn udp_declaration_port_list(s: Span) -> IResult<Span, UdpDeclarationPortLis
}
#[parser]
pub fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
pub(crate) fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
alt((
map(pair(udp_output_declaration, symbol(";")), |x| {
UdpPortDeclaration::UdpOutputDeclaration(Box::new(x))
@ -99,12 +99,12 @@ pub fn udp_port_declaration(s: Span) -> IResult<Span, UdpPortDeclaration> {
}
#[parser]
pub fn udp_output_declaration(s: Span) -> IResult<Span, UdpOutputDeclaration> {
pub(crate) fn udp_output_declaration(s: Span) -> IResult<Span, UdpOutputDeclaration> {
alt((udp_output_declaration_nonreg, udp_output_declaration_reg))(s)
}
#[parser]
pub fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
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)?;
let (s, c) = port_identifier(s)?;
@ -115,7 +115,7 @@ pub fn udp_output_declaration_nonreg(s: Span) -> IResult<Span, UdpOutputDeclarat
}
#[parser]
pub fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDeclaration> {
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)?;
let (s, c) = keyword("reg")(s)?;
@ -130,7 +130,7 @@ pub fn udp_output_declaration_reg(s: Span) -> IResult<Span, UdpOutputDeclaration
}
#[parser]
pub fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
pub(crate) fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("input")(s)?;
let (s, c) = list_of_udp_port_identifiers(s)?;
@ -138,7 +138,7 @@ pub fn udp_input_declaration(s: Span) -> IResult<Span, UdpInputDeclaration> {
}
#[parser]
pub fn udp_reg_declaration(s: Span) -> IResult<Span, UdpRegDeclaration> {
pub(crate) fn udp_reg_declaration(s: Span) -> IResult<Span, UdpRegDeclaration> {
let (s, a) = many0(attribute_instance)(s)?;
let (s, b) = keyword("reg")(s)?;
let (s, c) = variable_identifier(s)?;

View File

@ -304,7 +304,7 @@ pub struct List<T, U> {
// -----------------------------------------------------------------------------
pub fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, (O, Vec<WhiteSpace>)>
pub(crate) fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, (O, Vec<WhiteSpace>)>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, O>,
{
@ -315,7 +315,7 @@ where
}
}
pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Symbol> {
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));
@ -326,7 +326,7 @@ pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Symbol>
}
}
pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Keyword> {
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));
@ -341,7 +341,7 @@ pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Keyword
}
}
pub fn paren<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Paren<O>>
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>,
{
@ -355,7 +355,7 @@ where
}
}
pub fn bracket<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Bracket<O>>
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>,
{
@ -369,7 +369,7 @@ where
}
}
pub fn brace<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Brace<O>>
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>,
{
@ -383,7 +383,7 @@ where
}
}
pub fn apostrophe_brace<'a, O, F>(
pub(crate) fn apostrophe_brace<'a, O, F>(
f: F,
) -> impl Fn(Span<'a>) -> IResult<Span<'a>, ApostropheBrace<O>>
where
@ -399,7 +399,10 @@ where
}
}
pub fn list<'a, O1, O2, F, G>(f: F, g: G) -> impl Fn(Span<'a>) -> IResult<Span<'a>, List<O1, O2>>
pub(crate) fn list<'a, O1, O2, F, G>(
f: F,
g: G,
) -> impl Fn(Span<'a>) -> IResult<Span<'a>, List<O1, O2>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, O1>,
G: Fn(Span<'a>) -> IResult<Span<'a>, O2>,
@ -421,7 +424,7 @@ where
}
}
pub fn triple<'a, O1, O2, O3, F, G, H>(
pub(crate) fn triple<'a, O1, O2, O3, F, G, H>(
f: F,
g: G,
h: H,
@ -439,14 +442,14 @@ where
}
}
pub fn none<'a, O, F>(_f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Option<O>>
pub(crate) fn none<'a, O, F>(_f: F) -> impl Fn(Span<'a>) -> IResult<Span<'a>, Option<O>>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, O>,
{
move |s: Span<'a>| Ok((s, None))
}
pub fn alt_left<'a, O, F, G>(f: F, _g: G) -> impl Fn(Span<'a>) -> IResult<Span<'a>, O>
pub(crate) fn alt_left<'a, O, F, G>(f: F, _g: G) -> impl Fn(Span<'a>) -> IResult<Span<'a>, O>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, O>,
G: Fn(Span<'a>) -> IResult<Span<'a>, O>,
@ -457,7 +460,7 @@ where
}
}
pub fn alt_right<'a, O, F, G>(_f: F, g: G) -> impl Fn(Span<'a>) -> IResult<Span<'a>, O>
pub(crate) fn alt_right<'a, O, F, G>(_f: F, g: G) -> impl Fn(Span<'a>) -> IResult<Span<'a>, O>
where
F: Fn(Span<'a>) -> IResult<Span<'a>, O>,
G: Fn(Span<'a>) -> IResult<Span<'a>, O>,
@ -471,7 +474,7 @@ where
// -----------------------------------------------------------------------------
#[parser]
pub fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
pub(crate) fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
alt((
map(multispace1, |x: Span| WhiteSpace::Space(Box::new(x.into()))),
map(comment, |x| WhiteSpace::Comment(Box::new(x))),
@ -480,7 +483,7 @@ pub fn white_space(s: Span) -> IResult<Span, WhiteSpace> {
// -----------------------------------------------------------------------------
pub fn concat<'a>(a: Span<'a>, b: Span<'a>) -> Option<Span<'a>> {
pub(crate) fn concat<'a>(a: Span<'a>, b: Span<'a>) -> Option<Span<'a>> {
let c = str_concat::concat(a.fragment, b.fragment);
if let Ok(c) = c {
Some(Span {
@ -494,14 +497,14 @@ pub fn concat<'a>(a: Span<'a>, b: Span<'a>) -> Option<Span<'a>> {
}
}
pub fn check_recursive_flag(s: Span, id: usize) -> bool {
pub(crate) fn check_recursive_flag(s: Span, id: usize) -> bool {
let upper = id / 128;
let lower = id % 128;
((s.extra.recursive_flag[upper] >> lower) & 1) == 1
}
pub fn set_recursive_flag(mut s: Span, id: usize, bit: bool) -> Span {
pub(crate) fn set_recursive_flag(mut s: Span, id: usize, bit: bool) -> Span {
let upper = id / 128;
let lower = id % 128;
@ -514,12 +517,12 @@ pub fn set_recursive_flag(mut s: Span, id: usize, bit: bool) -> Span {
s
}
pub fn clear_recursive_flags(mut s: Span) -> Span {
pub(crate) fn clear_recursive_flags(mut s: Span) -> Span {
s.extra.recursive_flag = [0; RECURSIVE_FLAG_WORDS];
s
}
pub fn is_keyword(s: &Span) -> bool {
pub(crate) fn is_keyword(s: &Span) -> bool {
for k in KEYWORDS {
if &s.fragment == k {
return true;
@ -529,7 +532,7 @@ pub fn is_keyword(s: &Span) -> bool {
}
#[cfg(feature = "trace")]
pub fn trace<'a>(mut s: Span<'a>, name: &str) -> Span<'a> {
pub(crate) fn trace<'a>(mut s: Span<'a>, name: &str) -> Span<'a> {
println!(
"{:<128} : {:<4},{:>032x} : {}",
format!("{}{}", " ".repeat(s.extra.depth), name),