Skip to content

[Haskell] match (*, @, and #) in keyword.operator.haskell #2272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Haskell/Haskell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ contexts:
scope: constant.other.haskell
- include: comments
- include: infix_op
- match: '[|!%$?~+:\-.=</>\\]+'
- match: '[|!%$*@#?~+:\-.=</>\\]+'
comment: In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.
scope: keyword.operator.haskell
- match: ","
Expand Down
22 changes: 22 additions & 0 deletions Haskell/syntax_test_haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,25 @@
0XdeafBEEF42
-- ^^^^^^^^^^^^ constant.numeric.integer.hexadecimal
-- ^^ punctuation.definition.numeric.base

data Outrageous =
Flipper Record
| Int :! Int
| Double :@ Double
-- ^ keyword.operator.haskell
| Int `Quux` Double
| String :# Record
-- ^ keyword.operator.haskell
| Simple :$ Outrageous
| DontDoThis { outrageousInt :: Int, outrageousString :: String }
deriving (Eq, Ord, Generic)
deriving (Read, Show) via (Quiet Outrageous)

genSimple :: Gen Simple
genSimple =
Simple
<$> genInt
<*> genString
-- ^ keyword.operator.haskell
<*> genDouble
<*> genRational