Skip to content

Commit

Permalink
Merge pull request #58 from sheaf/patch-1
Browse files Browse the repository at this point in the history
Detect qualified types and functions
  • Loading branch information
JustusAdam authored Dec 15, 2018
2 parents 46f4c43 + 00be792 commit ad29ebf
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions syntaxes/haskell.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@
<key>comment</key>
<string>In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).</string>
<key>match</key>
<string>(`)([\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*\.)*[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(`)</string>
<string>(`)(([\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}'\.]*)\.)?[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(`)</string>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.namespace</string>
</dict>
</dict>
<key>name</key>
<string>keyword.operator.function.infix.haskell</string>
</dict>
Expand Down Expand Up @@ -490,6 +498,10 @@
<key>include</key>
<string>#data_constructor</string>
</dict>
<dict>
<key>include</key>
<string>#qualifier</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
Expand Down Expand Up @@ -735,7 +747,7 @@
<key>match</key>
<string>(?&lt;conid&gt;[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(\.\g&lt;conid&gt;)?)</string>
<key>name</key>
<string>support.other.module.haskell</string>
<string>entity.name.namespace</string>
</dict>
<key>pragma</key>
<dict>
Expand All @@ -756,11 +768,18 @@
</array>
</dict>
<key>data_constructor</key>
<dict>
<key>match</key>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(?!\.)\b</string>
<key>name</key>
<string>constant.other.haskell</string>
</dict>
<key>qualifier</key>
<dict>
<key>match</key>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*\b</string>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(?=\.)\b</string>
<key>name</key>
<string>constant.other.haskell</string>
<string>meta.import.qualifier.haskell</string>
</dict>
<key>type_signature</key>
<dict>
Expand Down Expand Up @@ -843,10 +862,16 @@
</dict>
<dict>
<key>match</key>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*</string>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(?!\.)\b</string>
<key>name</key>
<string>storage.type.haskell</string>
</dict>
<dict>
<key>match</key>
<string>\b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(?=\.)</string>
<key>name</key>
<string>entity.name.namespace</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
Expand Down

0 comments on commit ad29ebf

Please sign in to comment.