[109917] branches/larryv-mpvim-rewrite/syntax/portfile.vim

larryv at macports.org larryv at macports.org
Wed Aug 21 21:20:13 PDT 2013


Revision: 109917
          https://trac.macports.org/changeset/109917
Author:   larryv at macports.org
Date:     2013-08-21 21:20:13 -0700 (Wed, 21 Aug 2013)
Log Message:
-----------
Add list for "commands" to provide highlighting for all relevant options.

Also remove a now-nonexistent syntax group.

Modified Paths:
--------------
    branches/larryv-mpvim-rewrite/syntax/portfile.vim

Modified: branches/larryv-mpvim-rewrite/syntax/portfile.vim
===================================================================
--- branches/larryv-mpvim-rewrite/syntax/portfile.vim	2013-08-22 03:58:08 UTC (rev 109916)
+++ branches/larryv-mpvim-rewrite/syntax/portfile.vim	2013-08-22 04:20:13 UTC (rev 109917)
@@ -26,6 +26,7 @@
 " Some custom extensions contain a dash (for example, fs-traverse)
 setlocal iskeyword+=-
 
+let s:portfile_commands = []
 let s:portfile_options = []
 
 syn match PortfileGroup         "{.\+}" contained
@@ -53,6 +54,7 @@
 syn match PortfilePhases        "\<\%(pre-\|post-\)\?\%(fetch\|checksum\|extract\|patch\|configure\|build\|test\|destroot\|archive\|install\|activate\|deactivate\)\>" contains=PortfilePrePost
 
 " Fetch phase options
+call extend(s:portfile_commands, ['bzr', 'cvs', 'svn'])
 call extend(s:portfile_options, [
             \ '\%(master\|patch\)_sites\%(\.mirror_subdir\)\?',
             \ '\%(dist\|patch\)files',
@@ -275,6 +277,11 @@
     syn match PortfileSpaceError    display "\t\+ "
 endif
 
+for cmd in s:portfile_commands
+    call add(s:portfile_options, 'use_' . cmd)
+    let suffixes = ['args', 'cmd', 'dir', 'env', 'nice', 'post_args', 'pre_args', 'type']
+    call extend(s:portfile_options, map(suffixes, 'cmd . "." . v:val'))
+endfor
 execute 'syntax match PortfileOption'
             \ '"^\s*\zs\%(' .
             \ join(s:portfile_options, '\|') .
@@ -292,7 +299,6 @@
 hi def link PortfileChecksumsType       Special
 
 hi def link PortfilePhases              Keyword
-hi def link PortfilePhasesFetch         Keyword
 hi def link PortfilePhasesExtract       Keyword
 hi def link PortfilePhasesPatch         Keyword
 hi def link PortfilePhasesConf          Keyword
@@ -325,3 +331,5 @@
 endif
 
 let b:current_syntax = "Portfile"
+
+unlet cmd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130821/4347e010/attachment.html>


More information about the macports-changes mailing list