Don't use the external scanner for ...
#228
Merged
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.
We now have better invalidation of operators in the custom scanner than we did when we added the various
.
-prefixed operators. This means we can bail out quickly and avoid marking a token incorrectly.This simplifies downstream handling of
...
, which, in addition to being a Swift operator, is also used by Semgrep.In order to make this happen, we do also have to be a bit more careful with
mark_end
. If we're possibly going to emit a_semi
, we have to make sure not tomark_end
, because we don't want that to be "part of" the semi. This theoretically means that if we were chasing a longer operator, but failed to find it, and had a shorter operator that wascross_semi
, it would get parsed incorrectly -- but this seems unlikely since such a longer operator would be likely to match thecustom_operator
pattern to begin with.Fixes #226