-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Incorrect line numbers with some preprocessor directives #57
Comments
This looks like a bug to me. See #58. |
Thanks, Dave, this seems to fix the The include case seems still to be wrong, but I guess that is a harder problem to solve since multiple files are involved. |
@atyrberg Would you mind making a draft PR or branch with a testcase? Perhaps by adding some checks to test2: https://github.com/dalance/sv-parser/blob/master/sv-parser-pp/src/preprocess.rs#L919 |
Thanks for the help to try to solve this. I have added a commit atyrberg/sv-parser@ed2eac6 with a test showing the line number issue for include files. The line numbers are incorrect both for statements in the include file and in the source file. Also, I have not found any way to see if a statement is from an include file or from the source file (see out-comment assert in test). I didn't manage to add the test to |
Thanks, I see what you mean now, but I'm not sure of an immediate fix. |
@DaveMcEwan After some simple testing, #61 doesn't seem to fix the problem. I have looked quickly in |
Some preprocessor directives seem to give wrong line numbers.
The
default_nettype
get the correct line number, but everything after have line number offset by 1.Using include seems to offset the line number with the number of lines in the included file.
inc.vh
:Is there some why to get the line number of the source-file (and in case of includes which source/include-file) and not (what I guess) the preprocessed file? Or is this a bug?
The text was updated successfully, but these errors were encountered: