Skip to content

Commit

Permalink
Merge pull request #462 from Guldoman/PR_fix_java_regex
Browse files Browse the repository at this point in the history
fix: avoid `language_java` catastrophic backtracking
  • Loading branch information
takase1121 authored Jul 22, 2024
2 parents 2e3282b + e4f37fd commit 3761855
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@
"tags": [
"language"
],
"version": "0.1.1"
"version": "0.1.2"
},
{
"description": "Syntax for the [jiyu](https://github.com/machinamentum/jiyu) programming language",
Expand Down
2 changes: 1 addition & 1 deletion plugins/language_java.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ syntax.add {
{ pattern = "-?%.?%d+f?", type = "number" },
{ pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
{ regex = "(?:\\w+\\.?)+(?=\\s+\\w++\\s*\\=\\s*)", type = "function" }, -- Class name when creating an object
{ regex = "(?:\\w++\\.?)+(?=\\s+\\w++\\s*\\=\\s*)", type = "function" }, -- Class name when creating an object
{ regex = "[A-Z][A-Z_]+", type = "keyword2" }, -- Constants
{ pattern = "[%a_][%w_]*", type = "symbol" },
},
Expand Down

0 comments on commit 3761855

Please sign in to comment.