forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SystemVerilog: use the symbol table to recognize the types for ports
Close universal-ctags#2413. The original code could not capture "a" in "mod" in the following input because the parser didn't recognize "int32_t" before "a" is a name of type: typedef bit[31:0] int32_t; module mod( input bit clk, input int32_t a ); endmodule This change makes the parser look up the cork symbol table when the parser reads a token with unknown kind. A typedef like int32_t is stored to the symbol table when making a tag for it. As the result, the parser can resolve the kind for the token as typedef when parsing int32_t in "input int32_t a". Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
4 changed files
with
58 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--sort=no | ||
--extras=+q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
int32_t input.sv /^typedef bit[31:0] int32_t;$/;" T | ||
mod input.sv /^module mod($/;" m | ||
clk input.sv /^ input bit clk,$/;" p module:mod | ||
mod.clk input.sv /^ input bit clk,$/;" p module:mod | ||
a input.sv /^ input int32_t a$/;" p module:mod | ||
mod.a input.sv /^ input int32_t a$/;" p module:mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Takne from #2413 submitted by @antoinemadec | ||
typedef bit[31:0] int32_t; | ||
module mod( | ||
input bit clk, | ||
input int32_t a | ||
); | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters