Skip to content

Commit

Permalink
[Cabal] Permissive section tags
Browse files Browse the repository at this point in the history
Any valid identifier starting a line and not followed by colon is
scoped section header.
  • Loading branch information
deathaxe committed Sep 14, 2022
1 parent 87df657 commit 04db79e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Haskell/Cabal.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ variables:
identifier: (?:[[:alpha:]][-_[:alnum:]]*)
module_identifier: (?:[[:upper:]][\w']*)

section_tags: |-
(?xi:
common | executable | benchmark | custom-setup | flag | library | package
| source-repository(?:-package)? | test-suite
)
boolean_tags: |-
(?xi: benchmarks | default | optimization | tests )
compiler_tags: |-
Expand Down Expand Up @@ -92,7 +86,7 @@ contexts:
###[ SECTIONS ]################################################################

sections:
- match: ^(({{section_tags}})(?:\s+([^\s,]+))?)\s*$
- match: ^(({{identifier}})(?:\s+([^\s,]+))?)\s*$
captures:
1: meta.toc-list.sections.cabal
2: keyword.declaration.section.cabal
Expand Down

0 comments on commit 04db79e

Please sign in to comment.