It's getting there.

On 4/26/07, Jonathan Smith <[EMAIL PROTECTED]> wrote:

Nikolai Weibull wrote:

 > A better way of doing this is to do (substitute \w with whatever
 > pattern your parser actually allows)
 >
 > syn match conaryUse
 > \ "Use\.\w\+"
 > \ nextgroup=conaryUseFlag

Oops.  That should be

syn keyword conaryUse
 \ nextgroup=conaryUseFlagSeparator
 \ Use

" Vim syntax file
" Language:     Conary Recipe
" Maintainer:   rPath Inc <http://www.rpath.com>
" Updated:      2007-04-26
"

The empty comment is still there.  Just leave that line blank.  No
biggie, of course, just aesthetics.

runtime! syntax/python.vim

Just to make sure: Python is allowed anywhere in a conary recipe?

syn keyword conarySFunction     mainDir addAction addSource addArchive addPatch

If you change the filetype name to conaryrecipe (note: no caps),
you'll also have to change the syntax-group names.

syn match   conaryMacro         "%(\w*)[sd]" contained
syn match   conaryBadMacro      "%(\w*)[^sd]" contained " no final marker

OK, so you can have the following:

%()s

or should it be "%(\w\+)[sd]"

" strings
syn region pythonString         matchgroup=Normal start=+[uU]\='+ end=+'+ 
skip=+\\\\\|\\'+ contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString         matchgroup=Normal start=+[uU]\="+ end=+"+ 
skip=+\\\\\|\\"+ contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString         matchgroup=Normal start=+[uU]\="""+ end=+"""+ 
contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonString         matchgroup=Normal start=+[uU]\='''+ end=+'''+ 
contains=pythonEscape,conaryMacro,conaryBadMacro
syn region pythonRawString      matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ 
skip=+\\\\\|\\'+ contains=conaryMacro,conaryBadMacro
syn region pythonRawString      matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ 
skip=+\\\\\|\\"+ contains=conaryMacro,conaryBadMacro
syn region pythonRawString      matchgroup=Normal start=+[uU]\=[rR]"""+ 
end=+"""+ contains=conaryMacro,conaryBadMacro
syn region pythonRawString      matchgroup=Normal start=+[uU]\=[rR]'''+ 
end=+'''+ contains=conaryMacro,conaryBadMacro

I wonder if naming them pythonX is very good.  Bram?

if version >= 508 || !exists("did_python_syn_inits")
  command -nargs=+ HiLink hi def link <args>

  " The default methods for highlighting.  Can be overridden later
  HiLink conaryMacro            Special
  HiLink conaryBFunction        Function
  HiLink conaryGFunction        Function
  HiLink conarySFunction        Operator
  HiLink conaryPFunction        Typedef
  HiLink conaryFlags            PreCondit
  HiLink conaryArches           Special
  HiLink conarySubArches        Special
  HiLink conaryBad              Error
  HiLink conaryBadMacro         Error
  HiLink conaryKeywords         Special
  HiLink conaryUseFlag          Typedef

  delcommand HiLink
endif

Substitute that with

hi def link conaryrecipeMacro Macro
hi def link conaryrecipeFunction Function
hi def link conaryrecipeBFunction conaryrecipeFunction
hi def link conaryrecipeGFunction conaryrecipeFunction
:
:

(If conary recipe macros aren't much like macros in C, then perhaps
Special is better.  Also note the linking of a generic group to
function and then other groups linking to them so that a user can
change them all en masse, to something they like.)

That HiLink cruft is also Vim5 compatibility stuff.  And remove the if
statement.

let b:current_syntax = "recipe"

This should be

let b:current_syntax = "conaryrecipe"

 nikolai

Reply via email to