117 Commits

Author SHA1 Message Date
4a73dc87f7 update 2024-09-26 20:13:56 +08:00
damc
a5d0c48b35 improvement78 Remove Option<> wrapper from ReadUtf8 arg.
There's no immediate usecase for distinguishing `Some`/`None`.
2023-02-07 19:17:57 +01:00
damc
ac2d169333 improvement78 Add Error::ReadUtf8 with testcase.
There are 6x LATIN1 bytes in a comment.
2023-02-07 18:57:08 +01:00
damc
1ee6215934 improvement78 Testcase for Error:DefineArgNotFound. 2023-02-07 18:30:59 +01:00
damc
f0aa7c5a5c improvement78 Testcase for Error:DefineNotFound. 2023-02-07 18:04:27 +01:00
damc
f98cb6c5d7 improvement78 Testcase, plus String arg for Error:DefineNoArgs. 2023-02-07 17:47:20 +01:00
dalance
9bfc1768c0
Merge pull request #69 from DaveMcEwan/ppErrorPreprocess
Use `Error::Preprocess` on pp parsing error, instead of `Error::Parse`.
2022-11-09 16:16:28 +09:00
damc
13504563f2 predefineSvCov Implement pre-defined constants, enable test. 2022-11-08 20:55:23 +01:00
damc
6b3b3ee903 predefineSvCov Add simple testcase. 2022-11-08 20:25:30 +01:00
damc
8c3f87b360 ppErrorPreprocess Add testcase, currently ignored. 2022-10-26 20:14:19 +02:00
damc
f9e93d18bd ppErrorPreprocess Make use of the existing Error::Preprocess
Before this commit, inputs with invalid pp syntax are reported using
`Error::Parse` which is also used to report invalid post-pp syntax.
In svlint/svls, `Error::Parse` is reported to the user as "parse error"
without specifying if that's pre or post pp.
This commit makes it possible for future versions of svlint/svls to report
"preprocess error", thus helping users to identify pp issues.

- `Error::Preprocess` appears to be defined but unused.
- Add the argument `Option<(PathBuf, usize)>` to `Error::Preprocess`, same
  as `Error::Parse`.
- Update `preprocess_str()` to use `Error::Preprocess` in all 5 instances.
2022-10-26 19:43:23 +02:00
damc
da6157952e ppTests include_quoted_(a|b|c|d)
- Illustration of https://github.com/dalance/svlint/issues/77
- That's the same as https://github.com/dalance/sv-parser/issues/48
- A,B show what doesn't work, vaguely defined on page 680.
- C,D show what does work, using example on page 680.
2022-07-26 22:00:46 +02:00
damc
8e461d0de6 ppTests Protect against infinite include recursion.
- 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.
2022-07-26 20:21:59 +02:00
damc
3755299139 ppTests include_recursive
- Ignored by default.
- Causes stack overflow.
2022-07-26 18:20:22 +02:00
damc
de098895d7 ppTests Simplify tests with preprocess_usualargs().
1. It's much less visual noise.
2. Preparation for change to `preprocess()` and `preprocess_str()` arguments.
2022-07-26 18:14:10 +02:00
damc
2b9ed78318 ppTests Comment-only explain include implementation. 2022-07-26 17:25:42 +02:00
damc
ddf33de79d ppTests Explain and rename include_basic,include_origin -> include_withindent,include_noindent 2022-07-26 16:46:13 +02:00
damc
edf66849ea ppTests Add missing undefineall test. 2022-07-26 13:30:33 +02:00
damc
ab4845a964 ppTests Avoid removal of undef and undefineall directives.
- 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.
2022-07-26 13:10:52 +02:00
damc
ae43678b9e ppTests undef 2022-07-26 12:57:50 +02:00
damc
bf6e5688aa ppTests line 2022-07-26 12:03:09 +02:00
damc
3c693d0d68 ppTests resetall 2022-07-26 11:48:36 +02:00
damc
c56c6a965b ppTests pragma 2022-07-26 11:42:17 +02:00
damc
3641284d68 ppTests unconnected_drive 2022-07-26 11:25:59 +02:00
damc
5c96bcb7e6 ppTests default_nettype 2022-07-26 11:25:09 +02:00
damc
466301c9c9 ppTests celldefine 2022-07-26 11:24:39 +02:00
damc
dc36b4b11f ppTests timescale 2022-07-26 11:24:04 +02:00
damc
15c38aaa0c ppTests keywords 2022-07-26 11:21:25 +02:00
damc
fc26dbf341 ppTests rm whitespace_directives
- Replacing with more thorough tests.
2022-07-26 11:20:39 +02:00
damc
4d647bf72d ppTests IEEE1800-2017_keyword_* 2022-07-26 10:28:23 +02:00
damc
565d15ccc5 ppTests mv macro_FILE into alphabetical position. 2022-07-26 09:54:41 +02:00
damc
963e17a5ea ppTests Allow define __FILE__ and define __LINE__ to parse.
- 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.
2022-07-25 22:21:28 +02:00
damc
f85809f55a ppTests macro_FILE 2022-07-25 22:14:22 +02:00
damc
7236f51602 ppTests Correct whitespace in macro expansion.
- Append the attached WhiteSpace on the end of TextMacroUsage.
  That append replaces/corrects "separator is required".
- Ignore leading whitespace as suggested by the BNF in Syntax 22-2.
  That SM change replaces/correct "remove leading whitespace".
- All tests now pass as expected.
2022-07-21 22:36:19 +02:00
damc
4f1b566e2b ppTests Use rearrange tests alphabetically after renames. 2022-07-21 22:26:13 +02:00
damc
d1e7f32d05 ppTests Comment-only explain replacements. 2022-07-21 21:40:11 +02:00
damc
1be39f0ce9 ppTests Fold markers around tests. 2022-07-21 18:39:21 +02:00
damc
bd1fc19ee8 ppTests Rename test2.svh -> included.svh
- 19 pass, 9 fail due to whitespace.
- All failures are suspected bugs.
2022-07-21 13:51:51 +02:00
damc
f927aee299 ppTests Add missing IEEE18002017_* tests. 2022-07-21 13:45:42 +02:00
damc
daa55135bc ppTests MESSY Rearrange tests alphabetically.
- This should be the last messy commit.
- Renamed and re-arranged tests are now easier to navigate.
- Six test failing for different reasons.
2022-07-21 13:34:23 +02:00
damc
812014ea16 ppTests Add two quotes from LRM in split_text(). 2022-07-21 13:19:23 +02:00
damc
e966beb51e ppTests mv macro_identifier 2022-07-21 13:18:22 +02:00
damc
3e8db79d51 ppTests mv macro_comment 2022-07-21 13:14:24 +02:00
damc
f4554b062c ppTests mv IEEE18002017_macro_mix_quotes 2022-07-21 13:10:18 +02:00
damc
d40374b509 ppTests mv IEEE18002017_macro_noexpand_string 2022-07-21 13:08:57 +02:00
damc
637e970b13 ppTests mv macro_basic 2022-07-21 13:07:29 +02:00
damc
81e3d1ea11 ppTests mv macro_multiline_comment 2022-07-21 13:02:42 +02:00
damc
e4b2fdbc49 ppTests mv include_basic 2022-07-21 12:57:56 +02:00
damc
dca16d22b8 ppTests mv include_sameline_comment 2022-07-21 12:51:16 +02:00
damc
2635d27193 ppTests mv include_sameline_keyword 2022-07-21 12:42:14 +02:00