merge follow-up: §34's port walkers read ANSI port lists through ListElem::ok (§32's error elements)
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
17697b9d77
commit
0cb398bcd9
2 files changed
+5
-3
No files matched your search
@@ -177,7 +177,7 @@ pub(crate) fn walk_declared_types(file: &SourceFile, f: &mut dyn FnMut(&Declared
|
||||
walk_items(file, &mut |item| match &item.kind {
|
||||
ItemKind::Module(module) => {
|
||||
if let vlog_parser::ast::PortList::Ansi(ports) = &module.ports {
|
||||
for port in ports {
|
||||
for port in ports.iter().filter_map(ListElem::ok) {
|
||||
declared(&port.ty, &port.name, port.name_span, false, f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
//! `decls` (types and dimensions), so each of the three files stays one
|
||||
//! sentence long.
|
||||
|
||||
use vlog_parser::ast::{AnsiPort, GenBlock, GenElse, Item, ItemKind, PortList, SourceFile};
|
||||
use vlog_parser::ast::{
|
||||
AnsiPort, GenBlock, GenElse, Item, ItemKind, ListElem, PortList, SourceFile,
|
||||
};
|
||||
use vlog_parser::span::TextRange;
|
||||
|
||||
/// One net, variable or port a module declares.
|
||||
@@ -127,7 +129,7 @@ fn header_ports(ports: &PortList, out: &mut Vec<SignalDecl>) {
|
||||
// A port with no direction keyword continues the previous one, as
|
||||
// the language says; a first port with none is `inout` by default.
|
||||
let mut carried: Option<String> = None;
|
||||
for port in ports {
|
||||
for port in ports.iter().filter_map(ListElem::ok) {
|
||||
carried = direction(port).or(carried);
|
||||
out.push(SignalDecl {
|
||||
name: port.name.clone(),
|
||||
|
||||
Reference in new issue
Block a user