fix assign item parsing
This commit is contained in:
parent
839287ec51
commit
edab641506
|
@ -164,11 +164,6 @@ mod test {
|
|||
use super::*;
|
||||
use nom::combinator::all_consuming;
|
||||
|
||||
#[test]
|
||||
fn test_decl() {
|
||||
declaration("reg abcd".into()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_operation() {
|
||||
operation(" a | b ".into()).unwrap();
|
||||
|
|
|
@ -73,7 +73,7 @@ fn assign_item(input: Span) -> IResult<Span, Assign> {
|
|||
|
||||
fn module_item(input: Span) -> IResult<Span, ModuleItem> {
|
||||
alt((
|
||||
map(assign_statement, ModuleItem::Assign),
|
||||
map(assign_item, ModuleItem::Assign),
|
||||
map(proc_block, ModuleItem::Proc),
|
||||
))(input)
|
||||
}
|
||||
|
@ -97,3 +97,27 @@ pub fn module(input: Span) -> IResult<Span, Module> {
|
|||
),
|
||||
)(input)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use nom::combinator::all_consuming;
|
||||
|
||||
#[test]
|
||||
fn test_decl() {
|
||||
declaration("reg abcd".into()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_assignment_item() {
|
||||
all_consuming(assign_item)(" assign a = b ; ".into()).unwrap();
|
||||
all_consuming(assign_item)(" assign a = b | c ; ".into()).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_module_item() {
|
||||
all_consuming(module_item)(" assign a = b ;".into()).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue