|
55 | 55 | "|".join(
|
56 | 56 | [
|
57 | 57 | r"(?P<package>\b{0})\s*::\s*(?:{0}|\*)".format(_VERILOG_IDENTIFIER),
|
| 58 | + r"\bvirtual\s+class\s+(?P<class>\b{0})".format( |
| 59 | + _VERILOG_IDENTIFIER |
| 60 | + ), |
58 | 61 | r"(?<=`include\b)\s*\"(?P<include>.*?)\"",
|
59 | 62 | _COMMENT,
|
60 | 63 | ]
|
@@ -115,17 +118,29 @@ def _getDependencies(self): # type: () -> Iterable[BaseDependencySpec]
|
115 | 118 | if self.filetype is FileType.verilog:
|
116 | 119 | continue
|
117 | 120 |
|
118 |
| - import_name = match.groupdict().get("package", None) |
| 121 | + name = match.groupdict().get("package", None) |
119 | 122 |
|
120 | 123 | # package 'std' seems to be built-in. Need to have a look a this
|
121 | 124 | # if include_name is not None and include_name != 'std':
|
122 |
| - if import_name not in (None, "std"): |
| 125 | + if name not in (None, "std"): |
123 | 126 | line_number = text[: match.end()].count("\n")
|
124 | 127 | column_number = len(text[: match.start()].split("\n")[-1])
|
125 | 128 |
|
126 | 129 | yield RequiredDesignUnit(
|
127 | 130 | owner=self.filename,
|
128 |
| - name=VerilogIdentifier(import_name), # type: ignore |
| 131 | + name=VerilogIdentifier(name), # type: ignore |
| 132 | + locations=(Location(line_number, column_number),), |
| 133 | + ) |
| 134 | + |
| 135 | + name = match.groupdict().get("class", None) |
| 136 | + |
| 137 | + if name is not None: |
| 138 | + line_number = text[: match.end()].count("\n") |
| 139 | + column_number = len(text[: match.start()].split("\n")[-1]) |
| 140 | + |
| 141 | + yield RequiredDesignUnit( |
| 142 | + owner=self.filename, |
| 143 | + name=VerilogIdentifier(name), |
129 | 144 | locations=(Location(line_number, column_number),),
|
130 | 145 | )
|
131 | 146 |
|
|
0 commit comments