-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemVerilog: support property:parameter (update for #2537) #2666
SystemVerilog: support property:parameter (update for #2537) #2666
Conversation
It seems that I have to update |
A negative integer K_PARAMETER is passed to createTag().
|
Thank you for your prompt reply as always. I cannot reproduce the fail. I'm afraid that
Do you see any problem above? |
c22d7f6
to
e793821
Compare
I found a bug in my code and commit the fix. |
|
I read https://www.cnblogs.com/xgcl-wei/p/9090918.html with Google Translate.
|
Examples in this article are old Verilog style,
This is important part. |
ctags should be more stupid. In most cases, it reports what it sees in the source code as-is to client tools; don't hide raw information too much. Being clever(?) is o.k. but provide high-level information as hints, and don't hide raw information too much. My idea of the way to represent the high-level information is "parameter:overridable" or "parameter:shadowed". Just an idea. Even if you disagree with me, you can merge this pull request. Having a maintainer of a parser is the highest prirority in this project. Either way, I would like you to write man/ctags-lang-systemvereilog.7.rst.in that helps developers of client tools know how to utilize tags output of systemverilog parser. |
I think you understand that we have to define a new field to solve the issue of #2537. Introducing new kinds does not help us at all for #2537. It is totally independent issue from #2537.
This is the point I wanted to hear from you. When we introduce a new tag-field, do we have to disable it by default as your patch did on #2537 (comment) ? tags man page does not explicitly described about this, but unsupported optional tag-field should be ignored by tools reading tags file. Even if a tags tool cannot ignore unsupported tag-field, users can disable explicitly by adding Do you agree with me? |
When we introduce a new tag-field, do we have to disable it by default as your patch did on #2537 (comment)? No. I disabled it because I was not sure whether I should enable it or not.
You can choose specific name with enabling the field by default. (2) the field name can conflict each other within the main part and parsers.
Yes, it is OK. Your understanding is the same as mine. BTW, when I started working on u-ctags, I had the similar concern (not the same).
YES. |
Thank you. I will change the field name to specific one. |
e793821
to
0b94697
Compare
Codecov Report
@@ Coverage Diff @@
## master #2666 +/- ##
==========================================
+ Coverage 86.92% 86.93% +0.01%
==========================================
Files 183 183
Lines 39053 39077 +24
==========================================
+ Hits 33946 33971 +25
+ Misses 5107 5106 -1
Continue to review full report at Codecov.
|
I chose Please review them. |
If you will give a value other than "overridden" to the "parameter" field in future development (like "parameter:shadowed"), "parameter:overridden" is o.k. If not, I think the field name should be "overridden"; attach "overridden:" instead of "parameter:overridden". The following change implements what I wrote for "If not" case.
However, this change doesn't work well. I must change the main part to support FIELDTYPE_BOOL. If all the changes are merged well, the parser works as follows:
|
A parser can have two types of documents; one for potential contributors who improve the parser, and users that include developers of client tools. docs/parser-.rst is for potential contributors. I think your new document is for users. So it should be man/ctags-lang-verilog.7.rst.in. |
I've been thinking of a better name since I read your message this morning.
Yes, this field is boolean. I did not think the value part should be empty for boolean field. How about "overridable_parameter:"? I thought "parameter:overridden" is better than "parameter:overridable", you proposed. "overridden_parameter:" is wrong.
I will make |
How about
I think we have discussed the name much. So I would like you to choose as you want. BTW, |
0b94697
to
eabd96a
Compare
I tried I decided to go with
Is this for json-writer?
Very cool bash script! This will help me a lot. |
@masatake san, May I commit this pull-request? You reviewed my code already. The only my concern is |
Could you wait for a while (2 or 3 days)? |
I merged #2688. So we can define a boolean type field. |
See man/README.
So users can read your man page at https://docs.ctags.io/en/latest/man-pages.html |
Yes. The change about boolean is done in my pull request. So you don've have to do it on your side. |
Thank you for your comments.
I can wait. |
Implements LRM 6.20.1 rule - If the declaration of a design element uses a parameter_port_list (even an empty one), then in any parameter_declaration directly contained within the declaration, the parameter keyword shall be a synonym for the localparam keyword (see 6.20.4). - All param_assignments appearing within a class body shall become localparam declarations regardless of the presence or absence of a parameter_port_list. - All param_assignments appearing within a generate block, package, or compilation-unit scope shall become localparam declarations. Only "generate block" rule is not implemented yet, because it does not create a context.
eabd96a
to
74fcee6
Compare
First please take a rest enough until you feel better. I've commit the fix. Whoops! The regression tests failed. /root/universal-ctags/Tmain/list-fields.d/stdout-diff.txt
I have no idea about this. I guess this is from the fix of #2668. Are they expected changes? Again I don't want rush you. Please take a look this after you gets well. |
Thank you. I'm feeling better now.
Yes, they are expected changes. Please update stdout-expected.txt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the stdout-expected.txt, the changes look good for me.
I think it is better to enable the new field by default because the information brought by the field is so useful. However, whether it should be enabled or not is up-to the parser maitainer.
74fcee6
to
97cbd5b
Compare
8cecf95
to
f5f4405
Compare
Good!
Let me stay this feature disabled by default. Because it is required by only a very specific use-case.
All tests passed. |
@masatake san, I found I had to add |
Please, open a new pull-request, and merge it. In such a simple one, you don't need my review but I would like you to make a pull reqeust for it. It seems that we use "gitignore:" as prefix.
|
This is a fix for #2537.
By adding option
--fields-SystemVerilog=+{property}
ctags outputs a tagproperty:parameter
on parameters which can be overridden on instantiation.I choose a generic name
property
instead ofdefinedWith
. This is because, as we discussed on #2537, what we need is not how a constant is defined with,parameter
orlocalparam
.