diff --git a/.gitmodules b/.gitmodules index c1a79265..2be07447 100644 --- a/.gitmodules +++ b/.gitmodules @@ -67,3 +67,6 @@ [submodule "assets/themes/onehalf"] path = assets/themes/onehalf url = https://github.com/sonph/onehalf +[submodule "assets/syntaxes/Cabal"] + path = assets/syntaxes/Cabal + url = https://github.com/SublimeHaskell/SublimeHaskell diff --git a/assets/syntaxes/Cabal b/assets/syntaxes/Cabal new file mode 160000 index 00000000..1c054d9b --- /dev/null +++ b/assets/syntaxes/Cabal @@ -0,0 +1 @@ +Subproject commit 1c054d9b3684d4f8278f934099614674217fea4d diff --git a/assets/syntaxes/Cabal.sublime-syntax b/assets/syntaxes/Cabal.sublime-syntax new file mode 100644 index 00000000..b6e0dac2 --- /dev/null +++ b/assets/syntaxes/Cabal.sublime-syntax @@ -0,0 +1,47 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Cabal +file_extensions: + - cabal +scope: source.cabal +contexts: + main: + - match: ^(\s*)(exposed-modules):$ + captures: + 2: constant.other.cabal + push: + - meta_scope: exposed.modules.cabal + - match: ^(?!\1\s) + pop: true + - include: module_name + - match: ^(\s*)(build-depends):$ + captures: + 2: constant.other.cabal + push: + - meta_scope: exposed.modules.cabal + - match: ^(?!\1\s) + pop: true + - match: "([<>=]+)|([&|]+)" + scope: keyword.operator.haskell + - match: ((\d+|\*)\.)*(\d+|\*) + scope: constant.numeric.haskell + - match: '([\w\-]+)' + scope: support.function.haskell + - match: '^\s*([a-zA-Z_-]+)(:)\s+' + scope: entity.cabal + captures: + 1: constant.other.cabal + 2: punctuation.entity.cabal + - match: '^(?i)(executable|library|test-suite|benchmark|flag|source-repository)\s+([^\s,]+)\s*$' + scope: entity.cabal + captures: + 1: keyword.entity.cabal + 2: string.cabal + - match: ^(?i)library\s*$ + scope: keyword.entity.cabal + - match: "--.*$" + scope: comment.cabal + module_name: + - match: '([A-Z][A-Za-z_''0-9]*)(\.[A-Z][A-Za-z_''0-9]*)*' + scope: storage.module.haskell