on master help sign in
Add support for cabal syntax
commit785da3d9df0fa5aad0946f02431dea6c6f26e3c8 authorTobenna Ndu <tobenna@loyaltylion.com> dateWed 5 Sep 2018, 14:41 (8 years ago) parentd2b4766
3 files changed+51
.gitmodules+3 assets/syntaxes/Cabal+1 assets/syntaxes/Cabal.sublime-syntax+47
.gitmodules+3
@@ -67,3 +67,6 @@
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
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