VB parser updates: no sentinel strings, better directives, better attributes#603
Merged
maciejpirog merged 4 commits intomainfrom Mar 5, 2026
Merged
VB parser updates: no sentinel strings, better directives, better attributes#603maciejpirog merged 4 commits intomainfrom
maciejpirog merged 4 commits intomainfrom
Conversation
e72406e to
dc76450
Compare
Merged
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Mar 6, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [opengrep/opengrep](https://github.com/opengrep/opengrep) | patch | `v1.16.2` → `v1.16.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>opengrep/opengrep (opengrep/opengrep)</summary> ### [`v1.16.3`](https://github.com/opengrep/opengrep/releases/tag/v1.16.3): Opengrep 1.16.3 [Compare Source](opengrep/opengrep@v1.16.2...v1.16.3) #### Improvements - Elixir: Parse short function form (`def f(), do: ...`) by [@​maciejpirog](https://github.com/maciejpirog) in [#​605](opengrep/opengrep#605) - VB parser updates: no sentinel strings, better handling of compiler directives and attributes by [@​maciejpirog](https://github.com/maciejpirog) in [#​603](opengrep/opengrep#603) - Allow `--semgrepignore-filename` to be an absolute path by [@​dimitris-m](https://github.com/dimitris-m) in [#​608](opengrep/opengrep#608) **Full Changelog**: <opengrep/opengrep@v1.16.2...v1.16.3> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41NS4zIiwidXBkYXRlZEluVmVyIjoiNDMuNTUuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
This file contains hidden or 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
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.
No sentinel strings
Before, we used sentinel strings like
<PUNCTUATION>to match a particular kind of token. We now simply compare the token kind constructors via separate functions that consume particular kinds of tokens.Preprocessing directives
Before: We kept only the "then" branch of
#If ... #Else ... #End If. The new approach is slightly more cleverFirst, we make preprocessor directives ghost tokens, so in general they are ignored unless explicitly asked for. They are ignored en masse, which means all the code between
#Elseor#ElseIfand#End Ifis ignored, and so the original semantics still applies, unless the directive is explicitly asked for in a parsing rule.The directive is asked for (as one of the possible alternatives) when:
For example, we keep all the code in the following cases
and
If the directive is more complicated, e.g.,
we fall back to the old semantics and keep only the "then" branch.
Attributes
There are two kinds of attributes: global and local, the latter are attached to a particular definition. We can distinguish between them syntactically: the former have an
Assembly:orModule:prefix