patch-runtime_syntax_make_vim 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. $OpenBSD: patch-runtime_syntax_make_vim,v 1.6 2016/10/12 09:31:16 sthen Exp $
  2. --- runtime/syntax/make.vim.orig Sun Oct 9 16:28:01 2016
  3. +++ runtime/syntax/make.vim Wed Oct 12 10:01:36 2016
  4. @@ -23,6 +23,9 @@ syn match makeInclude "^ *[-s]\=include"
  5. syn match makeStatement "^ *vpath"
  6. syn match makeExport "^ *\(export\|unexport\)\>"
  7. syn match makeOverride "^ *override"
  8. +" BSD directives
  9. +syn match makePreCondit "^\. *\(if\|else\|endif\|ifdef\|ifndef\|ifmake\|ifnmake\|elif\|elifdef\|for\|endfor\|undef\)\>"
  10. +syn match makeInclude "^ *\. *include"
  11. hi link makeOverride makeStatement
  12. hi link makeExport makeStatement
  13. @@ -38,25 +41,29 @@ syn case match
  14. " identifiers
  15. syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
  16. syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
  17. +syn region makeIdent start="\<defined("rs=e skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
  18. +syn region makeIdent start="\<empty("rs=e skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
  19. +syn region makeIdent start="^\. *for\> *"rs=e+1 end=" *\<in\>"he=s contains=makePreCondit
  20. syn match makeIdent "\$\$\w*"
  21. syn match makeIdent "\$[^({]"
  22. -syn match makeIdent "^ *[^:#= \t]*\s*[:+?!*]="me=e-2
  23. -syn match makeIdent "^ *[^:#= \t]*\s*="me=e-1
  24. +syn match makeIdent "^ *[A-Za-z_][-A-Z-a-z0-9_.]*\s*[:+?!][:+?!]="me=e-3
  25. +syn match makeIdent "^ *[A-Za-z_][-A-Z-a-z0-9_.]*\s*[:+?!*]="me=e-2
  26. +syn match makeIdent "^ *[A-Za-z_][-A-Z-a-z0-9_.]*\s*="me=e-1
  27. syn match makeIdent "%"
  28. " Makefile.in variables
  29. syn match makeConfig "@[A-Za-z0-9_]\+@"
  30. " make targets
  31. -" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
  32. +" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\|MAIN\)\>"
  33. syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
  34. syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
  35. syn region makeTarget transparent matchgroup=makeTarget start="^[~A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
  36. syn match makeTarget "^[~A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget,makeComment skipnl nextgroup=makeCommands,makeCommandError
  37. -syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
  38. -syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent,makeComment skipnl nextgroup=makeCommands,makeCommandError
  39. +syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\|MAIN\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine,makeComment skipnl nextGroup=makeCommands
  40. +syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\|MAIN\)\>\s*::\=\s*$" contains=makeIdent,makeComment skipnl nextgroup=makeCommands,makeCommandError
  41. syn match makeCommandError "^\s\+\S.*" contained
  42. syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
  43. @@ -64,14 +71,15 @@ syn match makeCmdNextLine "\\\n."he=e-1 contained
  44. " Statements / Functions (GNU make)
  45. -syn match makeStatement contained "(\(subst\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
  46. +syn match makeStatement contained "(\(subst\|addprefix\|addsuffix\|basename\|call\|dir\|error\|filter-out\|filter\|findstring\|firstword\|foreach\|if\|join\|notdir\|origin\|patsubst\|shell\|sort\|strip\|suffix\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
  47. " Comment
  48. if exists("make_microsoft")
  49. - syn match makeComment "#.*" contains=@Spell,makeTodo
  50. + syn match makeComment "#.*" contains=makeTodo
  51. elseif !exists("make_no_comments")
  52. - syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
  53. - syn match makeComment "#$" contains=@Spell
  54. + syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=makeTodo
  55. + syn match makeComment "#$"
  56. +
  57. endif
  58. syn keyword makeTodo TODO FIXME XXX contained