Skip to content
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

[WIP] Fix issue 166 #191

Draft
wants to merge 7 commits into
base: mesonbuild
Choose a base branch
from

Conversation

Thomasb81
Copy link
Contributor

@Thomasb81 Thomasb81 commented Jul 14, 2024

Hello

Current draft push request is an attempt to fix : #166

First it remove new line added in preprocessing result. One part of the fix consist to make the preprocessing grammar to consume the training new line. The Ieee1800-2017 chapter 22.4 says

Only white space or a comment may appear on the same line as the `include compiler directive.

So we can remove new line on the line containing directive.
If included file does not end by new line, next line will appear on the last line from the included file. See tests/sv_pp/expected/include_many_dir/from_subdirectory.txt

Second part consist to enrich token build by antlr4 with original file location using file_line_map data.
But the result is not yet correct: current data structure does not allow to retrieve all information we need for every lines.

The CodePosition object has been update to reflect the fileName data. hdlConvertorAst would also need to be updated.

enrich with file origine of the token.
- Create the associated factory to instruct lexer to create token with our custom token
The factory is responsible to use the file_line_map data.
- Enrich CodePosition with fileName field.
@Thomasb81
Copy link
Contributor Author

Thomasb81 commented Jul 14, 2024

Tests are failing because hdlConvertorAst requiere an update of Codeposition object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant