AdguardTeam / VscodeAdblockSyntax

Comprehensive extension to manage Adblock Syntax in VSCode: syntax highlighter, linter and much more. Available on the VSCode Marketplace.
https://marketplace.visualstudio.com/items?itemName=adguard.adblock
MIT License
70 stars 8 forks source link

More thorough testing of TMLanguage #133

Open scripthunter7 opened 3 months ago

scripthunter7 commented 3 months ago

Tester should throw an error if the TMLanguage file is not structured correctly or if any regular expression is syntactically incorrect. For both scenarios, the error message should be explicit and include the specific location of the error, indicated by row and column numbers.

In practice, incorrect TMLanguage is usually simply ignored and tokenization does not work.

For details on the TMLanguage structure, refer to: https://macromates.com/manual/en/language_grammars

Here's an example of an invalid regular expression:

match: |-
  (?x)
    (##)  # we often match separators, but in this case, first # in the separator considered as a comment - so we got an unbalanced parenthesis error