Fix cast/const_cast priority
This commit is contained in:
parent
c776696a8f
commit
030068f36f
@ -2,4 +2,5 @@
|
||||
|
||||
## [Unreleased](https://github.com/dalance/sv-parser/compare/v0.1.4...Unreleased) - ReleaseDate
|
||||
|
||||
* [Fixed] cast/const_cast priority
|
||||
* [Added] unwrap_node macro
|
||||
|
@ -710,12 +710,12 @@ pub(crate) fn data_type_or_implicit_sequence_formal_type(
|
||||
#[packrat_parser]
|
||||
pub(crate) fn sequence_expr(s: Span) -> IResult<Span, SequenceExpr> {
|
||||
alt((
|
||||
sequence_expr_cycle_delay_expr,
|
||||
sequence_expr_binary,
|
||||
sequence_expr_expr_cycle_delay_expr,
|
||||
sequence_expr_cycle_delay_expr,
|
||||
sequence_expr_throughout,
|
||||
terminated(sequence_expr_expression, peek(not(symbol("(")))),
|
||||
sequence_expr_instance,
|
||||
sequence_expr_binary,
|
||||
sequence_expr_paren,
|
||||
sequence_expr_first_match,
|
||||
sequence_expr_clocking_event,
|
||||
|
@ -10,12 +10,12 @@ pub(crate) fn constant_primary(s: Span) -> IResult<Span, ConstantPrimary> {
|
||||
map(constant_assignment_pattern_expression, |x| {
|
||||
ConstantPrimary::ConstantAssignmentPatternExpression(Box::new(x))
|
||||
}),
|
||||
map(primary_literal, |x| {
|
||||
ConstantPrimary::PrimaryLiteral(Box::new(x))
|
||||
}),
|
||||
map(constant_cast, |x| {
|
||||
ConstantPrimary::ConstantCast(Box::new(x))
|
||||
}),
|
||||
map(primary_literal, |x| {
|
||||
ConstantPrimary::PrimaryLiteral(Box::new(x))
|
||||
}),
|
||||
map(
|
||||
terminated(constant_function_call, peek(not(one_of("[")))),
|
||||
|x| ConstantPrimary::ConstantFunctionCall(Box::new(x)),
|
||||
@ -164,8 +164,8 @@ pub(crate) fn primary(s: Span) -> IResult<Span, Primary> {
|
||||
map(assignment_pattern_expression, |x| {
|
||||
Primary::AssignmentPatternExpression(Box::new(x))
|
||||
}),
|
||||
map(primary_literal, |x| Primary::PrimaryLiteral(Box::new(x))),
|
||||
map(cast, |x| Primary::Cast(Box::new(x))),
|
||||
map(primary_literal, |x| Primary::PrimaryLiteral(Box::new(x))),
|
||||
map(empty_unpacked_array_concatenation, |x| {
|
||||
Primary::EmptyUnpackedArrayConcatenation(Box::new(x))
|
||||
}),
|
||||
|
@ -332,6 +332,13 @@ mod unit {
|
||||
);
|
||||
test!(source_text, r##"`macro(A, B, logic, C)"##, Ok((_, _)));
|
||||
test!(source_text, r##"`macro(A, B, logic, a())"##, Ok((_, _)));
|
||||
test!(
|
||||
source_text,
|
||||
r##"module ibex_cs_registers;
|
||||
localparam logic [31:0] MISA_VALUE = 32'(RV32E);
|
||||
endmodule"##,
|
||||
Ok((_, _))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15805,8 +15812,8 @@ mod spec {
|
||||
#[test]
|
||||
fn debug() {
|
||||
test!(
|
||||
source_text,
|
||||
r##"interface intf (); localparam TYPE DEFAULT = TYPE'(0); endinterface"##,
|
||||
many1(module_item),
|
||||
r##"sequence t2; (a ##[2:3] b) or (c ##[1:2] d); endsequence"##,
|
||||
Ok((_, _))
|
||||
);
|
||||
nom_tracable::cumulative_histogram();
|
||||
|
@ -6,4 +6,3 @@ use crate::*;
|
||||
pub struct PreprocessorText {
|
||||
pub nodes: (Vec<SourceDescription>,),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user