Allow configureable WhitespaceBehavior in getTokensForParser#149
Allow configureable WhitespaceBehavior in getTokensForParser#149wilzbach wants to merge 2 commits intodlang-community:masterfrom
Conversation
cf8d373 to
fb5c14c
Compare
|
(rebased to see how CodeCov turns out to work) |
Codecov Report
@@ Coverage Diff @@
## master #149 +/- ##
==========================================
+ Coverage 81.47% 85.79% +4.32%
==========================================
Files 7 7
Lines 4528 7041 +2513
==========================================
+ Hits 3689 6041 +2352
- Misses 839 1000 +161
Continue to review full report at Codecov.
|
fb5c14c to
d9c9a83
Compare
Hackerpilot
left a comment
There was a problem hiding this comment.
The getTokensForParser function was given that name deliberately. The parser doesn't handle whitespace tokens so there should not be any whitespace in the value returned from this function.
| { | ||
| case tok!"specialTokenSequence": | ||
| case tok!"whitespace": | ||
| if (config.whitespaceBehavior == WhitespaceBehavior.include) |
There was a problem hiding this comment.
The (unchanged) doc comment specifically states that this won't happen.
Ok, but
|
|
This replaces the previous comment and trailingComment properties. Maintains full feature backwards-compatibility, only some `@nogc` code may now fail to compile if it used the comment or trailingComment properties from Token. supersedes dlang-community#149
This replaces the previous comment and trailingComment properties. Maintains full feature backwards-compatibility, only some `@nogc` code may now fail to compile if it used the comment or trailingComment properties from Token. supersedes dlang-community#149
This replaces the previous comment and trailingComment properties. Maintains full feature backwards-compatibility, only some `@nogc` code may now fail to compile if it used the comment or trailingComment properties from Token. supersedes dlang-community#149
|
there is a new PR (#387) which would replace this PR |
|
closing because no longer needed (superseded by #387, merged) |
Needed for dlang-community/D-Scanner#448 and and dlang-community/D-Scanner#450
I am not sure whether this is the best solution as it requires allocation by the user as
const(Token)[]isThe parser currently doesn't check for whitespace tokens and imho it would unnecessarily complicate its logic to add checks.