aap.vim (5763B)
1 " Vim syntax file 2 " Language: A-A-P recipe 3 " Maintainer: The Vim Project <https://github.com/vim/vim> 4 " Last Change: 2023 Aug 10 5 " Former Maintainer: Bram Moolenaar <Bram@vim.org> 6 7 " Quit when a syntax file was already loaded 8 if exists("b:current_syntax") 9 finish 10 endif 11 12 let s:cpo_save = &cpo 13 set cpo&vim 14 15 syn include @aapPythonScript syntax/python.vim 16 17 syn match aapVariable /$[-+?*="'\\!]*[a-zA-Z0-9_.]*/ 18 syn match aapVariable /$[-+?*="'\\!]*([a-zA-Z0-9_.]*)/ 19 syn keyword aapTodo contained TODO Todo 20 syn match aapString +'[^']\{-}'+ 21 syn match aapString +"[^"]\{-}"+ 22 23 syn match aapCommand '^\s*:action\>' 24 syn match aapCommand '^\s*:add\>' 25 syn match aapCommand '^\s*:addall\>' 26 syn match aapCommand '^\s*:asroot\>' 27 syn match aapCommand '^\s*:assertpkg\>' 28 syn match aapCommand '^\s*:attr\>' 29 syn match aapCommand '^\s*:attribute\>' 30 syn match aapCommand '^\s*:autodepend\>' 31 syn match aapCommand '^\s*:buildcheck\>' 32 syn match aapCommand '^\s*:cd\>' 33 syn match aapCommand '^\s*:chdir\>' 34 syn match aapCommand '^\s*:checkin\>' 35 syn match aapCommand '^\s*:checkout\>' 36 syn match aapCommand '^\s*:child\>' 37 syn match aapCommand '^\s*:chmod\>' 38 syn match aapCommand '^\s*:commit\>' 39 syn match aapCommand '^\s*:commitall\>' 40 syn match aapCommand '^\s*:conf\>' 41 syn match aapCommand '^\s*:copy\>' 42 syn match aapCommand '^\s*:del\>' 43 syn match aapCommand '^\s*:deldir\>' 44 syn match aapCommand '^\s*:delete\>' 45 syn match aapCommand '^\s*:delrule\>' 46 syn match aapCommand '^\s*:dll\>' 47 syn match aapCommand '^\s*:do\>' 48 syn match aapCommand '^\s*:error\>' 49 syn match aapCommand '^\s*:execute\>' 50 syn match aapCommand '^\s*:exit\>' 51 syn match aapCommand '^\s*:export\>' 52 syn match aapCommand '^\s*:fetch\>' 53 syn match aapCommand '^\s*:fetchall\>' 54 syn match aapCommand '^\s*:filetype\>' 55 syn match aapCommand '^\s*:finish\>' 56 syn match aapCommand '^\s*:global\>' 57 syn match aapCommand '^\s*:import\>' 58 syn match aapCommand '^\s*:include\>' 59 syn match aapCommand '^\s*:installpkg\>' 60 syn match aapCommand '^\s*:lib\>' 61 syn match aapCommand '^\s*:local\>' 62 syn match aapCommand '^\s*:log\>' 63 syn match aapCommand '^\s*:ltlib\>' 64 syn match aapCommand '^\s*:mkdir\>' 65 syn match aapCommand '^\s*:mkdownload\>' 66 syn match aapCommand '^\s*:move\>' 67 syn match aapCommand '^\s*:pass\>' 68 syn match aapCommand '^\s*:popdir\>' 69 syn match aapCommand '^\s*:produce\>' 70 syn match aapCommand '^\s*:program\>' 71 syn match aapCommand '^\s*:progsearch\>' 72 syn match aapCommand '^\s*:publish\>' 73 syn match aapCommand '^\s*:publishall\>' 74 syn match aapCommand '^\s*:pushdir\>' 75 syn match aapCommand '^\s*:quit\>' 76 syn match aapCommand '^\s*:recipe\>' 77 syn match aapCommand '^\s*:refresh\>' 78 syn match aapCommand '^\s*:remove\>' 79 syn match aapCommand '^\s*:removeall\>' 80 syn match aapCommand '^\s*:require\>' 81 syn match aapCommand '^\s*:revise\>' 82 syn match aapCommand '^\s*:reviseall\>' 83 syn match aapCommand '^\s*:route\>' 84 syn match aapCommand '^\s*:rule\>' 85 syn match aapCommand '^\s*:start\>' 86 syn match aapCommand '^\s*:symlink\>' 87 syn match aapCommand '^\s*:sys\>' 88 syn match aapCommand '^\s*:sysdepend\>' 89 syn match aapCommand '^\s*:syspath\>' 90 syn match aapCommand '^\s*:system\>' 91 syn match aapCommand '^\s*:tag\>' 92 syn match aapCommand '^\s*:tagall\>' 93 syn match aapCommand '^\s*:toolsearch\>' 94 syn match aapCommand '^\s*:totype\>' 95 syn match aapCommand '^\s*:touch\>' 96 syn match aapCommand '^\s*:tree\>' 97 syn match aapCommand '^\s*:unlock\>' 98 syn match aapCommand '^\s*:update\>' 99 syn match aapCommand '^\s*:usetool\>' 100 syn match aapCommand '^\s*:variant\>' 101 syn match aapCommand '^\s*:verscont\>' 102 103 syn match aapCommand '^\s*:print\>' nextgroup=aapPipeEnd 104 syn match aapPipeCmd '\s*:print\>' nextgroup=aapPipeEnd contained 105 syn match aapCommand '^\s*:cat\>' nextgroup=aapPipeEnd 106 syn match aapPipeCmd '\s*:cat\>' nextgroup=aapPipeEnd contained 107 syn match aapCommand '^\s*:syseval\>' nextgroup=aapPipeEnd 108 syn match aapPipeCmd '\s*:syseval\>' nextgroup=aapPipeEnd contained 109 syn match aapPipeCmd '\s*:assign\>' contained 110 syn match aapCommand '^\s*:eval\>' nextgroup=aapPipeEnd 111 syn match aapPipeCmd '\s*:eval\>' nextgroup=aapPipeEndPy contained 112 syn match aapPipeCmd '\s*:tee\>' nextgroup=aapPipeEnd contained 113 syn match aapPipeCmd '\s*:log\>' nextgroup=aapPipeEnd contained 114 syn match aapPipeEnd '[^|]*|' nextgroup=aapPipeCmd contained skipnl 115 syn match aapPipeEndPy '[^|]*|' nextgroup=aapPipeCmd contained skipnl contains=@aapPythonScript 116 syn match aapPipeStart '^\s*|' nextgroup=aapPipeCmd 117 118 " 119 " A Python line starts with @. Can be continued with a trailing backslash. 120 syn region aapPythonRegion start="\s*@" skip='\\$' end=+$+ contains=@aapPythonScript keepend 121 " 122 " A Python block starts with ":python" and continues so long as the indent is 123 " bigger. 124 syn region aapPythonRegion matchgroup=aapCommand start="\z(\s*\):python" skip='\n\z1\s\|\n\s*\n' end=+$+ contains=@aapPythonScript 125 126 " A Python expression is enclosed in backticks. 127 syn region aapPythonRegion start="`" skip="``" end="`" contains=@aapPythonScript 128 129 " TODO: There is something wrong with line continuation. 130 syn match aapComment '#.*' contains=aapTodo 131 syn match aapComment '#.*\(\\\n.*\)' contains=aapTodo 132 133 syn match aapSpecial '$#' 134 syn match aapSpecial '$\$' 135 syn match aapSpecial '$(.)' 136 137 " A heredoc assignment. 138 syn region aapHeredoc start="^\s*\k\+\s*$\=+\=?\=<<\s*\z(\S*\)"hs=e+1 end="^\s*\z1\s*$"he=s-1 139 140 " Syncing is needed for ":python" and "VAR << EOF". Don't use Python syncing 141 syn sync clear 142 syn sync fromstart 143 144 " The default highlighting. 145 hi def link aapTodo Todo 146 hi def link aapString String 147 hi def link aapComment Comment 148 hi def link aapSpecial Special 149 hi def link aapVariable Identifier 150 hi def link aapPipeCmd aapCommand 151 hi def link aapCommand Statement 152 hi def link aapHeredoc Constant 153 154 let b:current_syntax = "aap" 155 156 let &cpo = s:cpo_save 157 unlet s:cpo_save 158 159 " vim: ts=8