-
-
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
Bugfixes for preprocess()
, plus organise and extend tests.
#61
Merged
Conversation
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
- This should be the last messy commit. - Renamed and re-arranged tests are now easier to navigate. - Six test failing for different reasons.
- Redefinitions are silently ignored. - ifdef/ifndef will always treat them as defined. - Enables compatibility with code from a silicon vendor I can think of. - NOTE: Whitespace bugs around endif/undef are observable in testcases.
- Replacing with more thorough tests.
- Similarly to how `define is left in-place, `undef and `undefine are also left in-place. - Corresponding fixes to macro_LINE and macro_FILE. - These directives were not in any testcases before this branch.
…thindent,include_noindent
1. It's much less visual noise. 2. Preparation for change to `preprocess()` and `preprocess_str()` arguments.
- Ignored by default. - Causes stack overflow.
- New argument `include_depth` on `preprocess_str()`. - Existing function `preprocess()` is now a wrapper for private function `preprocess_inner()` which uses `include_depth`. - Commented arguments on all uses of `preprocess()` and `preprocess_str()`. - Test `include_recursive` is fixed and not ignored. - Without recursion limit, stack overflow occurs which crashes svls.
- Illustration of dalance/svlint#77 - That's the same as dalance#48 - A,B show what doesn't work, vaguely defined on page 680. - C,D show what does work, using example on page 680.
DaveMcEwan
changed the title
WIP Tidy, correct, and extend tests for
Bugfixes for Jul 28, 2022
preprocess()
.preprocess()
, plus organise and extend tests.
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The changes in this PR are:
The diff looks awful, so please have a look through
testcases/*.sv
andtestcases/expected/*.sv
to see the proposed testing regime.
This makes it easier to update tests without worrying about breaking checks on trailing whitespace
because lots of people (including me) have their editor setup to strip that on write.
This is basically ppWhitespace done more thoroughly - sorry for the partial work!
Leading spaces/tabs should not be included in output, but a line continuation can start whitespace
to be included.
Whitespace attached to the macro usage node should be output, rather than outputting a fixed 1 or
2 spaces.
__FILE__
and__LINE__
.A well-known vendor tests if these are defined, presumably for backward compatibility.
The fix treats them as always defined, and prevents parse error when an unevaluated define sets them.
The reported testcases can be interpreted to be out-of-spec, because the quotes are expanded first.
See IEEE1800-2017 page 680, two paragraphs.
Raise an
Err(ExceedRecursiveLimit)
instead of stack overflow.This adds a new argument
include_depth
topreprocess_str()
, breaking backwards compatibility.This is already quite a large PR, so I'd like to leave fixes for #9 and #57 for a separate one.