Skip to content

Commit

Permalink
Fix typo in data constructor highlighting regex
Browse files Browse the repository at this point in the history
  * Fixes some problems with slow/frozen highlighting (see #161)
  • Loading branch information
sheaf committed Jun 22, 2020
1 parent 75aa09b commit 05bfeff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions syntaxes/haskell.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1033,15 +1033,15 @@ repository:
# Type inside balanced brackets
| ('? # Optional promotion tick
(?<brac>
\( # Opening bracket
\[ # Opening bracket
(?:
[^\[\]]* # Match non-brackets
| \g<brac> # or recurse into further depth
)*
\] # Closing bracket
)
)
)
)
# Then either
\s*
# - a symbolic infix constructor, or
Expand Down
25 changes: 25 additions & 0 deletions test/tickets/T0161.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- SYNTAX TEST "source.haskell" "Data constructor highlighting"

data Foo a = (:>) a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
-- ^^^^ keyword.other.data.haskell
-- ^ keyword.operator.eq.haskell
-- ^^ constant.other.operator.haskell
-- ^ ^ ^ ^ ^ ^ ^ variable.other.generic-type.haskell

data Foo a = (:>) `C` ( S, O ) deriving ( Show, Ord )
-- ^^^^ keyword.other.data.haskell
-- ^ variable.other.generic-type.haskell
-- ^ keyword.operator.eq.haskell
-- ^^ storage.type.operator.haskell
-- ^^ - constant.other.operator.haskell
-- ^ constant.other.haskell
-- ^^^^^^^^ keyword.other.deriving.haskell
-- ^^^ ^ ^ ^^^^ ^^^ storage.type.haskell

data Foo a = (:>) Bar a deriving ( Show, Ord )
-- ^^^^ keyword.other.data.haskell
-- ^ keyword.operator.eq.haskell
-- ^^ constant.other.operator.haskell
-- ^ ^ variable.other.generic-type.haskell
-- ^^^^^^^^ keyword.other.deriving.haskell
-- ^^^ ^^^ ^^^^ ^^^ storage.type.haskell

0 comments on commit 05bfeff

Please sign in to comment.