robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
e651ae5864
master
1" Vim syntax file 2" Language: Icon 3" Maintainer: Doug Kearns <dougkearns@gmail.com> 4" Previous Maintainer: Wendell Turner <wendell@adsi-m4.com> (invalid last known address) 5" Last Change: 2022 Jun 16 6" Contributor: eschen@alumni.princeton.edu 2002.09.18 7 8" Prelude {{{1 9if exists ( "b:current_syntax" ) 10finish 11endif 12 13syn iskeyword @,48-57,_,192-255,& 14 15" Not Top {{{1 16syn cluster iconNotTop contains = iconDocField , iconIncluded , iconStringSpecial , iconTodo , @Spell 17 18" Whitespace errors {{{1 19if exists ( "icon_space_errors" ) 20if ! exists ( "icon_no_trail_space_error" ) 21syn match iconSpaceError "\s\+$ "display excludenl 22endif 23if ! exists ( "icon_no_tab_space_error" ) 24syn match iconSpaceError "\+\t "me= e-1display 25endif 26endif 27 28" Reserved words {{{1 29syn keyword iconReserved break by case create default do else every fail if 30syn keyword iconReserved initial next not of repeat return suspend then to 31syn keyword iconReserved until while 32 33syn keyword iconStorageClass global static local record invocable 34 35syn keyword iconLink link 36 37" Procedure definitions {{{1 38if exists ( "icon_no_procedure_fold" ) 39syn region iconProcedure matchgroup = iconReserved start = "\<procedure\> "end = "\<end\> "contains = ALLBUT , @iconNotTop 40else 41syn region iconProcedure matchgroup = iconReserved start = "\<procedure\> "end = "\<end\> "contains = ALLBUT , @iconNotTop fold 42endif 43 44" Keywords {{{1 45syn keywordiconKeyword &allocated &ascii &clock &collections &cset ¤t 46syn keywordiconKeyword &date &dateline &digits &dump &e &error &errornumber 47syn keywordiconKeyword &errortext &errorvalue &errout &fail &features &file 48syn keywordiconKeyword &host &input &lcase &letters &level &line &main &null 49syn keywordiconKeyword &output &phi &pi &pos &progname &random ®ions 50syn keywordiconKeyword &source &storage &subject &time &trace &ucase &version 51 52" Graphics keywords 53syn keywordiconKeyword &col &control &interval &ldrag &lpress &lrelease 54syn keywordiconKeyword &mdrag &meta &mpress &mrelease &rdrag &resize &row 55syn keywordiconKeyword &rpress &rrelease &shift &window &x &y 56 57" Functions {{{1 58syn keyword iconFunction abs acos any args asin atan bal callout center char 59syn keyword iconFunction chdir close collect copy cos cset delay delete detab 60syn keyword iconFunction display dtor entab errorclear exit exp find flush 61syn keyword iconFunction function get getch getche getenv iand icom image 62syn keyword iconFunction insert integer ior ishift ixor kbhit key left list 63syn keyword iconFunction loadfunc log many map match member move name numeric 64syn keyword iconFunction open ord pop pos proc pull push put read reads real 65syn keyword iconFunction remove rename repl reverse right rtod runerr save 66syn keyword iconFunction seek self seq serial set sin sort sortf sqrt stop 67syn keyword iconFunction string system tab table tan trim type upto variable 68syn keyword iconFunction where write writes 69 70" Graphics functions 71syn keyword iconFunction Active Alert Bg CenterString Clip Clone Color 72syn keyword iconFunction ColorDialog ColorValue CopyArea Couple DrawArc 73syn keyword iconFunction DrawCircle DrawCurve DrawImage DrawLine DrawPoint 74syn keyword iconFunction DrawPolygon DrawRectangle DrawSegment DrawString 75syn keyword iconFunction Enqueue EraseArea Event Fg FillArc FillCircle 76syn keyword iconFunction FillPolygon FillRectangle Font FreeColor GotoRC 77syn keyword iconFunction GotoXY LeftString Lower NewColor Notice OpenDialog 78syn keyword iconFunction PaletteChars PaletteColor PaletteGrays PaletteKey 79syn keyword iconFunction Pattern Pending Pixel Raise ReadImage RightString 80syn keyword iconFunction SaveDialog SelectDialog Shade TextDialog TextWidth 81syn keyword iconFunction ToggleDialog Uncouple WAttrib WClose WDefault WDelay 82syn keyword iconFunction WDone WFlush WOpen WQuit WRead WReads WriteImage 83syn keyword iconFunction WSync WWrite WWrites 84 85" String and character constants {{{1 86syn match iconStringSpecial "\\x\x\{2}\|\\\o\{3\}\|\\ [ bdeflnrtv\"\'\\ ] \|\\^ [ a-zA-Z0-9 ] "contained 87syn match iconStringSpecial "\\$ "contained 88syn match iconStringSpecial "_\ze\s * $ "contained 89 90syn region iconString start = +" +skip = +\\\\\|\\" +end = +" +contains = iconStringSpecial 91syn region iconCset start = +' +skip = +\\\\\|\\' +end = +' +contains = iconStringSpecial 92 93" Bracket errors {{{1 94 95if ! exists ( "icon_no_bracket_errors" ) 96" catch errors caused by wrong brackets (ACE 2002.09.18) 97syn cluster iconBracketGroup contains = iconBracketError , iconIncluded 98syn region iconBracket start = '\[ 'end = '\] 'contains = ALLBUT , @iconBracketGroup , @iconNotTop transparent 99syn match iconBracketError "] " 100 101"catch errors caused by wrong braces (ACE 2002.09.18) 102syn cluster iconBraceGroup contains = iconBraceError , iconIncluded 103syn region iconBrace start = '{ 'end = '} 'contains = ALLBUT , @iconBraceGroup , @iconNotTop transparent 104syn match iconBraceError "} " 105 106"catch errors caused by wrong parenthesis 107syn cluster iconParenGroup contains = iconParenError , iconIncluded 108syn region iconParen start = '( 'end = ') 'contains = ALLBUT , @iconParenGroup , @iconNotTop transparent 109syn match iconParenError ") " 110end 111 112" Numbers {{{1 113syn case ignore 114 115" integer 116syn match iconInteger "\<\d\+\> " 117syn match iconInteger "\<\d\{1,2} [ rR ][ a-zA-Z0-9 ] \+\> " 118 119" real with trailing dot 120syn match iconReal "\<\d\+\. " 121 122" real, with dot, optional exponent 123syn match iconReal "\<\d\+\.\d * \%(e [ -+ ] \=\d\+\)\=\> " 124 125" real, with leading dot, optional exponent 126syn match iconReal "\.\d\+\%(e [ -+ ] \=\d\+\)\=\> " 127 128" real, without dot, with exponent 129syn match iconReal "\<\d\+e [ -+ ] \=\d\+\> " 130 131syn cluster iconNumber contains = iconInteger , iconReal 132 133syn case match 134 135" Comments {{{1 136syn keyword iconTodo TODO FIXME XXX BUG contained 137syn match iconComment "#. * "contains = iconTodo , iconSpaceError , @Spell 138syn match iconDocField "^#\s\+\zs\%(File\|Subject\|Authors\=\|Date\|Version\|Links\|Requires\|See also\): "contained 139 140if exists ( "icon_no_comment_fold" ) 141syn region iconDocumentation start = "\%^#\{2,}\%(\n#\+\%(\s\+. * \)\=\)\+ "end = "^#\+\n\s * $ "contains = iconDocField keepend 142else 143syn region iconMultilineComment start = "^\s * #. * \n\%(^\s * #\)\@= "end = "^\s * #. * \n\%(^\s * #\)\@! "contains = iconComment keepend fold transparent 144syn region iconDocumentation start = "\%^#\{2,}\%(\n#\)\+ "end = "^#\+\n\%( [ ^# ] \|$\) "contains = iconDocField keepend fold 145endif 146 147" Preprocessor {{{1 148syn match iconPreInclude '^\s * \zs$\s * include\>\ze\s * " 'nextgroup = iconIncluded skipwhite 149syn match iconIncluded '" [ ^" ] \+" 'contained 150 151syn region iconPreDefine start = "^\s * \zs$\s * \%(define\|undef\)\> "end = "$ "oneline contains = ALLBUT , @iconPreGroup 152syn region iconPreProc start = "^\s * \zs$\s * \%(error\|line\)\> "end = "$ "oneline contains = ALLBUT , @iconPreGroup 153syn region iconPreConditional start = "^\s * \zs$\s * \%(if\|ifdef\|ifndef\|elif\|else\|endif\)\> "end = "$ "oneline contains = iconComment , iconString , iconCset , iconNumber , iconSpaceError 154 155syn cluster iconPreGroup contains = iconPreCondit , iconPreInclude , iconIncluded , iconPreDefine 156 157syn match iconPreSymbol "_V\d\+ " 158syn keyword iconPreSymbol _ACORN _AMIGA _ARM_FUNCTIONS _ASCII _CALLING 159syn keyword iconPreSymbol _CO_EXPRESSIONS _COMPILED _DIRECT_EXECUTION 160syn keyword iconPreSymbol _DOS_FUNCTIONS _EBCDIC _EVENT_MONITOR 161syn keyword iconPreSymbol _EXECUTABLE_IMAGES _EXTERNAL_FUNCTIONS 162syn keyword iconPreSymbol _EXTERNAL_VALUES _INTERPRETED _KEYBOARD_FUNCTIONS 163syn keyword iconPreSymbol _LARGE_INTEGERS _MACINTOSH _MEMORY_MONITOR _MSDOS 164syn keyword iconPreSymbol _MSDOS_386 _MULTIREGION _MULTITASKING _OS2 _PIPES 165syn keyword iconPreSymbol _PORT _PRESENTATION_MGR _RECORD_IO _STRING_INVOKE 166syn keyword iconPreSymbol _SYSTEM_FUNCTION _UNIX _VISUALIZATION _VMS 167syn keyword iconPreSymbol _WINDOW_FUNCTIONS _X_WINDOW_SYSTEM 168 169" Syncing {{{1 170if ! exists ( "icon_minlines" ) 171let icon_minlines = 250 172endif 173exec "syn sync ccomment iconComment minlines=" . icon_minlines 174 175" Default Highlighting {{{1 176 177hi def link iconParenError iconError 178hi def link iconBracketError iconError 179hi def link iconBraceError iconError 180hi def link iconSpaceError iconError 181hi def link iconError Error 182 183hi def link iconInteger Number 184hi def link iconReal Float 185hi def link iconString String 186hi def link iconCset String 187hi def link iconStringSpecial SpecialChar 188 189hi def link iconPreProc PreProc 190hi def link iconIncluded iconString 191hi def link iconPreInclude Include 192hi def link iconPreSymbol iconPreProc 193hi def link iconPreDefine Define 194hi def link iconPreConditional PreCondit 195 196hi def link iconStatement Statement 197hi def link iconStorageClass StorageClass 198hi def link iconFunction Function 199hi def link iconReserved Label 200hi def link iconLink Include 201hi def link iconKeyword Keyword 202 203hi def link iconComment Comment 204hi def link iconTodo Todo 205hi def link iconDocField SpecialComment 206hi def link iconDocumentation Comment 207 208" Postscript {{{1 209let b: current_syntax = "icon" 210 211" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: