Merge branch 'vim-with-runtime' into feat/quickfix-title
[vim_extended.git] / runtime / syntax / sisu.vim
blob6944782f015920b99e028f551ac71133fc9bfc8e
1 "SiSU Vim syntax file
2 "SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
3 "SiSU Markup:     SiSU (sisu-2.0.1, 2010-03-17)
4 "(originally looked at Ruby Vim by Mirko Nasato)
6 if version < 600
7   syntax clear
8 elseif exists("b:current_syntax")
9   finish
10 else
11 endif
13 " Errors:
14 syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>"
16 " Markers Identifiers:
17 if !exists("sisu_no_identifiers")
18   syn match   sisu_mark_endnote                                           "\~^"
19   syn match   sisu_break               contains=@NoSpell                  "<br>\|<br />"
20   syn match   sisu_control             contains=@NoSpell                  "<:p[bn]>"
21   syn match   sisu_marktail                                               "[~-]#"
22   syn match   sisu_control                                                "\""
23   syn match   sisu_underline                                              "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
24   syn match   sisu_number              contains=@NoSpell                  "[0-9a-f]\{32\}\|[0-9a-f]\{64\}"
25   syn match   sisu_link                contains=@NoSpell                  "\(_\?https\?://\|\.\.\/\)\S\+"
26   syn match   sisu_link                                                   " \*\~\S\+"
27   syn match   sisu_action                                                 "^<:insert\d\+>"
28   syn match   sisu_require             contains=@NoSpell                  "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
29   syn match   sisu_require             contains=@NoSpell                  "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
30   syn match   sisu_structure                                              "^:A\~$"
31   syn match   sisu_sub_header_title                                       "^\s\+:\(subtitle\|short\|edition\|language\|note\):\s" "group=sisu_header_content
32   syn match   sisu_sub_header_creator                                     "^\s\+:\(author\|translator\|illustrator\|photographer\|audio\|digitized_by\|prepared_by\):\s"
33   syn match   sisu_sub_header_rights                                      "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|audio\|digitization\|license\|all\):\s"                                         "access_rights license
34   syn match   sisu_sub_header_classify                                    "^\s\+:\(type\|subject\|topic_register\|keywords\|coverage\|relation\|format\|identifier\|isbn\|dewey\|loc\|pg\):\s"
35   syn match   sisu_sub_header_dates                                       "^\s\+:\(published\|available\|created\|issued\|valid\|modified\|added_to_site\|translated\|original_publication\):\s"
36   syn match   sisu_sub_header_original                                    "^\s\+:\(publisher\|date\|language\|institution\|nationality\|source\):\s"
37   syn match   sisu_sub_header_make                                        "^\s\+:\(headings\|num_top\|breaks\|italics\|bold\|skin\|stamp\|promo\|ad\|manpage\):\s"
38   syn match   sisu_sub_header_notes                                       "^\s\+:\(comment\|abstract\|description\|history\|prefix\|prefix_[ab]\):\s"
39   syn match   sisu_sem_marker                                             ";{\|};[a-z._]*[a-z]"
40   syn match   sisu_sem_marker_block                                       "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]"
41   syn match   sisu_sem_ex_marker                                          ";\[\|\];[a-z._]*[a-z]"
42   syn match   sisu_sem_ex_marker_block                                    "\([a-z][a-z._]*\|\):\[\|\]:[a-z._]*[a-z]"
43   syn match   sisu_sem_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):{[^}].\{-}}:\1"
44   syn match   sisu_sem_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";{[^}].\{-}};[a-z]\+"
45   syn match   sisu_sem_ex_block contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_mark_endnote,sisu_content_endnote "\([a-z]*\):\[[^}].\{-}\]:\1"
46   syn match   sisu_sem_ex_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";\[[^}].\{-}\];[a-z]\+"
47 endif
49 "URLs Numbers And ASCII Codes:
50 syn match   sisu_number                              "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>"
51 syn match   sisu_number                              "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)"
53 "Tuned Error: (is error if not already matched)
54 syn match sisu_error             contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]"
55 syn match sisu_error             contains=sisu_error "<a href\|</a>]"
57 "Simple Paired Enclosed Markup:
58 "url/link
59 syn region sisu_link contains=sisu_error,sisu_error_wspace matchgroup=sisu_action start="^<<\s*|[a-zA-Z0-9^._-]\+|@|[a-zA-Z0-9^._-]\+|"rs=s+2 end="$"
60 "header
61 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_title matchgroup=sisu_header start="^[@]title:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
62 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_creator matchgroup=sisu_header start="^[@]creator:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
63 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
64 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
65 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_dates matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
66 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
67 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_publisher matchgroup=sisu_header start="^[@]publisher:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
68 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_notes matchgroup=sisu_header start="^[@]notes:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
69 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_original matchgroup=sisu_header start="^[@]original:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
70 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_source matchgroup=sisu_header start="^[@]source:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
71 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_linked,sisu_sub_header_links matchgroup=sisu_header start="^[@]links:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
72 "headings
73 syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
74 "grouped text
75 syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
76 syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
77 syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(alt\|group\|poem\){" end="^}\(alt\|group\|poem\)"
78 syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
79 "endnotes
80 syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n"
81 syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n"
82 syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$"
83 "links and images
84 syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|\.\./\)\S\+" oneline
85 syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline
86 syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline
87 "some line operations
88 syn region sisu_control contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_control start="\(\(^\| \)!_ \|<:b>\)" end="$"
89 syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\) " end="$"
90 syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^\(#[ 1]\|_# \)" end="$"
91 "font face curly brackets
92 "syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline
93 syn region sisu_index matchgroup=sisu_index_block start="^={" end="}"
94 syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
95 syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!"
96 syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_"
97 syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/"
98 syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+"
99 syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^"
100 syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="},"
101 syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-"
102 syn region sisu_html contains=sisu_error contains=sisu_strikeout matchgroup=sisu_contain start="<a href=\".\{-}\">" end="</a>" oneline
103 "single words bold italicise etc. "workon
104 syn region sisu_control contains=sisu_error matchgroup=sisu_control start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline
105 syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline
106 "misc
107 syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline
109 "Expensive Mode:
110 if !exists("sisu_no_expensive")
111 else " not Expensive
112   syn region  sisu_content_alt  matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline
113 endif " Expensive?
115 "Headers And Headings: (Document Instructions)
116 syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+"
117 syn region  sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$"
119 "Errors:
120 syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+[^:]"
121 syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+"
122 syn match sisu_error_wspace contains=sisu_error_wspace " \s*$"
123 syn match sisu_error contains=sisu_error_wspace "\t\+"
124 syn match sisu_error contains=sisu_error,sisu_error_wspace "\([^ (][_\\]\||[^ (}]\)https\?:\S\+"
125 syn match sisu_error contains=sisu_error "_\?https\?:\S\+[}><]"
126 syn match sisu_error contains=sisu_error "\([!*/_\+,^]\){\([^(\}\1)]\)\{-}\n$"
127 syn match sisu_error contains=sisu_error "^[\~]{[^{]\{-}\n$"
128 syn match sisu_error contains=sisu_error "\s\+.{{"
129 syn match sisu_error contains=sisu_error "^\~\s*$"
130 syn match sisu_error contains=sisu_error "^0\~.*"
131 syn match sisu_error contains=sisu_error "^[1-9]\~\s*$"
132 syn match sisu_error contains=sisu_error "^[1-9]\~\S\+\s*$"
133 syn match sisu_error contains=sisu_error "[^{]\~\^[^ \)]"
134 syn match sisu_error contains=sisu_error "\~\^\s\+\.\s*"
135 syn match sisu_error contains=sisu_error "{\~^\S\+"
136 syn match sisu_error contains=sisu_error "[_/\*!^]{[ .,:;?><]*}[_/\*!^]"
137 syn match sisu_error contains=sisu_error "[^ (\"'(\[][_/\*!]{\|}[_/\*!][a-zA-Z0-9)\]\"']"
138 syn match sisu_error contains=sisu_error "<dir>"
139 "errors for filetype sisu, though not error in 'metaverse':
140 syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>"
141 syn match sisu_error  "/\?<\([biu]\)>[^(</\1>)]\{-}\n$"
143 "Error Exceptions:
144 syn match sisu_control "\n$" "contains=ALL
145 syn match sisu_control " //"
146 syn match sisu_error   "%{"
147 syn match sisu_error   "<br>_\?https\?:\S\+\|_\?https\?:\S\+<br>"
148 syn match sisu_error   "[><]_\?https\?:\S\+\|_\?https\?:\S\+[><]"
149 syn match sisu_comment "^%\{1,2\}.\+"
151 "Definitions Default Highlighting:
152 hi def link sisu_normal                Normal
153 hi def link sisu_header                PreProc
154 hi def link sisu_header_content        Normal
155 hi def link sisu_sub_header_title      Statement
156 hi def link sisu_sub_header_creator    Statement
157 hi def link sisu_sub_header_rights     Statement
158 hi def link sisu_sub_header_classify   Statement
159 hi def link sisu_sub_header_dates      Statement
160 hi def link sisu_sub_header_make       Statement
161 hi def link sisu_sub_header_links      Statement
162 hi def link sisu_sub_header_publisher  Statement
163 hi def link sisu_sub_header_notes      Statement
164 hi def link sisu_sub_header_original   Statement
165 hi def link sisu_sub_header_source     Statement
166 hi def link sisu_heading               Title
167 hi def link sisu_structure             Operator
168 hi def link sisu_contain               Include
169 hi def link sisu_mark_endnote          Include
170 hi def link sisu_require               NonText
171 hi def link sisu_link                  NonText
172 hi def link sisu_linked                String
173 hi def link sisu_fontface              Include
174 hi def link sisu_strikeout             DiffDelete
175 hi def link sisu_content_alt           Special
176 hi def link sisu_sem_content           SpecialKey
177 hi def link sisu_sem_block             Special
178 hi def link sisu_sem_marker            Visual
179 "hi def link sisu_sem_marker            Structure
180 hi def link sisu_sem_marker_block      MatchParen
181 hi def link sisu_sem_ex_marker         FoldColumn
182 hi def link sisu_sem_ex_marker_block   Folded
183 hi def link sisu_sem_ex_content        Comment
184 "hi def link sisu_sem_ex_content        SpecialKey
185 hi def link sisu_sem_ex_block          Comment
186 hi def link sisu_index                 SpecialKey
187 hi def link sisu_index_block           Visual
188 hi def link sisu_content_endnote       Special
189 hi def link sisu_control               Define
190 hi def link sisu_ocn                   Include
191 hi def link sisu_number                Number
192 hi def link sisu_identifier            Function
193 hi def link sisu_underline             Underlined
194 hi def link sisu_markpara              Include
195 hi def link sisu_marktail              Include
196 hi def link sisu_mark                  Identifier
197 hi def link sisu_break                 Structure
198 hi def link sisu_html                  Type
199 hi def link sisu_action                Identifier
200 hi def link sisu_comment               Comment
201 hi def link sisu_error_sem_marker      Error
202 hi def link sisu_error_wspace          Error
203 hi def link sisu_error                 Error
204 let b:current_syntax = "sisu"