LuaLS / lua.tmbundle

TextMate support for Lua
MIT License
7 stars 5 forks source link

Malformed regex in Lua.plist #19

Open lildude opened 5 months ago

lildude commented 5 months ago

šŸ‘‹ from github-linguist/linguist, the library GitHub.com uses for language detection, and also the repo that tells our syntax highlighter which grammars to use.

The Lua grammar was recently switched to using this repo in https://github.com/github-linguist/linguist/pull/6661 and our grammar compiler has found some malformed regexes in the Lua.plist file. These aren't found in the lua.tmLanguage.json so this is likely to be an inconsistency between the two files:

- [ ] repository `vendor/grammars/lua.tmbundle` (from https://github.com/LuaLS/lua.tmbundle.git) (22 errors)
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@class`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@enum`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@type`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@alias`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)(@operator)\s*(\b[`...": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@cast`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@param`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@return`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@field`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@generic`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@vararg`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@overload`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@deprecated`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@meta`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@private`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@protected`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@package`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@version`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@see`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@diagnostic`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@module`": lookbehind assertion is not fixed length (at offset 13))
  - Invalid regex in grammar: `source.lua` (in `Syntaxes/Lua.plist`) contains a malformed regex (regex "`(?<=---[ \t]*)@(async|nodiscard)`": lookbehind assertion is not fixed length (at offset 13))

If it helps, our grammar highlighting engine uses PCRE for performance reasons.

sumneko commented 4 months ago

Thank you for providing such a tool. Is there a GitHub action available for me to use in my workflow?

lildude commented 4 months ago

Thank you for providing such a tool. Is there a GitHub action available for me to use in my workflow?

Unfortunately, no.

sumneko commented 4 months ago

Could you please check if it fixed by https://github.com/LuaLS/lua.tmbundle/commit/5882e544075884ed8a7e6d948bcd840e224ba75c ?

Sainan commented 4 months ago

As he did say "These aren't found in the lua.tmLanguage.json", he is telling you to update your Lua.plist.