Skip to content

Commit

Permalink
Avoid excessive backtracing in data declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaf committed May 13, 2020
1 parent 79b3a38 commit 1bb6423
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## x.x.x. - Unreleased

- Fix excessive backtracking in regular expression for data declarations
([#161](https://github.com/JustusAdam/language-haskell/issues/161)).

## 3.2.0 - 11.05.2020

- Improvements to highlighting data constructors:
Expand Down
6 changes: 2 additions & 4 deletions syntaxes/haskell.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -965,14 +965,12 @@ repository:
'2': {name: keyword.operator.pipe.haskell}
end: >-
(?x)
(?:\G|^)\s* # Enforce starting condition to avoid catastrophic backtracking (https://github.com/JustusAdam/language-haskell/issues/161)
(?: # Infix data constructor
\s*
# First argument
(?:
# Simple type
|(?<!')\b((?:[\p{Ll}_\p{Lu}\p{Lt}\p{Nd}'\.])+)
(?<!')\b((?:[\p{Ll}_\p{Lu}\p{Lt}\p{Nd}'\.])+)
# Type inside balanced parentheses
| ('? # Optional promotion tick
(?<paren>
Expand Down

0 comments on commit 1bb6423

Please sign in to comment.