a new vimball with updated syntax highlighting and omni-completion

SVN revision: 42929
This commit is contained in:
Viktor Kojouharov 2009-10-07 08:24:17 +00:00
parent f976b34a21
commit b972f930f7
1 changed files with 78 additions and 16 deletions

View File

@ -28,7 +28,7 @@ if exists('&ofu')
endif endif
syntax/edc.vim [[[1 syntax/edc.vim [[[1
225 234
" Vim syntax file " Vim syntax file
" Language: EDC " Language: EDC
" Maintainer: Viktor Kojouharov " Maintainer: Viktor Kojouharov
@ -49,29 +49,30 @@ syn keyword edcBlock text font fill origin size image contained
syn keyword edcBlock programs program styles style contained syn keyword edcBlock programs program styles style contained
syn keyword edcBlock gradient spectra spectrum contained syn keyword edcBlock gradient spectra spectrum contained
syn keyword edcBlock color_classes color_class rel1 rel2 contained syn keyword edcBlock color_classes color_class rel1 rel2 contained
syn keyword edcBlock items item contained syn keyword edcBlock items item script script_only contained
syn keyword edcBlock lua_script lua_script_only contained
syn keyword edcLabel item name alias min max type effect contained syn keyword edcLabel item name alias min max type effect contained
syn keyword edcLabel mouse_events repeat_events clip_to contained syn keyword edcLabel mouse_events repeat_events clip_to contained
syn keyword edcLabel x y confine events scale contained syn keyword edcLabel x y confine events scale scale_hint contained
syn keyword edcLabel ignore_flags precise_is_inside contained syn keyword edcLabel ignore_flags precise_is_inside contained
syn keyword edcLabel use_alternate_font_metrics entry_mode contained syn keyword edcLabel use_alternate_font_metrics entry_mode contained
syn keyword edcLabel source source2 source3 source4 contained syn keyword edcLabel source source2 source3 source4 source5 source6 contained
syn keyword edcLabel source5 source6 multiline pointer_mode contained syn keyword edcLabel source5 source6 multiline pointer_mode contained
syn keyword edcLabel state visible step aspect fixed middle contained syn keyword edcLabel state visible step aspect fixed middle contained
syn keyword edcLabel aspect_preference elipsis image contained syn keyword edcLabel aspect_preference elipsis image contained
syn keyword edcLabel relative offset to to_x to_y contained syn keyword edcLabel relative offset to to_x to_y select_mode contained
syn keyword edcLabel border color color2 color3 font size contained syn keyword edcLabel border color color2 color3 font size contained
syn keyword edcLabel signal action transition in contained syn keyword edcLabel signal action transition in contained
syn keyword edcLabel target after fit align contained syn keyword edcLabel target after fit align contained
syn keyword edcLabel text smooth inherit tag base style contained syn keyword edcLabel text smooth inherit tag base style contained
syn keyword edcLabel text_source color_class text_class contained syn keyword edcLabel text_source color_class text_class repch contained
syn keyword edcLabel spectrum angle spread normal tween contained syn keyword edcLabel spectrum angle spread normal tween contained
syn keyword edcLabel padding prefer weight aspect_mode contained syn keyword edcLabel padding prefer weight aspect_mode contained
syn keyword edcLabel options layout position span contained syn keyword edcLabel options layout position span contained
syn keyword edcLabel homogeneous contained syn keyword edcLabel homogeneous contained
syn keyword edcConstant COMP RAW LOSSY NONE ON_HOLD AUTOGRAB NOGRAB syn keyword edcConstant COMP RAW LOSSY USER NONE ON_HOLD AUTOGRAB NOGRAB
syn keyword edcConstant TEXT IMAGE RECT TEXTBLOCK SWALLOW GRADIENT GROUP syn keyword edcConstant TEXT IMAGE RECT TEXTBLOCK SWALLOW GRADIENT GROUP
syn keyword edcConstant NONE PLAIN OUTLINE SOFT_OUTLINE SHADOW syn keyword edcConstant NONE PLAIN OUTLINE SOFT_OUTLINE SHADOW
syn keyword edcConstant SOFT_SHADOW OUTLINE_SHADOW OUTLINE_SOFT_SHADOW syn keyword edcConstant SOFT_SHADOW OUTLINE_SHADOW OUTLINE_SOFT_SHADOW
@ -79,8 +80,10 @@ syn keyword edcConstant GLOW FAR_SHADOW FAR_SOFT_SHADOW
syn keyword edcConstant STATE_SET ACTION_STOP SIGNAL_EMIT FOCUS_SET syn keyword edcConstant STATE_SET ACTION_STOP SIGNAL_EMIT FOCUS_SET
syn keyword edcConstant DRAG_VAL_SET DRAG_VAL_STEP DRAG_VAL_PAGE syn keyword edcConstant DRAG_VAL_SET DRAG_VAL_STEP DRAG_VAL_PAGE
syn keyword edcConstant LINEAR SINUSOIDAL ACCELERATE DECELERATE syn keyword edcConstant LINEAR SINUSOIDAL ACCELERATE DECELERATE
syn keyword edcConstant VERTICAL HORIZONTAL BOTH BOX TABLE syn keyword edcConstant NEITHER VERTICAL HORIZONTAL BOTH BOX TABLE
syn keyword edcConstant EDITABLE PASSWORD "default" syn keyword edcConstant DEFAULT EXPLICIT SOLID DYNAMIC STATIC
syn keyword edcConstant EDITABLE PASSWORD SCALE TILE TABLE ITEM
syn keyword edcConstant SCRIPT LUA_SCRIPT "default"
syn keyword edcTodo contained TODO FIXME XXX syn keyword edcTodo contained TODO FIXME XXX
@ -188,6 +191,11 @@ unlet b:current_syntax
syn region edcScript matchgroup=edcScriptTag start="\<script\_s*{" end="}" contains=@edcEmbryo,edcScriptTag syn region edcScript matchgroup=edcScriptTag start="\<script\_s*{" end="}" contains=@edcEmbryo,edcScriptTag
syn keyword edcScriptTag contained script syn keyword edcScriptTag contained script
syn include @edcLua syntax/lua.vim
unlet b:current_syntax
syn region edcLuaScript matchgroup=edcLuaScriptTag start="\<lua_script\_s*{" end="}" contains=@edcLua,edcLuaScriptTag
syn keyword edcLuaScriptTag contained script
if exists("edc_minlines") if exists("edc_minlines")
let b:edc_minlines = edc_minlines let b:edc_minlines = edc_minlines
else else
@ -238,6 +246,7 @@ if version >= 508 || !exists("did_edc_syn_inits")
HiLink edcError Error HiLink edcError Error
HiLink edcBlock Function HiLink edcBlock Function
HiLink edcScriptTag Function HiLink edcScriptTag Function
HiLink edcLuaScriptTag Function
HiLink edcPreCondit PreCondit HiLink edcPreCondit PreCondit
HiLink edcConstant Constant HiLink edcConstant Constant
HiLink edcCommentString edcString HiLink edcCommentString edcString
@ -345,7 +354,7 @@ au BufRead,BufNewFile *.edc set filetype=edc
au BufRead,BufNewFile *.sma set filetype=embryo au BufRead,BufNewFile *.sma set filetype=embryo
au BufRead,BufNewFile *.embryo set filetype=embryo au BufRead,BufNewFile *.embryo set filetype=embryo
autoload/edccomplete.vim [[[1 autoload/edccomplete.vim [[[1
774 827
" Vim completion script " Vim completion script
" Language: EDC " Language: EDC
" Maintainer: Viktor Kojouharov " Maintainer: Viktor Kojouharov
@ -429,6 +438,8 @@ function! edccomplete#Complete(findstart, base)
call edccomplete#AddKeyword(res, a:base, s:partPointerMode) call edccomplete#AddKeyword(res, a:base, s:partPointerMode)
elseif line =~ 'editable_mode:\s*' elseif line =~ 'editable_mode:\s*'
call edccomplete#AddKeyword(res, a:base, s:partEditableMode) call edccomplete#AddKeyword(res, a:base, s:partEditableMode)
elseif line =~ 'select_mode:\s*'
call edccomplete#AddKeyword(res, a:base, s:partSelectMode)
endif endif
if line =~ 'image:\s*".\{-}"' if line =~ 'image:\s*".\{-}"'
call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod) call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
@ -457,11 +468,18 @@ function! edccomplete#Complete(findstart, base)
call edccomplete#AddStatement(res, line, a:base, s:imageStatement) call edccomplete#AddStatement(res, line, a:base, s:imageStatement)
if line =~ 'image:\s*".\{-}"' if line =~ 'image:\s*".\{-}"'
call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod) call edccomplete#AddKeyword(res, a:base, s:imageStorageMethod)
elseif line =~ 'middle:\s*'
call edccomplete#AddKeyword(res, a:base, s:middleTypes)
elseif line =~ 'scale_hint:\s*'
call edccomplete#AddKeyword(res, a:base, s:scaleHintTypes)
endif endif
elseif b:scontext == 'fill' elseif b:scontext == 'fill'
call edccomplete#AddLabel(res, line, a:base, s:fillLabel) call edccomplete#AddLabel(res, line, a:base, s:fillLabel)
call edccomplete#AddStatement(res, line, a:base, s:fillStatement) call edccomplete#AddStatement(res, line, a:base, s:fillStatement)
if line =~ 'type:\s*'
call edccomplete#AddKeyword(res, a:base, s:fillTypes)
endif
elseif b:scontext == 'origin' || b:scontext == 'size' elseif b:scontext == 'origin' || b:scontext == 'size'
call edccomplete#AddLabel(res, line, a:base, s:fillInnerStatement) call edccomplete#AddLabel(res, line, a:base, s:fillInnerStatement)
@ -721,9 +739,16 @@ let s:partLabel = {
\ 'use_alternate_font_metrics': '"bool"', \ 'use_alternate_font_metrics': '"bool"',
\ 'clip_to': '"string"', \ 'clip_to': '"string"',
\ 'source': '"string"', \ 'source': '"string"',
\ 'source2': '"string" (only for TEXTAREA)',
\ 'source3': '"string" (only for TEXTAREA)',
\ 'source4': '"string" (only for TEXTAREA)',
\ 'source5': '"string" (only for TEXTAREA)',
\ 'source6': '"string" (only for TEXTAREA)',
\ 'image': '"string" "keyword"', \ 'image': '"string" "keyword"',
\ 'font': '"string" "string"', \ 'font': '"string" "string"',
\ 'entry_mode': '"keyword"', \ 'entry_mode': '"keyword"',
\ 'select_mode': '"keyword"',
\ 'multiline': '"bool"',
\ } \ }
let s:partStatement = [ let s:partStatement = [
\ 'dragable', \ 'dragable',
@ -798,6 +823,7 @@ let s:imageLabel = {
\ 'tween': '"string"', \ 'tween': '"string"',
\ 'border': '"int" "int" "int" "int"', \ 'border': '"int" "int" "int" "int"',
\ 'middle': '"bool"', \ 'middle': '"bool"',
\ 'scale_hint': '"keyword"',
\ } \ }
" fill " fill
@ -805,6 +831,7 @@ let s:fillLabel = {
\ 'smooth': '"bool"', \ 'smooth': '"bool"',
\ 'angle': '"0-360"', \ 'angle': '"0-360"',
\ 'spread': '"bool"', \ 'spread': '"bool"',
\ 'type': '"keyword"',
\ } \ }
let s:fillStatement = [ let s:fillStatement = [
\ 'origin', \ 'origin',
@ -830,6 +857,7 @@ let s:textLabel = {
\ 'elipsis': '"float"', \ 'elipsis': '"float"',
\ 'source': '"string"', \ 'source': '"string"',
\ 'text_source': '"string"', \ 'text_source': '"string"',
\ 'repch': '"char"',
\ } \ }
let s:textStatement = [ let s:textStatement = [
\ 'fonts', \ 'fonts',
@ -848,6 +876,7 @@ let s:programLabel = {
\ } \ }
let s:programStatement = [ let s:programStatement = [
\ 'script', \ 'script',
\ 'lua_script',
\ ] \ ]
@ -900,16 +929,19 @@ let s:tableDescLabel = {
" group " group
let s:groupLabel = { let s:groupLabel = {
\ 'name': '"string"', \ 'name': '"string"',
\ 'alias': '"string"', \ 'alias': '"string"',
\ 'min': '"int" "int"', \ 'min': '"int" "int"',
\ 'max': '"int" "int"', \ 'max': '"int" "int"',
\ 'image': '"string" "keyword"', \ 'image': '"string" "keyword"',
\ 'font': '"string" "string"', \ 'font': '"string" "string"',
\ 'script_only': '"bool"',
\ 'lua_script_only': '"bool"',
\ } \ }
let s:groupStatement = [ let s:groupStatement = [
\ 'data', \ 'data',
\ 'script', \ 'script',
\ 'lua_script',
\ 'parts', \ 'parts',
\ 'images', \ 'images',
\ 'fonts', \ 'fonts',
@ -1020,6 +1052,7 @@ let s:imageStorageMethod = {
\ 'COMP': '', \ 'COMP': '',
\ 'RAW': '', \ 'RAW': '',
\ 'LOSSY': '0-100', \ 'LOSSY': '0-100',
\ 'USER': '',
\ } \ }
" part types " part types
@ -1065,14 +1098,43 @@ let s:partEditableMode = {
\ 'EDITABLE': '', \ 'EDITABLE': '',
\ 'PASSWORD': '', \ 'PASSWORD': '',
\ } \ }
" part effects
let s:partSelectMode = {
\ 'DEFAULT': '',
\ 'EXPLICIT': '',
\ }
" aspect_preference types " aspect_preference types
let s:aspectPrefTypes = { let s:aspectPrefTypes = {
\ 'NONE': '',
\ 'VERTICAL': '', \ 'VERTICAL': '',
\ 'HORIZONTAL': '', \ 'HORIZONTAL': '',
\ 'BOTH': '', \ 'BOTH': '',
\ } \ }
" image middle types
let s:middleTypes = {
\ 'NONE': '',
\ 'DEFAULT': '',
\ 'SOLID': '',
\ '0': '',
\ '1': '',
\ }
" image scale_hint types
let s:scaleHintTypes = {
\ 'NONE': '',
\ 'DYNAMIC': '',
\ 'STATIC': '',
\ '0': '',
\ }
" fill types
let s:fillTypes = {
\ 'SCALE': '',
\ 'TILE': '',
\ }
" program transition types " program transition types
let s:transitionTypes = { let s:transitionTypes = {
\ 'LINEAR': '0.0 - 1.0', \ 'LINEAR': '0.0 - 1.0',