From 5e07f77c10c88b66d43686159d1fc35372ac4c39 Mon Sep 17 00:00:00 2001 From: dalance Date: Thu, 22 Aug 2024 16:50:23 +0900 Subject: [PATCH] Refine document generation --- crates/veryl/src/cmd_doc.rs | 58 +++++++++-- crates/veryl/src/doc/doc_builder.rs | 96 ++++++++++++------- .../map/testcases/sv/55_generic_module.sv.map | 2 +- .../testcases/sv/56_generic_interface.sv.map | 2 +- .../testcases/sv/57_generic_package.sv.map | 2 +- testcases/sv/55_generic_module.sv | 1 + testcases/sv/56_generic_interface.sv | 4 + testcases/sv/57_generic_package.sv | 4 + testcases/veryl/55_generic_module.veryl | 3 +- testcases/veryl/56_generic_interface.veryl | 6 +- testcases/veryl/57_generic_package.veryl | 6 +- 11 files changed, 131 insertions(+), 53 deletions(-) diff --git a/crates/veryl/src/cmd_doc.rs b/crates/veryl/src/cmd_doc.rs index 31eb66b1..ec8d820d 100644 --- a/crates/veryl/src/cmd_doc.rs +++ b/crates/veryl/src/cmd_doc.rs @@ -1,11 +1,11 @@ -use crate::doc::DocBuilder; +use crate::doc::{DocBuilder, TopLevelItem}; use crate::OptDoc; use log::info; use miette::{IntoDiagnostic, Result, WrapErr}; use std::collections::BTreeMap; use std::fs; -use veryl_analyzer::symbol::SymbolKind; -use veryl_analyzer::Analyzer; +use veryl_analyzer::symbol::{SymbolId, SymbolKind}; +use veryl_analyzer::{symbol_table, Analyzer}; use veryl_metadata::Metadata; use veryl_parser::resource_table; use veryl_parser::Parser; @@ -51,25 +51,63 @@ impl CmdDoc { for symbol in veryl_analyzer::symbol_table::get_all() { let text = resource_table::get_str_value(symbol.token.text).unwrap(); + let file_name = text.clone(); + let symbol = symbol.clone(); if format!("{}", symbol.namespace) == metadata.project.name && symbol.public { - match symbol.kind { - SymbolKind::Module(_) => { - modules.insert(text, symbol.clone()); + match &symbol.kind { + SymbolKind::Module(x) => { + let html_name = fmt_generic_parameters(&text, &x.generic_parameters); + let item = TopLevelItem { + file_name, + html_name, + symbol, + }; + modules.insert(text, item); } - SymbolKind::Interface(_) => { - interfaces.insert(text, symbol.clone()); + SymbolKind::Interface(x) => { + let html_name = fmt_generic_parameters(&text, &x.generic_parameters); + let item = TopLevelItem { + file_name, + html_name, + symbol, + }; + interfaces.insert(text, item); } - SymbolKind::Package(_) => { - packages.insert(text, symbol.clone()); + SymbolKind::Package(x) => { + let html_name = fmt_generic_parameters(&text, &x.generic_parameters); + let item = TopLevelItem { + file_name, + html_name, + symbol, + }; + packages.insert(text, item); } _ => (), } } } + let modules: Vec<_> = modules.into_values().collect(); + let interfaces: Vec<_> = interfaces.into_values().collect(); + let packages: Vec<_> = packages.into_values().collect(); + let builder = DocBuilder::new(metadata, modules, interfaces, packages)?; builder.build()?; Ok(true) } } + +fn fmt_generic_parameters(name: &str, params: &[SymbolId]) -> String { + if params.is_empty() { + name.to_string() + } else { + let mut name = name.to_string(); + name.push_str("::<"); + for param in params { + let symbol = symbol_table::get(*param).unwrap(); + name.push_str(&format!("{}, ", symbol.token.text)); + } + format!("{}>", name.strip_suffix(", ").unwrap()) + } +} diff --git a/crates/veryl/src/doc/doc_builder.rs b/crates/veryl/src/doc/doc_builder.rs index 7246b969..0e7b0dec 100644 --- a/crates/veryl/src/doc/doc_builder.rs +++ b/crates/veryl/src/doc/doc_builder.rs @@ -3,7 +3,7 @@ use handlebars::Handlebars; use mdbook::{Config, MDBook}; use miette::{IntoDiagnostic, Result}; use serde::Serialize; -use std::collections::{BTreeMap, HashSet}; +use std::collections::HashSet; use std::fs::{self, File}; use std::io::Write; use std::path::PathBuf; @@ -24,17 +24,17 @@ const SUMMARY_TMPL: &str = r###" - [Modules](modules.md) {{#each modules}} - - [{{this}}]({{this}}.md) + - [{{this.0}}]({{this.1}}.md) {{/each}} - [Interfaces](interfaces.md) {{#each interfaces}} - - [{{this}}]({{this}}.md) + - [{{this.0}}]({{this.1}}.md) {{/each}} - [Packages](packages.md) {{#each packages}} - - [{{this}}]({{this}}.md) + - [{{this.0}}]({{this.1}}.md) {{/each}} "###; @@ -42,9 +42,9 @@ const SUMMARY_TMPL: &str = r###" struct SummaryData { name: String, version: String, - modules: Vec, - interfaces: Vec, - packages: Vec, + modules: Vec<(String, String)>, + interfaces: Vec<(String, String)>, + packages: Vec<(String, String)>, } const INDEX_TMPL: &str = r###" @@ -164,7 +164,11 @@ const MODULE_TMPL: &str = r#" {{#each ports}} {{this.name}} - {{this.direction}} {{this.clock_domain}} {{this.typ}} + {{this.direction}} + {{#if ../clock_domains}} + {{this.clock_domain}} + {{/if}} + {{this.typ}} {{this.description}} {{/each}} @@ -248,17 +252,24 @@ pub struct DocBuilder { root_dir: PathBuf, src_dir: PathBuf, theme_dir: PathBuf, - modules: BTreeMap, - interfaces: BTreeMap, - packages: BTreeMap, + modules: Vec, + interfaces: Vec, + packages: Vec, +} + +#[derive(Clone)] +pub struct TopLevelItem { + pub file_name: String, + pub html_name: String, + pub symbol: Symbol, } impl DocBuilder { pub fn new( metadata: &Metadata, - modules: BTreeMap, - interfaces: BTreeMap, - packages: BTreeMap, + modules: Vec, + interfaces: Vec, + packages: Vec, ) -> Result { let temp_dir = tempfile::tempdir().into_diagnostic()?; let root_dir = temp_dir.path().to_path_buf(); @@ -288,19 +299,19 @@ impl DocBuilder { self.build_component("interfaces.md", self.build_interfaces())?; self.build_component("packages.md", self.build_packages())?; - for (k, v) in &self.modules { - let file = format!("{}.md", k); - self.build_component(&file, self.build_module(k, v))?; + for x in &self.modules { + let file = format!("{}.md", x.file_name); + self.build_component(&file, self.build_module(&x.html_name, &x.symbol))?; } - for (k, v) in &self.interfaces { - let file = format!("{}.md", k); - self.build_component(&file, self.build_interface(k, v))?; + for x in &self.interfaces { + let file = format!("{}.md", x.file_name); + self.build_component(&file, self.build_interface(&x.html_name, &x.symbol))?; } - for (k, v) in &self.packages { - let file = format!("{}.md", k); - self.build_component(&file, self.build_package(k, v))?; + for x in &self.packages { + let file = format!("{}.md", x.file_name); + self.build_component(&file, self.build_package(&x.html_name, &x.symbol))?; } let mut cfg = Config::default(); @@ -388,9 +399,24 @@ impl DocBuilder { } fn build_summary(&self) -> String { - let modules: Vec<_> = self.modules.keys().cloned().collect(); - let interfaces: Vec<_> = self.interfaces.keys().cloned().collect(); - let packages: Vec<_> = self.packages.keys().cloned().collect(); + let modules: Vec<_> = self + .modules + .iter() + .cloned() + .map(|x| (x.html_name, x.file_name)) + .collect(); + let interfaces: Vec<_> = self + .interfaces + .iter() + .cloned() + .map(|x| (x.html_name, x.file_name)) + .collect(); + let packages: Vec<_> = self + .packages + .iter() + .cloned() + .map(|x| (x.html_name, x.file_name)) + .collect(); let data = SummaryData { name: self.metadata.project.name.clone(), version: format!("{}", self.metadata.project.version), @@ -422,9 +448,9 @@ impl DocBuilder { let items: Vec<_> = self .modules .iter() - .map(|(k, v)| ListItem { - name: k.clone(), - description: v.doc_comment.format(true), + .map(|x| ListItem { + name: x.html_name.clone(), + description: x.symbol.doc_comment.format(true), }) .collect(); @@ -442,9 +468,9 @@ impl DocBuilder { let items: Vec<_> = self .interfaces .iter() - .map(|(k, v)| ListItem { - name: k.clone(), - description: v.doc_comment.format(true), + .map(|x| ListItem { + name: x.html_name.clone(), + description: x.symbol.doc_comment.format(true), }) .collect(); @@ -462,9 +488,9 @@ impl DocBuilder { let items: Vec<_> = self .packages .iter() - .map(|(k, v)| ListItem { - name: k.clone(), - description: v.doc_comment.format(true), + .map(|x| ListItem { + name: x.html_name.clone(), + description: x.symbol.doc_comment.format(true), }) .collect(); diff --git a/testcases/map/testcases/sv/55_generic_module.sv.map b/testcases/map/testcases/sv/55_generic_module.sv.map index 2becdf34..1b6805c6 100644 --- a/testcases/map/testcases/sv/55_generic_module.sv.map +++ b/testcases/map/testcases/sv/55_generic_module.sv.map @@ -1 +1 @@ -{"version":3,"file":"55_generic_module.sv.map","sources":["../../../veryl/55_generic_module.veryl"],"names":["","module","Module55",";","veryl_testcase___Module55A__Module55B","u0","veryl_testcase___Module55A__Module55C","u1","veryl_testcase___Module55E__Module55C","u2","veryl_testcase___Module55E__Module55D","u3","veryl_testcase___Module55F__Module55C","u4","veryl_testcase___Module55F__Module55B","u5","endmodule","veryl_testcase_Module55B","u","veryl_testcase_Module55C","veryl_testcase_Module55D","Module55B","Module55C","Module55D","veryl_testcase___Module55A__Module55D"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZH,AAASI,sCAAJC,KAA0BF;IAC/BH,AAASM,sCAAJC,KAA0BJ;IAC/BH,AAASQ,sCAAJC,KAA0BN;IAC/BH,AAASU,sCAAJC,KAA0BR;IAC/BH,AAASY,sCAAJC,KAA0BV;IAC/BH,AAASc,sCAAJC,KAAiBZ;AAC1Ba;;AAEAf,4CAAsBE;IAClBH,AAAQiB,yBAAHC,IAAIf;AACba;AAFAf,4CAAsBE;IAClBH,AAAQmB,yBAAHD,IAAIf;AACba;AAFAf,4CAAsBE;IAClBH,AAAQoB,yBAAHF,IAAIf;AACba;;AAEAf,sBAAOoB,SAAUlB;AAACa;;AAElBf,sBAAOqB,SAAUnB;AAACa;;AAElBf,sBAAOsB,SAAUpB;AAACa;;AAElBf,4CAAsBE;IAClBH,AAAQM,sCAAHY,IAAiBf;AAC1Ba;AAFAf,4CAAsBE;IAClBH,AAAQwB,sCAAHN,IAAiBf;AAC1Ba;;AAEAf,4CAAkCE;IAC9BH,AAAQmB,yBAAHD,IAAIf;AACba;AAFAf,4CAAkCE;IAC9BH,AAAQiB,yBAAHC,IAAIf;AACba"} \ No newline at end of file +{"version":3,"file":"55_generic_module.sv.map","sources":["../../../veryl/55_generic_module.veryl"],"names":["","module","Module55",";","veryl_testcase___Module55A__Module55B","u0","veryl_testcase___Module55A__Module55C","u1","veryl_testcase___Module55E__Module55C","u2","veryl_testcase___Module55E__Module55D","u3","veryl_testcase___Module55F__Module55C","u4","veryl_testcase___Module55F__Module55B","u5","endmodule","veryl_testcase_Module55B","u","veryl_testcase_Module55C","veryl_testcase_Module55D","Module55B","Module55C","Module55D","veryl_testcase___Module55A__Module55D"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZH,AAASI,sCAAJC,KAA0BF;IAC/BH,AAASM,sCAAJC,KAA0BJ;IAC/BH,AAASQ,sCAAJC,KAA0BN;IAC/BH,AAASU,sCAAJC,KAA0BR;IAC/BH,AAASY,sCAAJC,KAA0BV;IAC/BH,AAASc,sCAAJC,KAAiBZ;AAC1Ba;;;AAGIf,4CAAsBE;IACtBH,AAAQiB,yBAAHC,IAAIf;AACba;AAFIf,4CAAsBE;IACtBH,AAAQmB,yBAAHD,IAAIf;AACba;AAFIf,4CAAsBE;IACtBH,AAAQoB,yBAAHF,IAAIf;AACba;;AAEAf,sBAAOoB,SAAUlB;AAACa;;AAElBf,sBAAOqB,SAAUnB;AAACa;;AAElBf,sBAAOsB,SAAUpB;AAACa;;AAElBf,4CAAsBE;IAClBH,AAAQM,sCAAHY,IAAiBf;AAC1Ba;AAFAf,4CAAsBE;IAClBH,AAAQwB,sCAAHN,IAAiBf;AAC1Ba;;AAEAf,4CAAkCE;IAC9BH,AAAQmB,yBAAHD,IAAIf;AACba;AAFAf,4CAAkCE;IAC9BH,AAAQiB,yBAAHC,IAAIf;AACba"} \ No newline at end of file diff --git a/testcases/map/testcases/sv/56_generic_interface.sv.map b/testcases/map/testcases/sv/56_generic_interface.sv.map index e135d42b..81d6a81d 100644 --- a/testcases/map/testcases/sv/56_generic_interface.sv.map +++ b/testcases/map/testcases/sv/56_generic_interface.sv.map @@ -1 +1 @@ -{"version":3,"file":"56_generic_interface.sv.map","sources":["../../../veryl/56_generic_interface.veryl"],"names":["","module","Module56",";","veryl_testcase___Interface56A__Package56A","u0","veryl_testcase___Interface56A__Package56B","u1","veryl_testcase___Interface56B__Package56A","u2","veryl_testcase___Interface56B__Package56B","u3","endmodule","interface","logic","[","veryl_testcase_Package56A::X","]","_a","endinterface","veryl_testcase_Package56B::X","_b","package","Package56A","localparam","int unsigned","X","=","1","endpackage","Package56B","2"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZH,AAASI,0CAAJC,KAA8BF;IACnCH,AAASM,0CAAJC,KAA8BJ;IACnCH,AAASQ,0CAAJC,KAA8BN;IACnCH,AAASU,0CAAJC,KAAoBR;AAC7BS;;AAEAC,mDAA4BV;IAChBW,MAAKC,CAACC,gCAAIC,EAAdC,EAAef;AACvBgB;AAFAN,mDAA4BV;IAChBW,MAAKC,CAACK,gCAAIH,EAAdC,EAAef;AACvBgB;;AAEAN,mDAAyCV;IAC7BW,MAAKC,CAACC,gCAAIC,EAAdI,EAAelB;AACvBgB;AAFAN,mDAAyCV;IAC7BW,MAAKC,CAACK,gCAAIH,EAAdI,EAAelB;AACvBgB;;AAEAG,uBAAQC,UAAWpB;IACfqB,WAASC,aAAHC,EAAOC,EAAEC,CAACzB;AACpB0B;;AAEAP,uBAAQQ,UAAW3B;IACfqB,WAASC,aAAHC,EAAOC,EAAEI,CAAC5B;AACpB0B"} \ No newline at end of file +{"version":3,"file":"56_generic_interface.sv.map","sources":["../../../veryl/56_generic_interface.veryl"],"names":["","module","Module56",";","veryl_testcase___Interface56A__Package56A","u0","veryl_testcase___Interface56A__Package56B","u1","veryl_testcase___Interface56B__Package56A","u2","veryl_testcase___Interface56B__Package56B","u3","endmodule","interface","logic","[","veryl_testcase_Package56A::X","]","_a","endinterface","veryl_testcase_Package56B::X","_b","package","Package56A","localparam","int unsigned","X","=","1","endpackage","Package56B","2"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZH,AAASI,0CAAJC,KAA8BF;IACnCH,AAASM,0CAAJC,KAA8BJ;IACnCH,AAASQ,0CAAJC,KAA8BN;IACnCH,AAASU,0CAAJC,KAAoBR;AAC7BS;;;AAGIC,mDAA4BV;IACpBW,MAAKC,CAACC,gCAAIC,EAAdC,EAAef;AACvBgB;;;AAFIN,mDAA4BV;IACpBW,MAAKC,CAACK,gCAAIH,EAAdC,EAAef;AACvBgB;;;AAGIN,mDAAyCV;IACjCW,MAAKC,CAACC,gCAAIC,EAAdI,EAAelB;AACvBgB;AAFIN,mDAAyCV;IACjCW,MAAKC,CAACK,gCAAIH,EAAdI,EAAelB;AACvBgB;;AAEAG,uBAAQC,UAAWpB;IACfqB,WAASC,aAAHC,EAAOC,EAAEC,CAACzB;AACpB0B;;AAEAP,uBAAQQ,UAAW3B;IACfqB,WAASC,aAAHC,EAAOC,EAAEI,CAAC5B;AACpB0B"} \ No newline at end of file diff --git a/testcases/map/testcases/sv/57_generic_package.sv.map b/testcases/map/testcases/sv/57_generic_package.sv.map index 96bf5365..716fa8b9 100644 --- a/testcases/map/testcases/sv/57_generic_package.sv.map +++ b/testcases/map/testcases/sv/57_generic_package.sv.map @@ -1 +1 @@ -{"version":3,"file":"57_generic_package.sv.map","sources":["../../../veryl/57_generic_package.veryl"],"names":["","module","Module57",";","localparam","int unsigned","A","=","veryl_testcase___Package57A__1::X","longint unsigned","B","veryl_testcase___Package57A__2::X","C","veryl_testcase___Package57B__3::X","D","veryl_testcase___Package57B__4::X","veryl_testcase___Package57C__2::StructC","_e","always_comb",".","c","1","endmodule","package","X","endpackage","2","3","4","typedef struct packed","{","logic","[","]","StructC"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZC,WAASC,iBAAHC,EAAOC,EAAEC,iCAAkBL;IACjCC,WAASK,iBAAHC,EAAOH,EAAEI,iCAAkBR;IACjCC,WAASC,iBAAHO,EAAOL,EAAEM,iCAAkBV;IACjCC,WAASK,iBAAHK,EAAOP,EAAEQ,iCAAiBZ;;IAEtBa,wCAANC,IAA8Bd;IAClCe,YAAOD,EAAEE,CAACC,EAAEb,EAAEc,CAAClB;AACnBmB;;AAEAC,sCAAwBpB;IACpBC,WAASC,aAAHmB,EAAOjB,EAAEc,CAAClB;AACpBsB;AAFAF,sCAAwBpB;IACpBC,WAASC,aAAHmB,EAAOjB,EAAEmB,CAACvB;AACpBsB;;AAEAF,sCAA4BpB;IACxBC,WAASC,aAAHmB,EAAOjB,EAAEoB,CAACxB;AACpBsB;AAFAF,sCAA4BpB;IACxBC,WAASC,aAAHmB,EAAOjB,EAAEqB,CAACzB;AACpBsB;;AAEAF,sCAAwBpB;IACpB0B,sBAAeC;QACRC,MAAKC,CAACN,KAACO,EAAVb,CAAWjB;MADR+B,QAEPlC;AACJyB"} \ No newline at end of file +{"version":3,"file":"57_generic_package.sv.map","sources":["../../../veryl/57_generic_package.veryl"],"names":["","module","Module57",";","localparam","int unsigned","A","=","veryl_testcase___Package57A__1::X","longint unsigned","B","veryl_testcase___Package57A__2::X","C","veryl_testcase___Package57B__3::X","D","veryl_testcase___Package57B__4::X","veryl_testcase___Package57C__2::StructC","_e","always_comb",".","c","1","endmodule","package","X","endpackage","2","3","4","typedef struct packed","{","logic","[","]","StructC"],"mappings":"AAAAA,AAAAC,sBAAOC,QAASC;IACZC,WAASC,iBAAHC,EAAOC,EAAEC,iCAAkBL;IACjCC,WAASK,iBAAHC,EAAOH,EAAEI,iCAAkBR;IACjCC,WAASC,iBAAHO,EAAOL,EAAEM,iCAAkBV;IACjCC,WAASK,iBAAHK,EAAOP,EAAEQ,iCAAiBZ;;IAEtBa,wCAANC,IAA8Bd;IAClCe,YAAOD,EAAEE,CAACC,EAAEb,EAAEc,CAAClB;AACnBmB;;;AAGIC,sCAAwBpB;IACxBC,WAASC,aAAHmB,EAAOjB,EAAEc,CAAClB;AACpBsB;;;AAFIF,sCAAwBpB;IACxBC,WAASC,aAAHmB,EAAOjB,EAAEmB,CAACvB;AACpBsB;;;AAGIF,sCAA4BpB;IAC5BC,WAASC,aAAHmB,EAAOjB,EAAEoB,CAACxB;AACpBsB;AAFIF,sCAA4BpB;IAC5BC,WAASC,aAAHmB,EAAOjB,EAAEqB,CAACzB;AACpBsB;;AAEAF,sCAAwBpB;IACpB0B,sBAAeC;QACRC,MAAKC,CAACN,KAACO,EAAVb,CAAWjB;MADR+B,QAEPlC;AACJyB"} \ No newline at end of file diff --git a/testcases/sv/55_generic_module.sv b/testcases/sv/55_generic_module.sv index bd47f4e1..283de5ab 100644 --- a/testcases/sv/55_generic_module.sv +++ b/testcases/sv/55_generic_module.sv @@ -7,6 +7,7 @@ module veryl_testcase_Module55; veryl_testcase___Module55F__Module55B u5 (); endmodule +/// Generic module test for doc comment module veryl_testcase___Module55A__Module55B; veryl_testcase_Module55B u (); endmodule diff --git a/testcases/sv/56_generic_interface.sv b/testcases/sv/56_generic_interface.sv index 97ea640e..744470b6 100644 --- a/testcases/sv/56_generic_interface.sv +++ b/testcases/sv/56_generic_interface.sv @@ -5,13 +5,17 @@ module veryl_testcase_Module56; veryl_testcase___Interface56B__Package56B u3 (); endmodule +/// Generic interface test for doc comment interface veryl_testcase___Interface56A__Package56A; logic [veryl_testcase_Package56A::X-1:0] _a; endinterface + +/// Generic interface test for doc comment interface veryl_testcase___Interface56A__Package56B; logic [veryl_testcase_Package56B::X-1:0] _a; endinterface +/// Generic interface test for doc comment interface veryl_testcase___Interface56B__Package56A; logic [veryl_testcase_Package56A::X-1:0] _b; endinterface diff --git a/testcases/sv/57_generic_package.sv b/testcases/sv/57_generic_package.sv index 6c1d0111..5dac56fe 100644 --- a/testcases/sv/57_generic_package.sv +++ b/testcases/sv/57_generic_package.sv @@ -8,13 +8,17 @@ module veryl_testcase_Module57; always_comb _e.c = 1; endmodule +/// Generic package test for doc comment package veryl_testcase___Package57A__1; localparam int unsigned X = 1; endpackage + +/// Generic package test for doc comment package veryl_testcase___Package57A__2; localparam int unsigned X = 2; endpackage +/// Generic package test for doc comment package veryl_testcase___Package57B__3; localparam int unsigned X = 3; endpackage diff --git a/testcases/veryl/55_generic_module.veryl b/testcases/veryl/55_generic_module.veryl index df1bcb21..49b7b532 100644 --- a/testcases/veryl/55_generic_module.veryl +++ b/testcases/veryl/55_generic_module.veryl @@ -7,7 +7,8 @@ module Module55 { inst u5: Module55F::<>; } -module Module55A:: { +/// Generic module test for doc comment +pub module Module55A:: { inst u: T; } diff --git a/testcases/veryl/56_generic_interface.veryl b/testcases/veryl/56_generic_interface.veryl index e8de14df..d7c3b9c5 100644 --- a/testcases/veryl/56_generic_interface.veryl +++ b/testcases/veryl/56_generic_interface.veryl @@ -5,11 +5,13 @@ module Module56 { inst u3: Interface56B::<>; } -interface Interface56A:: { +/// Generic interface test for doc comment +pub interface Interface56A:: { var _a: logic; } -interface Interface56B:: { +/// Generic interface test for doc comment +pub interface Interface56B:: { var _b: logic; } diff --git a/testcases/veryl/57_generic_package.veryl b/testcases/veryl/57_generic_package.veryl index 39c36b73..33c8c6d9 100644 --- a/testcases/veryl/57_generic_package.veryl +++ b/testcases/veryl/57_generic_package.veryl @@ -8,11 +8,13 @@ module Module57 { assign _e.c = 1; } -package Package57A:: { +/// Generic package test for doc comment +pub package Package57A:: { local X: u32 = T; } -package Package57B:: { +/// Generic package test for doc comment +pub package Package57B:: { local X: u32 = T; }