on master help sign in
Merge pull request #282 from tobenna/support-cabal-syntax

Syntax highlighting for .cabal

commit96d4492d278cd05aaa75cc730f1f635a409b140d authorDavid Peter <sharkdp@users.noreply.github.com> dateWed 5 Sep 2018, 20:44 (8 years ago) parent2dbd91ec90f0b8
3 files changed+52−1
.gitmodules+4−1 assets/syntaxes/Cabal+1 assets/syntaxes/Cabal.sublime-syntax+47
.gitmodules+4−1
@@ -67,6 +67,9 @@
6767[submodule "assets/themes/onehalf"]
6868 path = assets/themes/onehalf
6969 url = https://github.com/sonph/onehalf
70+[submodule "assets/syntaxes/Cabal"]
71+ path = assets/syntaxes/Cabal
72+ url = https://github.com/SublimeHaskell/SublimeHaskell
7073[submodule "assets/syntaxes/Dart"]
7174 path = assets/syntaxes/Dart
72− url = https://github.com/guillermooo/dart-sublime-bundle
75+ url = https://github.com/guillermooo/dart-sublime-bundle
assets/syntaxes/Cabalnew file+1

Submodule changed.

assets/syntaxes/Cabal.sublime-syntaxnew file+47
@@ -0,0 +1,47 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Cabal
5+file_extensions:
6+ - cabal
7+scope: source.cabal
8+contexts:
9+ main:
10+ - match: ^(\s*)(exposed-modules):$
11+ captures:
12+ 2: constant.other.cabal
13+ push:
14+ - meta_scope: exposed.modules.cabal
15+ - match: ^(?!\1\s)
16+ pop: true
17+ - include: module_name
18+ - match: ^(\s*)(build-depends):$
19+ captures:
20+ 2: constant.other.cabal
21+ push:
22+ - meta_scope: exposed.modules.cabal
23+ - match: ^(?!\1\s)
24+ pop: true
25+ - match: "([<>=]+)|([&|]+)"
26+ scope: keyword.operator.haskell
27+ - match: ((\d+|\*)\.)*(\d+|\*)
28+ scope: constant.numeric.haskell
29+ - match: '([\w\-]+)'
30+ scope: support.function.haskell
31+ - match: '^\s*([a-zA-Z_-]+)(:)\s+'
32+ scope: entity.cabal
33+ captures:
34+ 1: constant.other.cabal
35+ 2: punctuation.entity.cabal
36+ - match: '^(?i)(executable|library|test-suite|benchmark|flag|source-repository)\s+([^\s,]+)\s*$'
37+ scope: entity.cabal
38+ captures:
39+ 1: keyword.entity.cabal
40+ 2: string.cabal
41+ - match: ^(?i)library\s*$
42+ scope: keyword.entity.cabal
43+ - match: "--.*$"
44+ scope: comment.cabal
45+ module_name:
46+ - match: '([A-Z][A-Za-z_''0-9]*)(\.[A-Z][A-Za-z_''0-9]*)*'
47+ scope: storage.module.haskell