aboutsummaryrefslogtreecommitdiff
path: root/share/vim/syntax/prep.vim
diff options
context:
space:
mode:
Diffstat (limited to 'share/vim/syntax/prep.vim')
-rw-r--r--share/vim/syntax/prep.vim57
1 files changed, 38 insertions, 19 deletions
diff --git a/share/vim/syntax/prep.vim b/share/vim/syntax/prep.vim
index 9044267..d801602 100644
--- a/share/vim/syntax/prep.vim
+++ b/share/vim/syntax/prep.vim
@@ -1,27 +1,46 @@
1" Vim syntax file 1" Vim syntax file
2" Language: PREP as used by PHT, PML, ibiza and Multilingual Markup (MLM) 2" Language: PREP, the chilled multi-purpose preprocessor
3" as used with HTML (PHT), Multilingual Markup (MLM)
4" but also with apache config files and more.
5"
3" Maintainer: carlo von lynX 6" Maintainer: carlo von lynX
4" Latest Revision: 2016-08-25 7" Latest Revision: 2016-08-25
5 8
6" We may intentionally want to add upon HTML or other syntaxes! 9if exists("b:current_syntax")
7"if exists("b:current_syntax") 10 finish
8" finish 11endif
9"endif 12
10 13" some variants of pht support wiki-like linking syntaxes additionally
11syn match mlmInline /((([a-z_]\+.*)))/ 14" doesn't hurt to mark them up
12syn match mlmComment /^# .*$/ 15syn match prepWikiLink /\[http.\+\]/
13syn match mlmComment /^##.*$/ 16
14syn match mlmFlag /^[A-Z]\+)/ 17" the inline processing syntax of prep is pretty unique, it allows to
15syn match mlmStatement /^#[a-z_]\+/ 18" embed anything anywhere and it never ended up colliding with other
16syn match mlmFlagStatement /^[A-Z]\+)#[a-z_]\+/ 19" syntax
17 20syn match prepInline /((([a-z_]\+.*)))/
18hi def link mlmStatement PreProc 21
19hi def link mlmFlagStatement Statement 22" slightly tricky when # is both cpp-like preprocessor statement and
20hi def link mlmFlag Constant 23" comment character in all other cases
21hi def link mlmInline Identifier 24syn match prepStatement /^#[a-z_]\+/
25syn match prepComment /^# .*$/
26syn match prepComment /^##.*$/
27
28" rudimentary syntax, but the only bearable way to handle multilingual
29" content. have you looked at .PO or XLIFF? just terrible.
30syn match prepFlag /^[A-Z]\+)/
31
32" prep allows preprocessor statements depending on flags
33syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/
34syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/
35
36hi def link prepStatement PreProc
37hi def link prepFlagStatement Statement
38hi def link prepFlag Constant
39hi def link prepInline Identifier
22" should be Comment, but it is not being 40" should be Comment, but it is not being
23" shown differently from regular text!? 41" shown differently from regular text!?
24hi def link mlmComment Type 42hi def link prepComment Type
43hi def link prepWikilink Constant
25 44
26"let b:current_syntax = "prep" 45let b:current_syntax = "prep"
27 46