Unverified Commit 5b1cb204 authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #7105 from phadej/vim-syntax-update

Rewrite cabal syntax file
parents 3f397c0c e043b678
......@@ -702,7 +702,7 @@ formatOtherModules = alaList' VCat MQuoted
--
_syntaxFieldNames :: IO ()
_syntaxFieldNames = sequence_
[ BS8.putStrLn $ "syn keyword cabalStatement " <> n <> ":"
[ BS8.putStrLn $ " \\ " <> n
| n <- nub $ sort $ mconcat
[ fieldGrammarKnownFieldList packageDescriptionFieldGrammar
, fieldGrammarKnownFieldList $ libraryFieldGrammar LMainLibName
......@@ -718,11 +718,14 @@ _syntaxFieldNames = sequence_
_syntaxExtensions :: IO ()
_syntaxExtensions = sequence_
[ putStrLn $ "syn keyword cabalExtension " <> e
| e <- nub $ sort
[ prettyShow e'
[ putStrLn $ " \\ " <> e
| e <- ["Safe","Trustworthy","Unsafe"]
++ es
++ map ("No"++) es
]
where
es = nub $ sort
[ prettyShow e
| e <- [ minBound .. maxBound ]
, e' <- [EnableExtension e, DisableExtension e]
, e `notElem` [Safe,Unsafe,Trustworthy]
]
, e `notElem` ["NoSafe", "NoUnsafe", "NoTrustworthy"]
]
cabal-version: 1.12
name: example
version: 1
synopsis: Synopsis is short, Example file for highlighting testing
author: Oleg Grenrus
maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>
homepage: http://example.com/url%20with%20spaces
category: Example
license: BSD-3-Clause
license-file: LICENSE
build-type: Simple
description:
description: Trying to fool highlighter, successfully?
Description is long and often written on multiple lines Haskell2010
type subdir extensions:, the colon could fool highligher
DeriveFunctor
as if else elif should not be matched here
tested-with:
GHC (>=7.0.4 && <8)
|| ==8.0.2
|| ==8.2.2
|| ==8.4.4
|| ==8.6.5
|| ==8.8.4
|| ==8.10.2
flag some-flag
manual: True
common name
default-language: Haskell2010
build-depends: base ^>=1.2.3
source-repository head
type: git
location: https://example.com/url%20with%20spaces.git
library
import: deps
exposed-modules: Foobar
build-depends: base
buildable: True
if flag(some-flag)
build-depends: containers
elif !impl(ghc >=8.0) && True
build-depends: semigroups
if flag(some-flag)
build-depends: nested
else
build-depends: void
-- test empty lines
build-depends:
, containers >= 0.5.0.0 && <0.6
, base ^>=4.4.0.0 || ^>=4.5.0.0
-- Case insensitivity
default-extensions:
DeriveFoldable
DeriveFunctor
other-extensions:
ImpredicativeTypes
LinearTypes
executable my-executable
import: deps
main-is: Executable.hs
test-suite my-tests
import: deps
-- exitcode-stdio-1.0 or detailed-0.9
type: exitcode-stdio-1.0
main-is: Tests.hs
benchmark my-benchmark
import: deps
type: exitcode-stdio-1.0
main-is: Bench.hs
foreign-library my-flib
import: deps
-- native-shared or native-static
type: native-shared
" Vim ftplugin file
" Language: Haskell Cabal Build file
" Maintainer: Cabal Development team <cabal-devel@haskell.org>
if exists('b:cabal_ftplugin')
finish
if exists("b:did_ftplugin")
finish
endif
let b:cabal_ftplugin = 1
let b:did_ftplugin = 1
" dashes are ok in keywords, and also colons (for field names)
setlocal iskeyword+=-
setlocal iskeyword+=:
setlocal iskeyword+=.
" dashes are ok in keywords, and occasionally a dot
setlocal iskeyword=a-z,A-Z,48-57,192-255,-,.
" comments start with --
setlocal commentstring=--\ %s
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment