This commit is contained in:
Adam Stankiewicz
2020-03-02 00:34:02 +01:00
parent 35ea4d2b90
commit 6b540d7db0
38 changed files with 1853 additions and 1031 deletions

View File

@@ -136,7 +136,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin) - [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin) - [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, ftplugin) - [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, compiler, ftplugin)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin) - [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, autoload, ftplugin) - [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, autoload, ftplugin)
@@ -166,7 +166,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent) - [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent) - [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
- [svg](https://github.com/vim-scripts/svg.vim) (syntax) - [svg](https://github.com/vim-scripts/svg.vim) (syntax)
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin) - [swift](https://github.com/keith/swift.vim) (syntax, indent, compiler, ftplugin)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax) - [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax, ftplugin) - [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax, ftplugin)
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, ftplugin) - [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, ftplugin)

View File

@@ -2,17 +2,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') =
"Vim conceal file "Vim conceal file
" Language: Mathematica " Language: Mathematica
" Maintainer: Voldikss <dyzplus@gmail.com> " Maintainer: R. Menon <rsmenon@icloud.com>
" Last Change: 2019 Jan 23 by Voldikss " Last Change: Feb 25, 2013
" Source: https://github.com/voldikss/vim-mma/after/syntax/mma.vim
" Credits:
" Rsmenon: https://github.com/rsmenon
if (exists('g:mma_candy') && g:mma_candy == 0) || !has('conceal') || &enc != 'utf-8' if (exists('g:mma_candy') && g:mma_candy == 0) || !has('conceal') || &enc != 'utf-8'
finish finish
endif endif
"These are fairly safe and straightforward conceals "These are fairly safe and straightforward conceals
if exists('g:mma_candy') && g:mma_candy > 0 if exists('g:mma_candy') && g:mma_candy > 0
"Rules "Rules

View File

@@ -42,8 +42,8 @@ syn keyword yamlConstant NULL Null null NONE None none NIL Nil nil
syn keyword yamlConstant TRUE True true YES Yes yes ON On on syn keyword yamlConstant TRUE True true YES Yes yes ON On on
syn keyword yamlConstant FALSE False false NO No no OFF Off off syn keyword yamlConstant FALSE False false NO No no OFF Off off
syn match yamlKey "^\s*\zs[^ \t\"]\+\ze\s*:" syn match yamlKey "^\s*\zs[^ \t\"\'#]\+\ze\s*:"
syn match yamlKey "^\s*-\s*\zs[^ \t\"\']\+\ze\s*:" syn match yamlKey "^\s*-\s*\zs[^ \t\"\'#]\+\ze\s*:"
syn match yamlAnchor "&\S\+" syn match yamlAnchor "&\S\+"
syn match yamlAlias "*\S\+" syn match yamlAlias "*\S\+"

View File

@@ -13,6 +13,9 @@ function! s:L2U_Setup()
if !has_key(b:, "l2u_enabled") if !has_key(b:, "l2u_enabled")
let b:l2u_enabled = 0 let b:l2u_enabled = 0
endif endif
if !has_key(b:, "l2u_autodetect_enable")
let b:l2u_autodetect_enable = 1
endif
" Did we install the L2U tab mappings? " Did we install the L2U tab mappings?
if !has_key(b:, "l2u_tab_set") if !has_key(b:, "l2u_tab_set")
@@ -92,34 +95,39 @@ endfunction
" Each time the filetype changes, we may need to enable or " Each time the filetype changes, we may need to enable or
" disable the LaTeX-to-Unicode functionality " disable the LaTeX-to-Unicode functionality
function! LaTeXtoUnicode#Refresh() function! LaTeXtoUnicode#Refresh()
call s:L2U_Setup() call s:L2U_Setup()
" skip if manually overridden
if !b:l2u_autodetect_enable
return ''
endif
" by default, LaTeX-to-Unicode is only active on julia files " by default, LaTeX-to-Unicode is only active on julia files
let file_types = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types", "julia")) let file_types = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types", "julia"))
let file_types_blacklist = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types_blacklist", "$^")) let file_types_blacklist = s:L2U_file_type_regex(get(g:, "latex_to_unicode_file_types_blacklist", "$^"))
if match(&filetype, file_types) < 0 || match(&filetype, file_types_blacklist) >= 0 if match(&filetype, file_types) < 0 || match(&filetype, file_types_blacklist) >= 0
if b:l2u_enabled if b:l2u_enabled
call LaTeXtoUnicode#Disable() call LaTeXtoUnicode#Disable(1)
else else
return return ''
endif endif
elseif !b:l2u_enabled elseif !b:l2u_enabled
call LaTeXtoUnicode#Enable() call LaTeXtoUnicode#Enable(1)
endif endif
endfunction endfunction
function! LaTeXtoUnicode#Enable() function! LaTeXtoUnicode#Enable(...)
let auto_set = a:0 > 0 ? a:1 : 0
if b:l2u_enabled if b:l2u_enabled
return return ''
end end
call s:L2U_ResetLastCompletionInfo() call s:L2U_ResetLastCompletionInfo()
let b:l2u_enabled = 1 let b:l2u_enabled = 1
let b:l2u_autodetect_enable = auto_set
" If we're editing the first file upon opening vim, this will only init the " If we're editing the first file upon opening vim, this will only init the
" command line mode mapping, and the full initialization will be performed by " command line mode mapping, and the full initialization will be performed by
@@ -127,18 +135,18 @@ function! LaTeXtoUnicode#Enable()
" Otherwise, if we're opening a file from within a running vim session, this " Otherwise, if we're opening a file from within a running vim session, this
" will actually initialize all the LaTeX-to-Unicode substitutions. " will actually initialize all the LaTeX-to-Unicode substitutions.
call LaTeXtoUnicode#Init() call LaTeXtoUnicode#Init()
return ''
return
endfunction endfunction
function! LaTeXtoUnicode#Disable() function! LaTeXtoUnicode#Disable(...)
let auto_set = a:0 > 0 ? a:1 : 0
if !b:l2u_enabled if !b:l2u_enabled
return return ''
endif endif
let b:l2u_enabled = 0 let b:l2u_enabled = 0
let b:l2u_autodetect_enable = auto_set
call LaTeXtoUnicode#Init() call LaTeXtoUnicode#Init()
return return ''
endfunction endfunction
" Translate old options to their new equivalents " Translate old options to their new equivalents
@@ -246,7 +254,6 @@ function! LaTeXtoUnicode#omnifunc(findstart, base)
endif endif
let b:l2u_in_fallback = 0 let b:l2u_in_fallback = 0
" set info for the callback " set info for the callback
let b:l2u_tab_completing = 1
let b:l2u_found_completion = 1 let b:l2u_found_completion = 1
" analyse current line " analyse current line
let col1 = col('.') let col1 = col('.')
@@ -375,6 +382,7 @@ function! LaTeXtoUnicode#Tab()
endif endif
" reset the in_fallback info " reset the in_fallback info
let b:l2u_in_fallback = 0 let b:l2u_in_fallback = 0
let b:l2u_tab_completing = 1
" temporary change to completeopt to use the `longest` setting, which is " temporary change to completeopt to use the `longest` setting, which is
" probably the only one which makes sense given that the goal of the " probably the only one which makes sense given that the goal of the
" completion is to substitute the final string " completion is to substitute the final string
@@ -383,7 +391,8 @@ function! LaTeXtoUnicode#Tab()
set completeopt-=noinsert set completeopt-=noinsert
" invoke omnicompletion; failure to perform LaTeX-to-Unicode completion is " invoke omnicompletion; failure to perform LaTeX-to-Unicode completion is
" handled by the CompleteDone autocommand. " handled by the CompleteDone autocommand.
return "\<C-X>\<C-O>" call feedkeys("\<C-X>\<C-O>", 'n')
return ""
endfunction endfunction
" This function is called at every CompleteDone event, and is meant to handle " This function is called at every CompleteDone event, and is meant to handle
@@ -409,7 +418,7 @@ function! LaTeXtoUnicode#FallbackCallback()
endfunction endfunction
" This is the function that performs the substitution in command-line mode " This is the function that performs the substitution in command-line mode
function! LaTeXtoUnicode#CmdTab(triggeredbytab) function! LaTeXtoUnicode#CmdTab(trigger)
" first stage " first stage
" analyse command line " analyse command line
let col1 = getcmdpos() - 1 let col1 = getcmdpos() - 1
@@ -418,10 +427,12 @@ function! LaTeXtoUnicode#CmdTab(triggeredbytab)
let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0) let b:l2u_singlebslash = (match(l[0:col1-1], '\\$') >= 0)
" completion not found " completion not found
if col0 == -1 if col0 == -1
if a:triggeredbytab if a:trigger == &wildchar
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab> call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
elseif a:trigger == char2nr("\<S-Tab>")
call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
endif endif
return l return ''
endif endif
let base = l[col0 : col1-1] let base = l[col0 : col1-1]
" search for matches " search for matches
@@ -430,39 +441,28 @@ function! LaTeXtoUnicode#CmdTab(triggeredbytab)
for k in keys(g:l2u_symbols_dict) for k in keys(g:l2u_symbols_dict)
if k ==# base if k ==# base
let exact_match = 1 let exact_match = 1
endif break
if len(k) >= len(base) && k[0 : len(base)-1] ==# base elseif len(k) >= len(base) && k[0 : len(base)-1] ==# base
call add(partmatches, k) call add(partmatches, k)
endif endif
endfor endfor
if len(partmatches) == 0 if !exact_match && len(partmatches) == 0
if a:triggeredbytab " no matches, call fallbacks
call feedkeys("\<Tab>", 'nt') " fall-back to the default <Tab> if a:trigger == &wildchar
endif call feedkeys(nr2char(a:trigger), 'nt') " fall-back to the default wildchar
return l elseif a:trigger == char2nr("\<S-Tab>")
call feedkeys("\<S-Tab>", 'nt') " fall-back to the default <S-Tab>
endif endif
elseif exact_match
" exact matches are replaced with Unicode " exact matches are replaced with Unicode
if exact_match
let unicode = g:l2u_symbols_dict[base] let unicode = g:l2u_symbols_dict[base]
if col0 > 0 call feedkeys(repeat("\b", len(base)) . unicode, 'nt')
let pre = l[0 : col0 - 1]
else else
let pre = ''
endif
let posdiff = col1-col0 - len(unicode)
call setcmdpos(col1 - posdiff + 1)
return pre . unicode . l[col1 : -1]
endif
" no exact match: complete with the longest common prefix " no exact match: complete with the longest common prefix
let common = s:L2U_longest_common_prefix(partmatches) let common = s:L2U_longest_common_prefix(partmatches)
if col0 > 0 call feedkeys(common[len(base):], 'nt')
let pre = l[0 : col0 - 1]
else
let pre = ''
endif endif
let posdiff = col1-col0 - len(common) return ''
call setcmdpos(col1 - posdiff + 1)
return pre . common . l[col1 : -1]
endfunction endfunction
" Setup the L2U tab mapping " Setup the L2U tab mapping
@@ -473,7 +473,8 @@ function! s:L2U_SetTab(wait_insert_enter)
let b:l2u_cmdtab_keys = [b:l2u_cmdtab_keys] let b:l2u_cmdtab_keys = [b:l2u_cmdtab_keys]
endif endif
for k in b:l2u_cmdtab_keys for k in b:l2u_cmdtab_keys
exec 'cnoremap <buffer> '.k.' <C-\>eLaTeXtoUnicode#CmdTab('.(k ==? '<Tab>').')<CR>' exec 'let trigger = char2nr("'.(k[0] == '<' ? '\' : '').k.'")'
exec 'cnoremap <buffer><expr> '.k.' LaTeXtoUnicode#CmdTab('.trigger.')'
endfor endfor
let b:l2u_cmdtab_set = 1 let b:l2u_cmdtab_set = 1
endif endif
@@ -637,6 +638,7 @@ function! LaTeXtoUnicode#Init(...)
call s:L2U_SetTab(wait_insert_enter) call s:L2U_SetTab(wait_insert_enter)
call s:L2U_SetAutoSub(wait_insert_enter) call s:L2U_SetAutoSub(wait_insert_enter)
call s:L2U_SetKeymap() call s:L2U_SetKeymap()
return ''
endfunction endfunction
function! LaTeXtoUnicode#Toggle() function! LaTeXtoUnicode#Toggle()
@@ -648,7 +650,7 @@ function! LaTeXtoUnicode#Toggle()
call LaTeXtoUnicode#Enable() call LaTeXtoUnicode#Enable()
echo "LaTeX-to-Unicode enabled" echo "LaTeX-to-Unicode enabled"
endif endif
return return ''
endfunction endfunction
endif endif

View File

@@ -4,11 +4,13 @@ function! cargo#Load()
" Utility call to get this script loaded, for debugging " Utility call to get this script loaded, for debugging
endfunction endfunction
function! cargo#cmd(args) function! cargo#cmd(args) abort
" Trim trailing spaces. This is necessary since :terminal command parses " Trim trailing spaces. This is necessary since :terminal command parses
" trailing spaces as an empty argument. " trailing spaces as an empty argument.
let args = substitute(a:args, '\s\+$', '', '') let args = substitute(a:args, '\s\+$', '', '')
if has('terminal') if exists('g:cargo_shell_command_runner')
let cmd = g:cargo_shell_command_runner
elseif has('terminal')
let cmd = 'terminal' let cmd = 'terminal'
elseif has('nvim') elseif has('nvim')
let cmd = 'noautocmd new | terminal' let cmd = 'noautocmd new | terminal'
@@ -67,6 +69,10 @@ function! cargo#build(args)
call cargo#cmd("build " . a:args) call cargo#cmd("build " . a:args)
endfunction endfunction
function! cargo#check(args)
call cargo#cmd("check " . a:args)
endfunction
function! cargo#clean(args) function! cargo#clean(args)
call cargo#cmd("clean " . a:args) call cargo#cmd("clean " . a:args)
endfunction endfunction

View File

@@ -7,6 +7,8 @@ let s:V = vital#crystal#new()
let s:P = s:V.import('Process') let s:P = s:V.import('Process')
let s:C = s:V.import('ColorEcho') let s:C = s:V.import('ColorEcho')
let s:IS_WINDOWS = has('win32')
if exists('*json_decode') if exists('*json_decode')
function! s:decode_json(text) abort function! s:decode_json(text) abort
return json_decode(a:text) return json_decode(a:text)
@@ -299,29 +301,47 @@ function! crystal_lang#run_current_spec(...) abort
endfunction endfunction
function! crystal_lang#format_string(code, ...) abort function! crystal_lang#format_string(code, ...) abort
if s:IS_WINDOWS
let redirect = '2> nul'
else
let redirect = '2>/dev/null'
endif
let cmd = printf( let cmd = printf(
\ '%s tool format --no-color %s -', \ '%s tool format --no-color %s - %s',
\ g:crystal_compiler_command, \ g:crystal_compiler_command,
\ get(a:, 1, '') \ get(a:, 1, ''),
\ redirect,
\ ) \ )
let output = s:P.system(cmd, a:code) let output = s:P.system(cmd, a:code)
if s:P.get_last_status() if s:P.get_last_status()
throw 'vim-crystal: Error on formatting: ' . output throw 'vim-crystal: Error on formatting with command: ' . cmd
endif endif
return output return output
endfunction endfunction
" crystal_lang#format(option_str [, on_save]) " crystal_lang#format(option_str [, on_save])
function! crystal_lang#format(option_str, ...) abort function! crystal_lang#format(option_str, ...) abort
if !executable(g:crystal_compiler_command)
" Finish command silently
return
endif
let on_save = a:0 > 0 ? a:1 : 0 let on_save = a:0 > 0 ? a:1 : 0
if !executable(g:crystal_compiler_command)
if on_save
" Finish command silently on save
return
else
throw 'vim-crystal: Command for formatting is not executable: ' . g:crystal_compiler_command
endif
endif
let before = join(getline(1, '$'), "\n") let before = join(getline(1, '$'), "\n")
try
let formatted = crystal_lang#format_string(before, a:option_str) let formatted = crystal_lang#format_string(before, a:option_str)
catch /^vim-crystal: /
echohl ErrorMsg
echomsg v:exception . ': Your code was not formatted. Exception was thrown at ' . v:throwpoint
echohl None
return
endtry
if !on_save if !on_save
let after = substitute(formatted, '\n$', '', '') let after = substitute(formatted, '\n$', '', '')
if before ==# after if before ==# after

View File

@@ -635,8 +635,12 @@ fu! csv#ArrangeCol(first, last, bang, limit, ...) range "{{{3
return return
endif endif
let cur=winsaveview() let cur=winsaveview()
" be sure, that b:col_width is actually valid
if exists("b:col_width") && eval(join(b:col_width, '+')) == 0
unlet! b:col_width
endif
" Force recalculation of Column width " Force recalculation of Column width
let row = exists("a:1") ? a:1 : line('$') let row = exists("a:1") && !empty(a:1) ? a:1 : line('$')
if a:bang || !empty(row) if a:bang || !empty(row)
if a:bang && exists("b:col_width") if a:bang && exists("b:col_width")
" Unarrange, so that if csv_arrange_align has changed " Unarrange, so that if csv_arrange_align has changed

View File

@@ -60,7 +60,10 @@ function! go#config#SetTermCloseOnExit(value) abort
endfunction endfunction
function! go#config#TermEnabled() abort function! go#config#TermEnabled() abort
return has('nvim') && get(g:, 'go_term_enabled', 0) " nvim always support
" vim will support if terminal feature exists
let l:support = has('nvim') || has('terminal')
return support && get(g:, 'go_term_enabled', 0)
endfunction endfunction
function! go#config#SetTermEnabled(value) abort function! go#config#SetTermEnabled(value) abort
@@ -162,23 +165,6 @@ function! go#config#SetGuruScope(scope) abort
endif endif
endfunction endfunction
function! go#config#GocodeUnimportedPackages() abort
return get(g:, 'go_gocode_unimported_packages', 0)
endfunction
let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix'
function! go#config#GocodeSocketType() abort
return get(g:, 'go_gocode_socket_type', s:sock_type)
endfunction
function! go#config#GocodeProposeBuiltins() abort
return get(g:, 'go_gocode_propose_builtins', 1)
endfunction
function! go#config#GocodeProposeSource() abort
return get(g:, 'go_gocode_propose_source', 0)
endfunction
function! go#config#EchoCommandInfo() abort function! go#config#EchoCommandInfo() abort
return get(g:, 'go_echo_command_info', 1) return get(g:, 'go_echo_command_info', 1)
endfunction endfunction
@@ -263,6 +249,10 @@ function! go#config#AddtagsTransform() abort
return get(g:, 'go_addtags_transform', "snakecase") return get(g:, 'go_addtags_transform', "snakecase")
endfunction endfunction
function! go#config#AddtagsSkipUnexported() abort
return get(g:, 'go_addtags_skip_unexported', 0)
endfunction
function! go#config#TemplateAutocreate() abort function! go#config#TemplateAutocreate() abort
return get(g:, "go_template_autocreate", 1) return get(g:, "go_template_autocreate", 1)
endfunction endfunction
@@ -491,6 +481,10 @@ function! go#config#HighlightDebug() abort
return get(g:, 'go_highlight_debug', 1) return get(g:, 'go_highlight_debug', 1)
endfunction endfunction
function! go#config#DebugBreakpointSignText() abort
return get(g:, 'go_debug_breakpoint_sign_text', '>')
endfunction
function! go#config#FoldEnable(...) abort function! go#config#FoldEnable(...) abort
if a:0 > 0 if a:0 > 0
return index(go#config#FoldEnable(), a:1) > -1 return index(go#config#FoldEnable(), a:1) > -1
@@ -516,23 +510,30 @@ function! go#config#ReferrersMode() abort
endfunction endfunction
function! go#config#GoplsCompleteUnimported() abort function! go#config#GoplsCompleteUnimported() abort
return get(g:, 'go_gopls_complete_unimported', 0) return get(g:, 'go_gopls_complete_unimported', v:null)
endfunction endfunction
function! go#config#GoplsDeepCompletion() abort function! go#config#GoplsDeepCompletion() abort
return get(g:, 'go_gopls_deep_completion', 1) return get(g:, 'go_gopls_deep_completion', v:null)
endfunction endfunction
function! go#config#GoplsFuzzyMatching() abort function! go#config#GoplsMatcher() abort
return get(g:, 'go_gopls_fuzzy_matching', 1) if !exists('g:go_gopls_matcher') && get(g:, 'g:go_gopls_fuzzy_matching', v:null) is 1
return 'fuzzy'
endif
return get(g:, 'go_gopls_matcher', v:null)
endfunction endfunction
function! go#config#GoplsStaticCheck() abort function! go#config#GoplsStaticCheck() abort
return get(g:, 'go_gopls_staticcheck', 0) return get(g:, 'go_gopls_staticcheck', v:null)
endfunction endfunction
function! go#config#GoplsUsePlaceholders() abort function! go#config#GoplsUsePlaceholders() abort
return get(g:, 'go_gopls_use_placeholders', 0) return get(g:, 'go_gopls_use_placeholders', v:null)
endfunction
function! go#config#GoplsTempModfile() abort
return get(g:, 'go_gopls_temp_modfile', v:null)
endfunction endfunction
function! go#config#GoplsEnabled() abort function! go#config#GoplsEnabled() abort
@@ -543,6 +544,10 @@ function! go#config#DiagnosticsEnabled() abort
return get(g:, 'go_diagnostics_enabled', 0) return get(g:, 'go_diagnostics_enabled', 0)
endfunction endfunction
function! go#config#GoplsOptions() abort
return get(g:, 'go_gopls_options', [])
endfunction
" Set the default value. A value of "1" is a shortcut for this, for " Set the default value. A value of "1" is a shortcut for this, for
" compatibility reasons. " compatibility reasons.
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1 if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1

View File

@@ -1,30 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
function! julia#set_syntax_version(jvers) function! julia#set_syntax_version(jvers)
if &filetype != "julia" echo "The julia#set_syntax_version function is deprecated"
echo "Not a Julia file"
return
endif
syntax clear
let b:julia_syntax_version = a:jvers
set filetype=julia
endfunction endfunction
function! julia#toggle_deprecated_syntax() function! julia#toggle_deprecated_syntax()
if &filetype != "julia" echo "The julia#toggle_deprecated_syntax function is deprecated"
echo "Not a Julia file"
return
endif
syntax clear
let hd = get(b:, "julia_syntax_highlight_deprecated",
\ get(g:, "julia_syntax_highlight_deprecated", 0))
let b:julia_syntax_highlight_deprecated = hd ? 0 : 1
set filetype=julia
if b:julia_syntax_highlight_deprecated
echo "Highlighting of deprecated syntax enabled"
else
echo "Highlighting of deprecated syntax disabled"
endif
endfunction endfunction
if exists("loaded_matchit") if exists("loaded_matchit")

View File

@@ -1,7 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
" This file is autogenerated from the script 'generate_latex_symbols_table.jl' " This file is autogenerated from the script 'generate_latex_symbols_table.jl'
" The symbols are based on Julia version 1.3.0-DEV.263 " The symbols are based on Julia version 1.5.0-DEV.67
scriptencoding utf-8 scriptencoding utf-8
@@ -658,7 +658,9 @@ function! julia_latex_symbols#get_dict()
\ '\nequiv': '≢', \ '\nequiv': '≢',
\ '\Equiv': '≣', \ '\Equiv': '≣',
\ '\le': '≤', \ '\le': '≤',
\ '\leq': '≤',
\ '\ge': '≥', \ '\ge': '≥',
\ '\geq': '≥',
\ '\leqq': '≦', \ '\leqq': '≦',
\ '\geqq': '≧', \ '\geqq': '≧',
\ '\lneqq': '≨', \ '\lneqq': '≨',

View File

@@ -7,9 +7,6 @@ set cpoptions&vim
let $TF_CLI_ARGS_fmt='' let $TF_CLI_ARGS_fmt=''
function! terraform#fmt() function! terraform#fmt()
if !filereadable(expand('%:p'))
return
endif
let l:curw = winsaveview() let l:curw = winsaveview()
" Make a fake change so that the undo point is right. " Make a fake change so that the undo point is right.
normal! ix normal! ix

80
compiler/powershell.vim Normal file
View File

@@ -0,0 +1,80 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
" Compiler: powershell
" Run ps1 scripts in powershell and process their output. Quickly jump through
" stack traces and see script output in the quickfix.
if exists("current_compiler")
finish
endif
let current_compiler = "powershell"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
if !exists("g:ps1_makeprg_cmd")
if !has('win32') || executable('pwsh')
" pwsh is the future
let g:ps1_makeprg_cmd = 'pwsh'
else
" powershell is Windows-only
let g:ps1_makeprg_cmd = 'powershell'
endif
endif
" Show CategoryInfo, FullyQualifiedErrorId, etc?
let g:ps1_efm_show_error_categories = get(g:, 'ps1_efm_show_error_categories', 0)
" Use absolute path because powershell requires explicit relative paths
" (./file.ps1 is okay, but # expands to file.ps1)
let &l:makeprg = g:ps1_makeprg_cmd .' %:p'
" Parse file, line, char from callstacks:
" Write-Ouput : The term 'Write-Ouput' is not recognized as the name of a
" cmdlet, function, script file, or operable program. Check the spelling
" of the name, or if a path was included, verify that the path is correct
" and try again.
" At C:\script.ps1:11 char:5
" + Write-Ouput $content
" + ~~~~~~~~~~~
" + CategoryInfo : ObjectNotFound: (Write-Ouput:String) [], CommandNotFoundException
" + FullyQualifiedErrorId : CommandNotFoundException
" Showing error in context with underlining.
CompilerSet errorformat=%+G+%m
" Error summary.
CompilerSet errorformat+=%E%*\\S\ :\ %m
" Error location.
CompilerSet errorformat+=%CAt\ %f:%l\ char:%c
" Errors that span multiple lines (may be wrapped to width of terminal).
CompilerSet errorformat+=%C%m
" Ignore blank/whitespace-only lines.
CompilerSet errorformat+=%Z\\s%#
if g:ps1_efm_show_error_categories
CompilerSet errorformat^=%+G\ \ \ \ +\ %.%#\\s%#:\ %m
else
CompilerSet errorformat^=%-G\ \ \ \ +\ %.%#\\s%#:\ %m
endif
" Parse file, line, char from of parse errors:
" At C:\script.ps1:22 char:16
" + Stop-Process -Name "invalidprocess
" + ~~~~~~~~~~~~~~~
" The string is missing the terminator: ".
" + CategoryInfo : ParserError: (:) [], ParseException
" + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
CompilerSet errorformat+=At\ %f:%l\ char:%c
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2:
endif

43
compiler/swift.vim Normal file
View File

@@ -0,0 +1,43 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
" Vim compiler file
" Compiler: Swift Compiler
" Maintainer: Ayman Bagabas <ayman.bagabas@gmail.com>
" Latest Revision: 2020 Feb 16
if exists("current_compiler")
finish
endif
let current_compiler = "swiftc"
" vint: -ProhibitAbbreviationOption
let s:save_cpo = &cpo
set cpo&vim
" vint: +ProhibitAbbreviationOption
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
if has('patch-7.4.191')
CompilerSet makeprg=swiftc\ \%:S
else
CompilerSet makeprg=swiftc\ \%
endif
CompilerSet errorformat=
\%E%f:%l:%c:\ %trror:\ %m,
\%W%f:%l:%c:\ %tarning:\ %m,
\%I%f:%l:%c:\ note:\ %m,
\%E%f:%l:\ %trror:\ %m,
\%W%f:%l:\ %tarning:\ %m,
\%I%f:%l:\ note:\ %m,
" vint: -ProhibitAbbreviationOption
let &cpo = s:save_cpo
unlet s:save_cpo
" vint: +ProhibitAbbreviationOption
" vim: set et sw=4 sts=4 ts=8:
endif

View File

@@ -831,8 +831,10 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
augroup filetypedetect augroup filetypedetect
" mathematica, from mma.vim in voldikss/vim-mma " mathematica, from mma.vim in voldikss/vim-mma
autocmd BufNewFile,BufRead *.wl set filetype=mma autocmd BufNewFile,BufRead *.wl setfiletype mma
autocmd BufNewFile,BufRead *.wls set filetype=mma autocmd BufNewFile,BufRead *.wls setfiletype mma
autocmd BufNewFile,BufRead *.nb setfiletype mma
autocmd BufNewFile,BufRead *.m setfiletype mma
augroup end augroup end
endif endif
@@ -913,7 +915,7 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ocaml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ocaml') == -1
augroup filetypedetect augroup filetypedetect
" ocaml, from dune.vim in rgrinberg/vim-ocaml " ocaml, from dune.vim in rgrinberg/vim-ocaml
au BufRead,BufNewFile jbuild,dune,dune-project set ft=dune au BufRead,BufNewFile jbuild,dune,dune-project,dune-workspace set ft=dune
augroup end augroup end
endif endif

View File

@@ -11,6 +11,4 @@ set lisp
setl commentstring=;\ %s setl commentstring=;\ %s
setl comments=:; setl comments=:;
setl iskeyword+=#,?,.,/
endif endif

View File

@@ -113,7 +113,7 @@ else
if !exists('g:ruby_default_path') if !exists('g:ruby_default_path')
if has("ruby") && has("win32") if has("ruby") && has("win32")
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
elseif executable('ruby') elseif executable('ruby') && !empty($HOME)
let g:ruby_default_path = s:query_path($HOME) let g:ruby_default_path = s:query_path($HOME)
else else
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')

View File

@@ -5,8 +5,23 @@ if exists('b:did_ftplugin')
endif endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal formatoptions=t formatoptions+=croql
" j was only added in 7.3.541, so stop complaints about its nonexistence
" Where it makes sense, remove a comment leader when joining lines.
silent! setlocal formatoptions+=j
setlocal efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m setlocal efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:O//
setlocal commentstring=//%s
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments.
let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
let b:match_skip = 's:comment\|string\|character\|special'
" Insert a CCode attribute for the symbol below the cursor " Insert a CCode attribute for the symbol below the cursor
" https://wiki.gnome.org/Projects/Vala/LegacyBindings " https://wiki.gnome.org/Projects/Vala/LegacyBindings
function! CCode() abort function! CCode() abort
@@ -26,4 +41,11 @@ if get(g:, 'vala_syntax_folding_enabled', 1)
setlocal foldmethod=syntax setlocal foldmethod=syntax
endif endif
" filter files in the browse dialog
if (has("browsefilter")) && !exists("b:browsefilter")
let b:browsefilter = "Vala Source Files (*.vala)\t*.vala\n" .
\ "Vala Vapi Files (*.vapi)\t*.vapi\n" .
\ "All Files (*.*)\t*.*\n"
endif
endif endif

View File

@@ -17,7 +17,7 @@ setlocal nosmartindent
setlocal indentexpr=GetCrystalIndent(v:lnum) setlocal indentexpr=GetCrystalIndent(v:lnum)
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,. setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end
setlocal indentkeys+==private,=protected,=public setlocal indentkeys+==private,=protected
" Only define the function once. " Only define the function once.
if exists('*GetCrystalIndent') if exists('*GetCrystalIndent')
@@ -49,12 +49,12 @@ let s:skip_expr =
" Regex used for words that, at the start of a line, add a level of indent. " Regex used for words that, at the start of a line, add a level of indent.
let s:crystal_indent_keywords = let s:crystal_indent_keywords =
\ '^\s*\zs\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|if' . \ '^\s*\zs\<\%(\%(\%(private\|protected\)\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)' .
\ '\|for\|macro\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|lib' . \ '\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|union' .
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' . \ '\|\%(private\|protected\)\=\s*\%(def\|class\|struct\|module\|macro\|lib\|enum\)\):\@!\>' .
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
\ '\|{%\s*\<\%(if\|for\|while\|until\|lib\|case\|unless\|begin\|else\|elsif\|when\)' \ '\|{%\s*\<\%(if\|for\|while\|until\|case\|unless\|begin\|else\|elsif\|when\)'
" Regex used for words that, at the start of a line, remove a level of indent. " Regex used for words that, at the start of a line, remove a level of indent.
let s:crystal_deindent_keywords = let s:crystal_deindent_keywords =
@@ -64,10 +64,11 @@ let s:crystal_deindent_keywords =
" Regex that defines the start-match for the 'end' keyword. " Regex that defines the start-match for the 'end' keyword.
" TODO: the do here should be restricted somewhat (only at end of line)? " TODO: the do here should be restricted somewhat (only at end of line)?
let s:end_start_regex = let s:end_start_regex =
\ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\|lib\)\>\|' . \ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\)\>\|' .
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|macro\|if\|for\|while\|until\|case\|unless\|begin\|lib' . \ '\<\%(\%(\%(private\|protected\)\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)' .
\ '\|\%(protected\|private\)\=\s*def\):\@!\>' . \ '\|if\|for\|while\|until\|case\|unless\|begin\|union' .
\ '\|\%(private\|protected\)\=\s*\%(def\|lib\|enum\|macro\|module\)\):\@!\>' .
\ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>' \ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword. " Regex that defines the middle-match for the 'end' keyword.
@@ -122,7 +123,7 @@ let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex
let s:leading_operator_regex = '^\s*[.]' let s:leading_operator_regex = '^\s*[.]'
" Regex that describes all indent access modifiers " Regex that describes all indent access modifiers
let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\=$' let s:access_modifier_regex = '\C^\s*\%(protected\|private\)\s*\%(#.*\)\=$'
" 2. Auxiliary Functions {{{1 " 2. Auxiliary Functions {{{1
" ====================== " ======================

View File

@@ -50,9 +50,8 @@ function GetJuliaNestingStruct(lnum, ...)
let e = a:0 > 1 ? a:2 : -1 let e = a:0 > 1 ? a:2 : -1
let blocks_stack = [] let blocks_stack = []
let num_closed_blocks = 0 let num_closed_blocks = 0
let tt = get(b:, 'julia_syntax_version', 10) == 6 ? '\|\%(\%(abstract\|primitive\)\s\+\)\@<!type' : ''
while 1 while 1
let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|\%(bare\)\?module\|quote\|do'.tt.'\)\>', s, e) let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
let fe = JuliaMatch(a:lnum, line, '@\@<!\<end\>', s, e) let fe = JuliaMatch(a:lnum, line, '@\@<!\<end\>', s, e)
if fb < 0 && fe < 0 if fb < 0 && fe < 0
@@ -134,7 +133,7 @@ function GetJuliaNestingStruct(lnum, ...)
continue continue
endif endif
let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|\%(staged\)\?function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|quote\|do'.tt.'\)\>', s) let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|\%(staged\)\?function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|quote\|do\)\>', s)
if i >= 0 && i == fb if i >= 0 && i == fb
if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1 if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1
let s = i+11 let s = i+11

View File

@@ -78,7 +78,7 @@ function! s:is_string_comment(lnum, col)
if has('syntax_items') if has('syntax_items')
for id in synstack(a:lnum, a:col) for id in synstack(a:lnum, a:col)
let synname = synIDattr(id, "name") let synname = synIDattr(id, "name")
if synname == "rustString" || synname =~ "^rustComment" if synname == "reasonString" || synname =~ "^reasonComment"
return 1 return 1
endif endif
endfor endfor
@@ -97,7 +97,7 @@ function GetReasonIndent(lnum)
if has('syntax_items') if has('syntax_items')
let synname = synIDattr(synID(a:lnum, 1, 1), "name") let synname = synIDattr(synID(a:lnum, 1, 1), "name")
if synname == "rustString" if synname == "reasonString"
" If the start of the line is in a string, don't change the indent " If the start of the line is in a string, don't change the indent
return -1 return -1
elseif synname =~ '\(Comment\|Todo\)' elseif synname =~ '\(Comment\|Todo\)'

View File

@@ -20,7 +20,7 @@ syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x
" From vim runtime " From vim runtime
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48> " <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}]+me=e-1 nextgroup=typescriptDotNotation oneline syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimuy]\{0,5\}\s*$+ end=+/[gimuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline
syntax region typescriptTemplate syntax region typescriptTemplate
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/ \ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/

View File

@@ -86,7 +86,7 @@ syntax region typescriptObjectType matchgroup=typescriptBraces
\ start=/{/ end=/}/ \ start=/{/ end=/}/
\ contains=@typescriptTypeMember,typescriptEndColons,@typescriptComments,typescriptAccessibilityModifier,typescriptReadonlyModifier \ contains=@typescriptTypeMember,typescriptEndColons,@typescriptComments,typescriptAccessibilityModifier,typescriptReadonlyModifier
\ nextgroup=@typescriptTypeOperator \ nextgroup=@typescriptTypeOperator
\ contained skipwhite fold \ contained skipwhite skipnl fold
syntax cluster typescriptTypeMember contains= syntax cluster typescriptTypeMember contains=
\ @typescriptCallSignature, \ @typescriptCallSignature,

View File

@@ -39,7 +39,7 @@ syn keyword carpFunc println print get-line from-string mod random
syn keyword carpFunc random-between str mask delete append length duplicate syn keyword carpFunc random-between str mask delete append length duplicate
syn keyword carpFunc cstr chars from-chars to-int from-int sin cos sqrt acos syn keyword carpFunc cstr chars from-chars to-int from-int sin cos sqrt acos
syn keyword carpFunc atan2 exit time seed-random for cond floor abs sort-with syn keyword carpFunc atan2 exit time seed-random for cond floor abs sort-with
syn keyword carpFunc subarray prefix-array suffix-array reverse sum min max syn keyword carpFunc slice prefix suffix reverse sum min max
syn keyword carpFunc first last reduce format zero read-file bit-shift-left syn keyword carpFunc first last reduce format zero read-file bit-shift-left
syn keyword carpFunc bit-shift-right bit-and bit-or bit-xor bit-not safe-add syn keyword carpFunc bit-shift-right bit-and bit-or bit-xor bit-not safe-add
syn keyword carpFunc safe-sub safe-mul even? odd? cmp allocate repeat-indexed syn keyword carpFunc safe-sub safe-mul even? odd? cmp allocate repeat-indexed
@@ -47,8 +47,8 @@ syn keyword carpFunc sanitize-addresses memory-balance reset-memory-balance!
syn keyword carpFunc log-memory-balance! memory-logged assert-balanced trace syn keyword carpFunc log-memory-balance! memory-logged assert-balanced trace
syn keyword carpFunc assert syn keyword carpFunc assert
syn keyword carpFunc pi e swap! update! char-at tail head split-by words lines syn keyword carpFunc pi e swap! update! char-at tail head split-by words lines
syn keyword carpFunc pad-left pad-right count-char empty? random-sized substring syn keyword carpFunc pad-left pad-right count-char empty? random-sized
syn keyword carpFunc prefix-string suffix-string starts-with? ends-with? syn keyword carpFunc starts-with? ends-with?
syn keyword carpFunc string-join free sleep-seconds sleep-micros substitute syn keyword carpFunc string-join free sleep-seconds sleep-micros substitute
syn keyword carpFunc neg to-float match matches? find global-match match-str syn keyword carpFunc neg to-float match matches? find global-match match-str
syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp syn keyword carpFunc from-float tan asin atan cosh sinh tanh exp frexp ldexp
@@ -111,7 +111,7 @@ syn match carpNumber "\<[-+]\?\d\+/\d\+[lfb]\?\>" contains=carpContainedNumbe
syn keyword carpBoolean true false syn keyword carpBoolean true false
syn match carpChar "\<\\.\w\@!" syn match carpChar "\\\(\(newline\)\|\(space\)\|\(tab\)\|\(.\)\)"
syn region carpQuoted matchgroup=Delimiter start="['`]" end=![ \t()\[\]";]!me=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal syn region carpQuoted matchgroup=Delimiter start="['`]" end=![ \t()\[\]";]!me=e-1 contains=@carpQuotedStuff,@carpQuotedOrNormal
syn region carpQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=@carpQuotedStuff,@carpQuotedOrNormal syn region carpQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=@carpQuotedStuff,@carpQuotedOrNormal

View File

@@ -1,16 +1,67 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
" Language: Crystal " Language: Crystal
" Maintainer: rhysd <https://rhysd.github.io>
"
" Based on Ruby syntax highlight " Based on Ruby syntax highlight
" which was made by Mirko Nasato and Doug Kearns " which was made by Mirko Nasato and Doug Kearns
" --------------------------------------------- " ----------------------------------------------
" Prelude
if exists('b:current_syntax') if exists('b:current_syntax')
finish finish
endif endif
" eCrystal Config
if exists('g:main_syntax') && g:main_syntax ==# 'ecrystal'
let b:crystal_no_expensive = 1
end
" Folding Config
if has('folding') && exists('g:crystal_fold')
setlocal foldmethod=syntax
endif
let s:foldable_groups = split(
\ get(
\ b:,
\ 'crystal_foldable_groups',
\ get(g:, 'crystal_foldable_groups', 'ALL')
\ )
\ )
function! s:foldable(...) abort
if index(s:foldable_groups, 'NONE') > -1
return 0
endif
if index(s:foldable_groups, 'ALL') > -1
return 1
endif
for l:i in a:000
if index(s:foldable_groups, l:i) > -1
return 1
endif
endfor
return 0
endfunction
function! s:run_syntax_fold(args) abort
let [_0, _1, groups, cmd; _] = matchlist(a:args, '\(["'']\)\(.\{-}\)\1\s\+\(.*\)')
if call('s:foldable', split(groups))
let cmd .= ' fold'
endif
exe cmd
endfunction
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
" Not-Top Cluster
syn cluster crystalNotTop contains=@crystalExtendedStringSpecial,@crystalRegexpSpecial,@crystalDeclaration,crystalConditional,crystalExceptional,crystalMethodExceptional,crystalTodo,crystalLinkAttr syn cluster crystalNotTop contains=@crystalExtendedStringSpecial,@crystalRegexpSpecial,@crystalDeclaration,crystalConditional,crystalExceptional,crystalMethodExceptional,crystalTodo,crystalLinkAttr
" Whitespace Errors
if exists('g:crystal_space_errors') if exists('g:crystal_space_errors')
if !exists('g:crystal_no_trail_space_error') if !exists('g:crystal_no_trail_space_error')
syn match crystalSpaceError display excludenl "\s\+$" syn match crystalSpaceError display excludenl "\s\+$"
@@ -43,10 +94,10 @@ syn match crystalNoInterpolation "\\#\$\W" display contained
syn match crystalDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE syn match crystalDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
syn region crystalNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=crystalString end=")" transparent contained syn region crystalNestedParentheses matchgroup=crystalString start="(" skip="\\\\\|\\)" end=")" transparent contained
syn region crystalNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=crystalString end="}" transparent contained syn region crystalNestedCurlyBraces matchgroup=crystalString start="{" skip="\\\\\|\\}" end="}" transparent contained
syn region crystalNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=crystalString end=">" transparent contained syn region crystalNestedAngleBrackets matchgroup=crystalString start="<" skip="\\\\\|\\>" end=">" transparent contained
syn region crystalNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=crystalString end="\]" transparent contained syn region crystalNestedSquareBrackets matchgroup=crystalString start="\[" skip="\\\\\|\\\]" end="\]" transparent contained
" These are mostly Oniguruma ready " These are mostly Oniguruma ready
syn region crystalRegexpComment matchgroup=crystalRegexpSpecial start="(?#" skip="\\)" end=")" contained syn region crystalRegexpComment matchgroup=crystalRegexpSpecial start="(?#" skip="\\)" end=")" contained
@@ -67,17 +118,19 @@ syn match crystalRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
syn match crystalRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display syn match crystalRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
syn cluster crystalStringSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape syn cluster crystalStringSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape
syn cluster crystalExtendedStringSpecial contains=@crystalStringSpecial,crystalNestedParentheses,crystalNestedCurlyBraces,crystalNestedAngleBrackets,crystalNestedSquareBrackets syn cluster crystalExtendedStringSpecial contains=@crystalStringSpecial,crystalNestedParentheses,crystalNestedCurlyBraces,crystalNestedAngleBrackets,crystalNestedSquareBrackets,crystalNestedRawParentheses,crystalNestedRawCurlyBraces,crystalNestedRawAngleBrackets,crystalNestedRawSquareBrackets
syn cluster crystalRegexpSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape,crystalRegexpSpecial,crystalRegexpEscape,crystalRegexpBrackets,crystalRegexpCharClass,crystalRegexpDot,crystalRegexpQuantifier,crystalRegexpAnchor,crystalRegexpParens,crystalRegexpComment syn cluster crystalRegexpSpecial contains=crystalInterpolation,crystalNoInterpolation,crystalStringEscape,crystalRegexpSpecial,crystalRegexpEscape,crystalRegexpBrackets,crystalRegexpCharClass,crystalRegexpDot,crystalRegexpQuantifier,crystalRegexpAnchor,crystalRegexpParens,crystalRegexpComment
" Numbers and ASCII Codes " Numbers and ASCII Codes
syn match crystalASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)" syn match crystalASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
syn match crystalInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\%(_*[ufi]\%(32\|64\)\)\=\>" display syn match crystalInteger "\<0x[[:xdigit:]_]\+\%([ui]\%(8\|16\|32\|64\|128\)\|f\%(32\|64\)\)\=\>" display
syn match crystalInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(_\x\+\)*\%(_*[ufi]\%(32\|64\)\)\=\>" display syn match crystalInteger "\<0o[0-7_]\+\%([ui]\%(8\|16\|32\|64\|128\)\)\=\>" display
syn match crystalInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\%(_\x\+\)*\%(_*[ufi]\%(32\|64\)\)\=\>" display syn match crystalInteger "\<0b[01_]\+\%([ui]\%(8\|16\|32\|64\|128\)\)\=\>" display
syn match crystalInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*\%(_\x\+\)*\%(_*[ufi]\%(32\|64\)\)\=\>" display syn match crystalInteger "\<\d[[:digit:]_]*\%([ui]\%(8\|16\|32\|64\|128\)\|f\%(32\|64\)\)\=\>" contains=crystalInvalidInteger display
syn match crystalFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\%(_*f\%(32\|64\)\)\=\>" display syn match crystalFloat "\<\d[[:digit:]_]*\.\d[[:digit:]_]*\%(f\%(32\|64\)\)\=\>" contains=crystalInvalidInteger display
syn match crystalFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\%(_*f\%(32\|64\)\)\=\>" display syn match crystalFloat "\<\d[[:digit:]_]*\%(\.\d[[:digit:]_]*\)\=\%([eE][-+]\=[[:digit:]_]\+\)\%(f\%(32\|64\)\)\=\>" contains=crystalInvalidInteger display
" Note: 042 is invalid but 0, 0_, 0_u8 and 0_1 are valid (#73)
syn match crystalInvalidInteger "\.\@<!\<0\d\+\>" contained containedin=crystalFloat,crystalInteger display
" Identifiers " Identifiers
syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
@@ -102,7 +155,8 @@ syn match crystalSymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
syn match crystalSymbol "[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="he=e-1 syn match crystalSymbol "[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="he=e-1
syn match crystalSymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1 syn match crystalSymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
syn match crystalSymbol "[[:space:],{]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="hs=s+1,he=e-1 syn match crystalSymbol "[[:space:],{]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:\s\@="hs=s+1,he=e-1
syn region crystalSymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@crystalStringSpecial fold
SynFold ':' syn region crystalSymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@crystalStringSpecial
syn match crystalBlockParameter "\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" contained syn match crystalBlockParameter "\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" contained
syn region crystalBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=crystalBlockParameter syn region crystalBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=crystalBlockParameter
@@ -120,45 +174,53 @@ syn match crystalPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(STDERR\
syn match crystalPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(crystal_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!" syn match crystalPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(crystal_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
" Normal Regular Expression " Normal Regular Expression
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|ifdef\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial fold SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|ifdef\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=/]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial fold SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=/]\@!" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
" Generalized Regular Expression " Generalized Regular Expression
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@crystalRegexpSpecial fold SynFold '%' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r{" end="}[imx]*" skip="\\\\\|\\}" contains=@crystalRegexpSpecial
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@crystalRegexpSpecial fold SynFold '%' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r<" end=">[imx]*" skip="\\\\\|\\>" contains=@crystalRegexpSpecial,crystalNestedAngleBrackets,crystalDelimEscape
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@crystalRegexpSpecial,crystalNestedAngleBrackets,crystalDelimEscape fold SynFold '%' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r\[" end="\][imx]*" skip="\\\\\|\\\]" contains=@crystalRegexpSpecial
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@crystalRegexpSpecial fold SynFold '%' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r(" end=")[imx]*" skip="\\\\\|\\)" contains=@crystalRegexpSpecial
syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@crystalRegexpSpecial fold SynFold '%' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="%r|" end="|[imx]*" skip="\\\\\|\\|" contains=@crystalRegexpSpecial
" Normal String and Shell Command Output " Normal String
syn region crystalString matchgroup=crystalStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@crystalStringSpecial,@Spell fold let s:spell_cluster = exists('crystal_spellcheck_strings') ? ',@Spell' : ''
syn region crystalString matchgroup=crystalStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@crystalStringSpecial fold let s:fold_arg = s:foldable('string') ? ' fold' : ''
exe 'syn region crystalString matchgroup=crystalStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@crystalStringSpecial' . s:spell_cluster . s:fold_arg
unlet s:spell_cluster s:fold_arg
" Shell Command Output
SynFold 'string' syn region crystalString matchgroup=crystalStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@crystalStringSpecial
" Character " Character
syn match crystalCharLiteral "'\%([^\\]\|\\[abefnrstv'\\]\|\\\o\{1,3}\|\\x\x\{1,2}\|\\u\x\{4}\)'" contains=crystalStringEscape display syn match crystalCharLiteral "'\%([^\\]\|\\[abefnrstv'\\]\|\\\o\{1,3}\|\\x\x\{1,2}\|\\u\x\{4}\)'" contains=crystalStringEscape display
" Generalized Single Quoted String, Symbol and Array of Strings " Generalized Single Quoted String, Symbol and Array of Strings
syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold syn region crystalNestedRawParentheses matchgroup=crystalString start="(" end=")" transparent contained
syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi]{" end="}" skip="\\\\\|\\}" fold contains=crystalNestedCurlyBraces,crystalDelimEscape syn region crystalNestedRawCurlyBraces matchgroup=crystalString start="{" end="}" transparent contained
syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi]<" end=">" skip="\\\\\|\\>" fold contains=crystalNestedAngleBrackets,crystalDelimEscape syn region crystalNestedRawAngleBrackets matchgroup=crystalString start="<" end=">" transparent contained
syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi]\[" end="\]" skip="\\\\\|\\\]" fold contains=crystalNestedSquareBrackets,crystalDelimEscape syn region crystalNestedRawSquareBrackets matchgroup=crystalString start="\[" end="\]" transparent contained
syn region crystalString matchgroup=crystalStringDelimiter start="%[qwi](" end=")" skip="\\\\\|\\)" fold contains=crystalNestedParentheses,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%q(" end=")" contains=crystalNestedRawParentheses
syn region crystalSymbol matchgroup=crystalSymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%q{" end="}" contains=crystalNestedRawCurlyBraces
syn region crystalSymbol matchgroup=crystalSymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=crystalNestedCurlyBraces,crystalDelimEscape SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%q<" end=">" contains=crystalNestedRawAngleBrackets
syn region crystalSymbol matchgroup=crystalSymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=crystalNestedAngleBrackets,crystalDelimEscape SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%q\[" end="\]" contains=crystalNestedRawSquareBrackets
syn region crystalSymbol matchgroup=crystalSymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=crystalNestedSquareBrackets,crystalDelimEscape SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%q|" end="|"
syn region crystalSymbol matchgroup=crystalSymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=crystalNestedParentheses,crystalDelimEscape
SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[wi](" end=")" skip="\\\\\|\\)" contains=crystalNestedParentheses,crystalDelimEscape
SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[wi]{" end="}" skip="\\\\\|\\}" contains=crystalNestedCurlyBraces,crystalDelimEscape
SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[wi]<" end=">" skip="\\\\\|\\>" contains=crystalNestedAngleBrackets,crystalDelimEscape
SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[wi]\[" end="\]" skip="\\\\\|\\\]" contains=crystalNestedSquareBrackets,crystalDelimEscape
SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[wi]|" end="|" skip="\\\\\|\\|" contains=crystalDelimEscape
" Generalized Double Quoted String and Array of Strings and Shell Command Output " Generalized Double Quoted String and Array of Strings and Shell Command Output
" Note: %= is not matched here as the beginning of a double quoted string " Note: %= is not matched here as the beginning of a double quoted string
syn region crystalString matchgroup=crystalStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@crystalStringSpecial fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx]\=(" end=")" skip="\\\\\|\\)" contains=@crystalStringSpecial,crystalNestedParentheses,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@crystalStringSpecial fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx]\={" end="}" skip="\\\\\|\\}" contains=@crystalStringSpecial,crystalNestedCurlyBraces,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%[QWIx]\={" end="}" skip="\\\\\|\\}" contains=@crystalStringSpecial,crystalNestedCurlyBraces,crystalDelimEscape fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx]\=<" end=">" skip="\\\\\|\\>" contains=@crystalStringSpecial,crystalNestedAngleBrackets,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%[QWIx]\=<" end=">" skip="\\\\\|\\>" contains=@crystalStringSpecial,crystalNestedAngleBrackets,crystalDelimEscape fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@crystalStringSpecial,crystalNestedSquareBrackets,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%[QWIx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@crystalStringSpecial,crystalNestedSquareBrackets,crystalDelimEscape fold SynFold '%' syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx]\=|" end="|" skip="\\\\\|\\|" contains=@crystalStringSpecial,crystalDelimEscape
syn region crystalString matchgroup=crystalStringDelimiter start="%[QWIx]\=(" end=")" skip="\\\\\|\\)" contains=@crystalStringSpecial,crystalNestedParentheses,crystalDelimEscape fold
syn region crystalString matchgroup=crystalStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@crystalStringSpecial fold
" Here Document " Here Document
syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@crystalNotTop syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@crystalNotTop
@@ -166,20 +228,17 @@ syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(cl
syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@crystalNotTop syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@crystalNotTop
syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@crystalNotTop syn region crystalHeredocStart matchgroup=crystalStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@crystalNotTop
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+2 matchgroup=crystalStringDelimiter end=+^\z1$+ contains=crystalHeredocStart,crystalHeredoc,@crystalStringSpecial keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-"\z([^"]*\)"\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial keepend
if exists('g:main_syntax') && g:main_syntax ==# 'ecrystal'
let b:crystal_no_expensive = 1
end
" Module, Class, Method, and Alias Declarations
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
@@ -221,27 +280,28 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration skipwhite skipnl syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration skipwhite skipnl
syn match crystalEnum "\<enum\>" nextgroup=crystalEnumDeclaration skipwhite skipnl syn match crystalEnum "\<enum\>" nextgroup=crystalEnumDeclaration skipwhite skipnl
syn region crystalMethodBlock start="\<\%(def\|macro\)\>" matchgroup=crystalDefine end="\%(\<\%(def\|macro\)\_s\+\)\@<!\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'def' syn region crystalMethodBlock start="\<\%(def\|macro\)\>" matchgroup=crystalDefine end="\%(\<\%(def\|macro\)\_s\+\)\@<!\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalBlock start="\<class\>" matchgroup=crystalClass end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'class' syn region crystalBlock start="\<class\>" matchgroup=crystalClass end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalBlock start="\<module\>" matchgroup=crystalModule end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'module' syn region crystalBlock start="\<module\>" matchgroup=crystalModule end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalBlock start="\<struct\>" matchgroup=crystalStruct end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'struct' syn region crystalBlock start="\<struct\>" matchgroup=crystalStruct end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalBlock start="\<lib\>" matchgroup=crystalLib end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'lib' syn region crystalBlock start="\<lib\>" matchgroup=crystalLib end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalBlock start="\<enum\>" matchgroup=crystalEnum end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'enum' syn region crystalBlock start="\<enum\>" matchgroup=crystalEnum end="\<end\>" contains=ALLBUT,@crystalNotTop
" modifiers " modifiers
syn match crystalConditionalModifier "\<\%(if\|unless\|ifdef\)\>" display syn match crystalConditionalModifier "\<\%(if\|unless\|ifdef\)\>" display
syn match crystalRepeatModifier "\<\%(while\|until\)\>" display syn match crystalRepeatModifier "\<\%(while\|until\)\>" display
syn region crystalDoBlock matchgroup=crystalControl start="\<do\>" end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'do' syn region crystalDoBlock matchgroup=crystalControl start="\<do\>" end="\<end\>" contains=ALLBUT,@crystalNotTop
" curly bracket block or hash literal " curly bracket block or hash literal
syn region crystalCurlyBlock matchgroup=crystalCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@crystalNotTop fold SynFold '{' syn region crystalCurlyBlock matchgroup=crystalCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@crystalNotTop
syn region crystalArrayLiteral matchgroup=crystalArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@crystalNotTop fold SynFold '[' syn region crystalArrayLiteral matchgroup=crystalArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@crystalNotTop
" statements without 'do' " statements without 'do'
syn region crystalBlockExpression matchgroup=crystalControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'begin' syn region crystalBlockExpression matchgroup=crystalControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalCaseExpression matchgroup=crystalConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'case' syn region crystalCaseExpression matchgroup=crystalConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalSelectExpression matchgroup=crystalConditional start="\<select\>" end="\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'select' syn region crystalSelectExpression matchgroup=crystalConditional start="\<select\>" end="\<end\>" contains=ALLBUT,@crystalNotTop
syn region crystalConditionalExpression matchgroup=crystalConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|ifdef\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@crystalNotTop fold SynFold 'if' syn region crystalConditionalExpression matchgroup=crystalConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|ifdef\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@crystalNotTop
syn match crystalConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=crystalCaseExpression syn match crystalConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=crystalCaseExpression
syn match crystalConditional "\<\%(when\|else\)\>[?!]\@!" contained containedin=crystalSelectExpression syn match crystalConditional "\<\%(when\|else\)\>[?!]\@!" contained containedin=crystalSelectExpression
@@ -252,7 +312,8 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
" statements with optional 'do' " statements with optional 'do'
syn region crystalOptionalDoLine matchgroup=crystalRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@crystalNotTop syn region crystalOptionalDoLine matchgroup=crystalRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@crystalNotTop
syn region crystalRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalRepeat end="\<end\>" contains=ALLBUT,@crystalNotTop nextgroup=crystalOptionalDoLine fold
SynFold 'for' syn region crystalRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalRepeat end="\<end\>" contains=ALLBUT,@crystalNotTop nextgroup=crystalOptionalDoLine
if !exists('g:crystal_minlines') if !exists('g:crystal_minlines')
let g:crystal_minlines = 500 let g:crystal_minlines = 500
@@ -260,6 +321,7 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
exec 'syn sync minlines=' . g:crystal_minlines exec 'syn sync minlines=' . g:crystal_minlines
else else
" Non-expensive mode
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl
syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl
@@ -294,17 +356,16 @@ if !exists('g:crystal_no_special_methods')
endif endif
" Macro " Macro
syn region crystalMacroRegion start="{%" end="%}" contains=ALLBUT,@crystalNotTop transparent display oneline " Note: This definition must be put after crystalNestedCurlyBraces to give higher priority
syn region crystalMacroRegion start="{{" end="}}" contains=ALLBUT,@crystalNotTop transparent display oneline syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={%" end="%}" oneline display contains=ALLBUT,@crystalNotTop containedin=ALL
syn match crystalMacro "\%({%\|%}\|{{\|}}\)" nextgroup=crystalMacroRegion skipwhite display syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={{" end="}}" oneline display contains=ALLBUT,@crystalNotTop containedin=ALL
" Comments and Documentation " Comments and Documentation
syn match crystalSharpBang "\%^#!.*" display syn match crystalSharpBang "\%^#!.*" display
syn keyword crystalTodo FIXME NOTE TODO OPTIMIZE XXX todo contained syn keyword crystalTodo FIXME NOTE TODO OPTIMIZE XXX todo contained
syn match crystalComment "#.*" contains=crystalSharpBang,crystalSpaceError,crystalTodo,@Spell syn match crystalComment "#.*" contains=crystalSharpBang,crystalSpaceError,crystalTodo,@Spell
if !exists('g:crystal_no_comment_fold')
syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=crystalComment transparent fold keepend SynFold '#' syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=crystalComment transparent keepend
endif
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver " Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\|select\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\|select\)\>" transparent contains=NONE
@@ -325,7 +386,6 @@ hi def link crystalClass crystalDefine
hi def link crystalModule crystalDefine hi def link crystalModule crystalDefine
hi def link crystalStruct crystalDefine hi def link crystalStruct crystalDefine
hi def link crystalLib crystalDefine hi def link crystalLib crystalDefine
hi def link crystalMacro crystalDefine
hi def link crystalEnum crystalDefine hi def link crystalEnum crystalDefine
hi def link crystalMethodExceptional crystalDefine hi def link crystalMethodExceptional crystalDefine
hi def link crystalDefine Define hi def link crystalDefine Define
@@ -391,13 +451,17 @@ hi def link crystalRegexpSpecial Special
hi def link crystalRegexpComment Comment hi def link crystalRegexpComment Comment
hi def link crystalRegexp crystalString hi def link crystalRegexp crystalString
hi def link crystalMacro PreProc hi def link crystalMacro PreProc
hi def link crystalMacroDelim crystalMacro
hi def link crystalLinkAttr crystalMacro hi def link crystalLinkAttr crystalMacro
hi def link crystalError Error hi def link crystalError Error
hi def link crystalInvalidVariable crystalError hi def link crystalInvalidVariable crystalError
hi def link crystalSpaceError crystalError hi def link crystalSpaceError crystalError
hi def link crystalInvalidInteger crystalError
let b:current_syntax = 'crystal' let b:current_syntax = 'crystal'
" vim: nowrap sw=2 sts=2 ts=8 noet: delc SynFold
" vim: nowrap sw=2 sts=2:
endif endif

View File

@@ -20,7 +20,7 @@ syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable
syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|after\|rescue\|catch\|else\|quote\|unquote\|super\|unquote_splicing\)\>:\@!' syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|after\|raise\|rescue\|catch\|else\|quote\|unquote\|super\|unquote_splicing\)\>:\@!'
syn keyword elixirInclude import require alias use syn keyword elixirInclude import require alias use

View File

@@ -25,24 +25,6 @@ endif
scriptencoding utf-8 scriptencoding utf-8
if !exists("b:julia_syntax_version")
let b:julia_syntax_version = get(g:, "default_julia_version", "current")
endif
if !exists("b:julia_syntax_highlight_deprecated")
let b:julia_syntax_highlight_deprecated = get(g:, "julia_syntax_highlight_deprecated", 0)
endif
if b:julia_syntax_version =~? '\<\%(curr\%(ent\)\?\|release\|7\|0\.7\|10\|1.0\)\>'
let b:julia_syntax_version = 10
elseif b:julia_syntax_version =~? '\<\%(next\|devel\|11\|1\.1\)\>'
let b:julia_syntax_version = 11
elseif b:julia_syntax_version =~? '\<\%(prev\%(ious\)\?\|legacy\|6\|0\.6\)\>'
let b:julia_syntax_version = 6
else
echohl WarningMsg | echomsg "Unrecognized or unsupported julia syntax version: " . b:julia_syntax_version | echohl None
let b:julia_syntax_version = 10
endif
let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0) let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0)
let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1) let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1)
let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1) let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1)
@@ -97,23 +79,9 @@ syntax cluster juliaExprsPrintf contains=@juliaExpressions,@juliaPrintfItems
syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaInfixKeyword,juliaRepKeyword,juliaTypedef syntax cluster juliaKeywordItems contains=juliaKeyword,juliaInfixKeyword,juliaRepKeyword,juliaTypedef
syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
if b:julia_syntax_version == 6 syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems06
else
syntax cluster juliaTypesItems contains=@juliaTypesItemsAll,@juliaTypesItems06,@juliaTypesItems1011
endif
syntax cluster juliaTypesItemsAll contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
syntax cluster juliaTypesItems06 contains=juliaBaseTypeNum06,juliaBaseTypeRange06,juliaBaseTypeDict06,juliaBaseTypeSet06
syntax cluster juliaTypesItems1011 contains=juliaBaseTypeBasic1011,juliaBaseTypeNum1011,juliaBaseTypeError1011,juliaBaseTypeIter1011,juliaBaseTypeRange1011,juliaBaseTypeArray1011,juliaBaseTypeDict1011,juliaBaseTypeSet1011,juliaBaseTypeC1011,juliaBaseTypeDisplay1011,juliaBaseTypeIO1011,juliaBaseTypeString1011
syntax cluster juliaConstItemsAll contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric syntax cluster juliaConstItems contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
syntax cluster juliaConstItems06 contains=juliaConstNum06,juliaConstIO06
syntax cluster juliaConstItems1011 contains=juliaConstGeneric1011,juliaPossibleEuler,juliaConstEnv1011,juliaConstIO1011
if b:julia_syntax_version == 6
syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems06
else
syntax cluster juliaConstItems contains=@juliaConstItemsAll,@juliaConstItems06,@juliaConstItems1011
endif
syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
syntax cluster juliaSymbolItems contains=juliaPossibleSymbol syntax cluster juliaSymbolItems contains=juliaPossibleSymbol
@@ -172,10 +140,6 @@ exec 'syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="'.s:nodot
exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<function\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<function\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<macro\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<macro\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<quote\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<quote\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
if b:julia_syntax_version <= 10
exec 'syntax region juliaTypeBlock matchgroup=juliaBlKeyword06 start="'.s:nodot.'\<type\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaImmutableBlock matchgroup=juliaBlKeyword06 start="'.s:nodot.'\<immutable\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
endif
exec 'syntax region juliaStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<mutable struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<mutable struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaLetBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<let\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold' exec 'syntax region juliaLetBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<let\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
@@ -194,47 +158,29 @@ exec 'syntax match juliaComprehensionIf contained "'.s:nodot.'\<if\>"'
exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"' exec 'syntax match juliaOuter contained "\<outer\ze\s\+' . s:idregex . '\>"'
syntax match juliaBaseTypeBasic display "\<\%(Tuple\|NTuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\)\>" syntax match juliaBaseTypeBasic display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>"
syntax match juliaBaseTypeBasic06 display "\<\%(Void\|\%(Label\|Goto\)Node\|Associative\|MethodTable\|Nullable\|TypeMap\%(Level\|Entry\)\|CodeInfo\)\>" syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>"
syntax match juliaBaseTypeBasic1011 display "\<\%(Nothing\|Some\|Missing\|NamedTuple\)\>" syntax match juliaBaseTypeC display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>"
syntax match juliaBaseTypeNum display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|Irrational\|Enum\|BigInt\|BigFloat\|MathConst\)\>" syntax match juliaBaseTypeError display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>"
syntax match juliaBaseTypeNum06 display "\<Complex\%(32\|64\|128\)\>" syntax match juliaBaseTypeIter display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>"
syntax match juliaBaseTypeNum1011 display "\<\%(AbstractIrrational\|ComplexF\%(16\|32\|64\)\)\>" syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>"
syntax match juliaBaseTypeC display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\)\)\>" syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
syntax match juliaBaseTypeC1011 display "\<Cvoid\>" syntax match juliaBaseTypeDict display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>"
syntax match juliaBaseTypeError display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|Unicode\|ReadOnlyMemory\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Null\|Remote\)Exception\|DimensionMismatch\|SegmentationFault\)\>" syntax match juliaBaseTypeSet display "\<\%(\%(Abstract\|Bit\)\?Set\)\>"
syntax match juliaBaseTypeError1011 display "\<\%(StringIndexError\|MissingException\)\>" syntax match juliaBaseTypeIO display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>"
syntax match juliaBaseTypeIter display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\)\>"
syntax match juliaBaseTypeIter1011 display "\<CartesianIndices\>"
syntax match juliaBaseTypeString display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\)\?String\>"
syntax match juliaBaseTypeString1011 display "\<SubstitutionString\>"
syntax match juliaBaseTypeArray display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|SparseVector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|RowVector\)\>"
syntax match juliaBaseTypeArray1011 display "\<\%(Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
syntax match juliaBaseTypeDict display "\<\%(WeakKey\)\?Dict\>"
syntax match juliaBaseTypeDict06 display "\<ObjectIdDict\>"
syntax match juliaBaseTypeDict1011 display "\<IdDict\>"
syntax match juliaBaseTypeSet display "\<\%(Set\|AbstractSet\)\>"
syntax match juliaBaseTypeSet06 display "\<IntSet\>"
syntax match juliaBaseTypeSet1011 display "\<\%(BitSet\|AbstractDict\)\>"
syntax match juliaBaseTypeIO display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\)\>"
syntax match juliaBaseTypeIO1011 display "\<GenericIOBuffer\>"
syntax match juliaBaseTypeProcess display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>" syntax match juliaBaseTypeProcess display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>"
syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>" syntax match juliaBaseTypeRange display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>"
syntax match juliaBaseTypeRange06 display "\<Range\>"
syntax match juliaBaseTypeRange1011 display "\<\(Abstract\|Lin\)Range\>"
syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>" syntax match juliaBaseTypeRegex display "\<Regex\%(Match\)\?\>"
syntax match juliaBaseTypeFact display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>" syntax match juliaBaseTypeFact display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>" syntax match juliaBaseTypeSort display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
syntax match juliaBaseTypeRound display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>" syntax match juliaBaseTypeRound display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>" syntax match juliaBaseTypeSpecial display "\<\%(LocalProcess\|ClusterManager\)\>"
syntax match juliaBaseTypeRandom display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>" syntax match juliaBaseTypeRandom display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>"
syntax match juliaBaseTypeDisplay display "\<\%(Text\(Display\)\?\|Display\|MIME\|HTML\)\>" syntax match juliaBaseTypeDisplay display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>"
syntax match juliaBaseTypeDisplay1011 display "\<AbstractDisplay\>"
syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\|DateFormat\)\>" syntax match juliaBaseTypeTime display "\<\%(Date\%(Time\)\?\|DateFormat\)\>"
syntax match juliaBaseTypeOther display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>" syntax match juliaBaseTypeOther display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>"
syntax match juliaConstNum display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)" syntax match juliaConstNum display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)"
syntax match juliaConstNum06 display "\%(\<\%(eu\?\|eulergamma\|γ\|catalan\|φ\|golden\)\>\)"
" Note: recognition of , which Vim does not consider a valid identifier, is " Note: recognition of , which Vim does not consider a valid identifier, is
" complicated. We detect possible uses by just looking for the character (for " complicated. We detect possible uses by just looking for the character (for
" performance) and then check that it's actually used by its own. " performance) and then check that it's actually used by its own.
@@ -243,13 +189,10 @@ syntax match juliaConstNum06 display "\%(\<\%(eu\?\|eulergamma\|γ\|catalan\
syntax match juliaPossibleEuler "" contains=juliaEuler syntax match juliaPossibleEuler "" contains=juliaEuler
exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . ']\|' . s:operators . '\)\%([.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=\ze\%($\|[' . s:nonidS_chars . ']\|' . s:operators . '\)"' exec 'syntax match juliaEuler contained "\%(\%(^\|[' . s:nonidS_chars . ']\|' . s:operators . '\)\%([.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=\ze\%($\|[' . s:nonidS_chars . ']\|' . s:operators . '\)"'
syntax match juliaConstBool display "\<\%(true\|false\)\>" syntax match juliaConstBool display "\<\%(true\|false\)\>"
syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|OS_NAME\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|JULIA_HOME\|PROGRAM_FILE\)\>" syntax match juliaConstEnv display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>"
syntax match juliaConstEnv1011 display "\<DEPOT_PATH\>" syntax match juliaConstIO display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
syntax match juliaConstIO06 display "\<\%(STD\%(OUT\|IN\|ERR\)\|DevNull\)\>" syntax match juliaConstC display "\<\%(C_NULL\)\>"
syntax match juliaConstIO1011 display "\<\%(std\%(out\|in\|err\)\|devnull\)\>" syntax match juliaConstGeneric display "\<\%(nothing\|Main\|undef\|missing\)\>"
syntax match juliaConstC display "\<\%(WORD_SIZE\|C_NULL\)\>"
syntax match juliaConstGeneric display "\<\%(nothing\|Main\)\>"
syntax match juliaConstGeneric1011 display "\<\%(undef\|missing\)\>"
syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro syntax match juliaPossibleMacro transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro
@@ -301,7 +244,7 @@ syntax match juliaComplexUnit display contained "\<im\>"
exec 'syntax match juliaOperator "' . s:operators . '"' exec 'syntax match juliaOperator "' . s:operators . '"'
syntax match juliaRangeOperator display ":" syntax match juliaRangeOperator display ":"
exec 'syntax region juliaTernaryRegion matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|^\s*:\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol' exec 'syntax region juliaTernaryRegion matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol'
let s:interp_dollar = '\([' . s:nonidS_chars . s:uniop_chars . s:binop_chars . '!?]\|^\)\@'.s:d(1).'<=\$' let s:interp_dollar = '\([' . s:nonidS_chars . s:uniop_chars . s:binop_chars . '!?]\|^\)\@'.s:d(1).'<=\$'
@@ -414,12 +357,11 @@ hi def link juliaKeyword Keyword
hi def link juliaInfixKeyword Keyword hi def link juliaInfixKeyword Keyword
hi def link juliaRepKeyword Keyword hi def link juliaRepKeyword Keyword
hi def link juliaBlKeyword Keyword hi def link juliaBlKeyword Keyword
exec 'hi! def link juliaBlKeyword06 ' . (b:julia_syntax_version == 6 ? 'Keyword' : b:julia_syntax_version == 10 ? 'juliaDeprecated' : 'NONE')
hi def link juliaConditional Conditional hi def link juliaConditional Conditional
hi def link juliaRepeat Repeat hi def link juliaRepeat Repeat
hi def link juliaException Exception hi def link juliaException Exception
hi def link juliaTypedef Keyword hi def link juliaTypedef Keyword
exec 'hi! def link juliaOuter ' . (b:julia_syntax_version >= 10 ? 'Keyword' : 'NONE') hi def link juliaOuter Keyword
hi def link juliaBaseTypeBasic Type hi def link juliaBaseTypeBasic Type
hi def link juliaBaseTypeNum Type hi def link juliaBaseTypeNum Type
hi def link juliaBaseTypeC Type hi def link juliaBaseTypeC Type
@@ -441,24 +383,13 @@ hi def link juliaBaseTypeRandom Type
hi def link juliaBaseTypeDisplay Type hi def link juliaBaseTypeDisplay Type
hi def link juliaBaseTypeTime Type hi def link juliaBaseTypeTime Type
hi def link juliaBaseTypeOther Type hi def link juliaBaseTypeOther Type
for t in ["Num", "Range", "Dict", "Set"]
let h = b:julia_syntax_version == 6 ? "Type" : b:julia_syntax_version == 10 ? "juliaDeprecated" : "NONE"
exec "hi! def link juliaBaseType" . t . "06 " . h
endfor
for t in ["Range", "Dict", "Set", "Basic", "C", "Array", "Iter", "Display", "IO", "Num", "Error", "String"]
let h = b:julia_syntax_version >= 10 ? "Type" : "NONE"
exec "hi! def link juliaBaseType" . t . "1011 " . h
endfor
" NOTE: deprecated constants are not highlighted as such. For once, " NOTE: deprecated constants are not highlighted as such. For once,
" one can still legitimately use them by importing Base.MathConstants. " one can still legitimately use them by importing Base.MathConstants.
" Plus, one-letter variables like `e` and `γ` can be used with other " Plus, one-letter variables like `e` and `γ` can be used with other
" meanings. " meanings.
hi def link juliaConstNum Constant hi def link juliaConstNum Constant
let h = b:julia_syntax_version == 6 ? "Constant" : "NONE" hi def link juliaEuler Constant
exec "hi! def link juliaConstNum06 " . h
let h = b:julia_syntax_version >= 10 ? "Constant" : "NONE"
exec "hi! def link juliaEuler " . h
hi def link juliaConstEnv Constant hi def link juliaConstEnv Constant
hi def link juliaConstC Constant hi def link juliaConstC Constant
@@ -466,13 +397,7 @@ hi def link juliaConstLimits Constant
hi def link juliaConstGeneric Constant hi def link juliaConstGeneric Constant
hi def link juliaRangeEnd Constant hi def link juliaRangeEnd Constant
hi def link juliaConstBool Boolean hi def link juliaConstBool Boolean
hi def link juliaConstIO Boolean
for t in ["Generic", "IO", "Env"]
let h = b:julia_syntax_version >= 10 ? "Constant" : "NONE"
exec "hi! def link juliaConst" . t . "1011 " . h
endfor
let h = b:julia_syntax_version == 6 ? "Constant" : b:julia_syntax_version == 10 ? "juliaDeprecated" : "NONE"
exec "hi! def link juliaConstIO06 " . h
hi def link juliaComprehensionFor Keyword hi def link juliaComprehensionFor Keyword
hi def link juliaComprehensionIf Keyword hi def link juliaComprehensionIf Keyword
@@ -550,12 +475,6 @@ hi def link juliaErrorPrintfFmt juliaError
hi def link juliaError Error hi def link juliaError Error
if b:julia_syntax_highlight_deprecated == 1
hi! def link juliaDeprecated Todo
else
hi! def link juliaDeprecated NONE
end
syntax sync fromstart syntax sync fromstart
let b:current_syntax = "julia" let b:current_syntax = "julia"

View File

@@ -25,10 +25,10 @@ syn match llvmType /\<i\d\+\>/
" The true and false tokens can be used for comparison opcodes, but it's " The true and false tokens can be used for comparison opcodes, but it's
" much more common for these tokens to be used for boolean constants. " much more common for these tokens to be used for boolean constants.
syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
syn keyword llvmStatement bitcast br catchpad catchswitch catchret call syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr
syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub getelementptr syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub fneg getelementptr
syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
@@ -150,6 +150,7 @@ syn keyword llvmKeyword
\ sspstrong \ sspstrong
\ strictfp \ strictfp
\ swiftcc \ swiftcc
\ swiftself
\ tail \ tail
\ target \ target
\ thread_local \ thread_local

View File

@@ -2,17 +2,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') =
"Vim syntax file "Vim syntax file
" Language: Mathematica " Language: Mathematica
" Maintainer: Voldikss <dyzplus@gmail.com> " Maintainer: R. Menon <rsmenon@icloud.com>
" Last Change: 2019 Jan 23 by Voldikss " Last Change: Feb 25, 2013
" Source: https://github.com/voldikss/vim-mma/syntax/mma.vim
" Credits:
" Arnoud Buzing: https://github.com/arnoudbuzing
" Rsmenon: https://github.com/rsmenon
" TODO:
" Box Forms
" quit when a syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif

View File

@@ -1943,9 +1943,7 @@ syn match sqlPlpgsqlVariable ".\zs@[A-z0-9_]\+" contained
" PL/pgSQL operators " PL/pgSQL operators
syn match sqlPlpgsqlOperator ":=" contained syn match sqlPlpgsqlOperator ":=" contained
syn region plpgsql matchgroup=sqlString start=+\$pgsql\$+ end=+\$pgsql\$+ keepend syn region plpgsql matchgroup=sqlString start=+\$\z(pgsql\|body\|function\)\$+ end=+\$\z1\$+ keepend
\ contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlPlpgsqlKeyword,sqlPlpgsqlVariable,sqlPlpgsqlOperator,sqlNumber,sqlIsOperator,sqlString,sqlTodo
syn region plpgsql matchgroup=sqlString start=+\$body\$+ end=+\$body\$+ keepend
\ contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlPlpgsqlKeyword,sqlPlpgsqlVariable,sqlPlpgsqlOperator,sqlNumber,sqlIsOperator,sqlString,sqlTodo \ contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlPlpgsqlKeyword,sqlPlpgsqlVariable,sqlPlpgsqlOperator,sqlNumber,sqlIsOperator,sqlString,sqlTodo
if get(g:, 'pgsql_dollar_strings', 0) if get(g:, 'pgsql_dollar_strings', 0)
syn region sqlString start=+\$\$+ end=+\$\$+ contains=@Spell syn region sqlString start=+\$\$+ end=+\$\$+ contains=@Spell

View File

@@ -187,8 +187,17 @@ if !exists("php_phpdoc_folding")
let php_phpdoc_folding = 0 let php_phpdoc_folding = 0
endif endif
" set default global php version
if !exists('g:php_version_id')
let g:php_version_id = 70300
endif
" set default buffer level php version
if !exists('b:php_version_id')
let b:php_version_id = g:php_version_id
endif
" Folding Support {{{ " Folding Support {{{
"
if php_folding==1 && has("folding") if php_folding==1 && has("folding")
command! -nargs=+ SynFold <args> fold command! -nargs=+ SynFold <args> fold
else else
@@ -673,6 +682,23 @@ syn case match
" HereDoc " HereDoc
if version >= 704 if version >= 704
if b:php_version_id >= 70300
" @begin phpHereDoc
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
" including HTML,JavaScript,SQL if enabled via options
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpHereDoc
else
" @begin phpHereDoc " @begin phpHereDoc
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
@@ -688,6 +714,24 @@ if version >= 704
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
" @end phpHereDoc " @end phpHereDoc
endif
else
if b:php_version_id >= 70300
" @copy phpHereDoc strip_maximum_size
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
" including HTML,JavaScript,SQL if enabled via options
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpHereDoc
else else
" @copy phpHereDoc strip_maximum_size " @copy phpHereDoc strip_maximum_size
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
@@ -705,9 +749,26 @@ else
endif endif
" @end phpHereDoc " @end phpHereDoc
endif endif
endif
" NowDoc " NowDoc
if version >= 704 if version >= 704
if b:php_version_id >= 70300
" @begin phpNowDoc
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\s*\z1\>" contained keepend extend
" including HTML,JavaScript,SQL if enabled via options
if (exists("php_html_in_nowdoc") && php_html_in_nowdoc)
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_nowdoc") && php_sql_nowdoc)
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpNowDoc
else
" @begin phpNowDoc " @begin phpNowDoc
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend
" including HTML,JavaScript,SQL if enabled via options " including HTML,JavaScript,SQL if enabled via options
@@ -722,6 +783,24 @@ if version >= 704
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif endif
" @end phpNowDoc " @end phpNowDoc
endif
else
if b:php_version_id >= 70300
" @copy phpHereDoc strip_maximum_size
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
" including HTML,JavaScript,SQL if enabled via options
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_xml_heredoc") && php_xml_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" @end phpNowDoc
else else
" @copy phpHereDoc strip_maximum_size " @copy phpHereDoc strip_maximum_size
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
@@ -739,6 +818,7 @@ else
endif endif
" @end phpNowDoc " @end phpNowDoc
endif endif
endif
syn case ignore syn case ignore

View File

@@ -59,16 +59,24 @@ syn match ps1Constant +\$^+
syn keyword ps1Keyword class define from using var syn keyword ps1Keyword class define from using var
" Function declarations " Function declarations
syn keyword ps1Keyword function nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword function nextgroup=ps1Function skipwhite
syn keyword ps1Keyword filter nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword filter nextgroup=ps1Function skipwhite
syn keyword ps1Keyword workflow nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword workflow nextgroup=ps1Function skipwhite
syn keyword ps1Keyword configuration nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword configuration nextgroup=ps1Function skipwhite
syn keyword ps1Keyword class nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword class nextgroup=ps1Function skipwhite
syn keyword ps1Keyword enum nextgroup=ps1FunctionDeclaration skipwhite syn keyword ps1Keyword enum nextgroup=ps1Function skipwhite
syn match ps1FunctionDeclaration /\w\+\(-\w\+\)*/ contained
" Function invocations " Function declarations and invocations
syn match ps1FunctionInvocation /\w\+\(-\w\+\)\+/ syn match ps1Cmdlet /\v(add|clear|close|copy|enter|exit|find|format|get|hide|join|lock|move|new|open|optimize|pop|push|redo|remove|rename|reset|search|select|Set|show|skip|split|step|switch|undo|unlock|watch)(-\w+)+/ contained
syn match ps1Cmdlet /\v(connect|disconnect|read|receive|send|write)(-\w+)+/ contained
syn match ps1Cmdlet /\v(backup|checkpoint|compare|compress|convert|convertfrom|convertto|dismount|edit|expand|export|group|import|initialize|limit|merge|mount|out|publish|restore|save|sync|unpublish|update)(-\w+)+/ contained
syn match ps1Cmdlet /\v(debug|measure|ping|repair|resolve|test|trace)(-\w+)+/ contained
syn match ps1Cmdlet /\v(approve|assert|build|complete|confirm|deny|deploy|disable|enable|install|invoke|register|request|restart|resume|start|stop|submit|suspend|uninstall|unregister|wait)(-\w+)+/ contained
syn match ps1Cmdlet /\v(block|grant|protect|revoke|unblock|unprotect)(-\w+)+/ contained
syn match ps1Cmdlet /\v(use)(-\w+)+/ contained
" Other functions
syn match ps1Function /\w\+\(-\w\+\)\+/ contains=ps1Cmdlet
" Type declarations " Type declarations
syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/ syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/
@@ -164,8 +172,8 @@ if version >= 508 || !exists("did_ps1_syn_inits")
HiLink ps1Escape SpecialChar HiLink ps1Escape SpecialChar
HiLink ps1InterpolationDelimiter Delimiter HiLink ps1InterpolationDelimiter Delimiter
HiLink ps1Conditional Conditional HiLink ps1Conditional Conditional
HiLink ps1FunctionDeclaration Function HiLink ps1Cmdlet Function
HiLink ps1FunctionInvocation Function HiLink ps1Function Identifier
HiLink ps1Variable Identifier HiLink ps1Variable Identifier
HiLink ps1Boolean Boolean HiLink ps1Boolean Boolean
HiLink ps1Constant Constant HiLink ps1Constant Constant

View File

@@ -56,10 +56,19 @@ if s:Enabled('g:python_highlight_all')
call s:EnableByDefault('g:python_highlight_space_errors') call s:EnableByDefault('g:python_highlight_space_errors')
call s:EnableByDefault('g:python_highlight_doctests') call s:EnableByDefault('g:python_highlight_doctests')
call s:EnableByDefault('g:python_print_as_function') call s:EnableByDefault('g:python_print_as_function')
call s:EnableByDefault('g:python_highlight_func_calls')
call s:EnableByDefault('g:python_highlight_class_vars') call s:EnableByDefault('g:python_highlight_class_vars')
call s:EnableByDefault('g:python_highlight_operators') call s:EnableByDefault('g:python_highlight_operators')
endif endif
"
" Function calls
"
if s:Enabled('g:python_highlight_func_calls')
syn match pythonFunctionCall '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\ze\%(\s*(\)'
endif
" "
" Keywords " Keywords
" "
@@ -396,6 +405,10 @@ if s:Enabled('g:python_highlight_exceptions')
unlet s:exs_re unlet s:exs_re
endif endif
"
" Misc
"
if s:Enabled('g:python_slow_sync') if s:Enabled('g:python_slow_sync')
syn sync minlines=2000 syn sync minlines=2000
else else
@@ -418,6 +431,7 @@ if v:version >= 508 || !exists('did_python_syn_inits')
HiLink pythonRaiseFromStatement Statement HiLink pythonRaiseFromStatement Statement
HiLink pythonImport Include HiLink pythonImport Include
HiLink pythonFunction Function HiLink pythonFunction Function
HiLink pythonFunctionCall Function
HiLink pythonConditional Conditional HiLink pythonConditional Conditional
HiLink pythonRepeat Repeat HiLink pythonRepeat Repeat
HiLink pythonException Exception HiLink pythonException Exception

View File

@@ -16,154 +16,154 @@ endif
" Syntax definitions {{{1 " Syntax definitions {{{1
" Basic keywords {{{2 " Basic keywords {{{2
syn keyword rustConditional switch match if else for in when fun syn keyword reasonConditional switch match if else for in when fun
syn keyword rustOperator as syn keyword reasonOperator as
syn match rustAssert "\<assert\(\w\)*!" contained syn match reasonAssert "\<assert\(\w\)*!" contained
syn match rustPanic "\<panic\(\w\)*!" contained syn match reasonPanic "\<panic\(\w\)*!" contained
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty syn keyword reasonKeyword box nextgroup=reasonBoxPlacement skipwhite skipempty
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty syn keyword reasonKeyword extern nextgroup=reasonExternCrate,reasonObsoleteExternMod skipwhite skipempty
" syn keyword rustKeyword fun nextgroup=rustFuncName skipwhite skipempty " syn keyword reasonKeyword fun nextgroup=reasonFuncName skipwhite skipempty
syn keyword rustKeyword unsafe where while lazy syn keyword reasonKeyword unsafe where while lazy
syn keyword rustStorage and class constraint exception external include inherit let method module nonrec open private rec type val with syn keyword reasonStorage and class constraint exception external include inherit let method module nonrec open private rec type val with
" FIXME: Scoped impl's name is also fallen in this category " FIXME: Scoped impl's name is also fallen in this category
" syn keyword rustStorageIdent let and module type nextgroup=rustIdentifier skipwhite skipempty " syn keyword reasonStorageIdent let and module type nextgroup=reasonIdentifier skipwhite skipempty
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty syn keyword reasonExternCrate crate contained nextgroup=reasonIdentifier,reasonExternCrateString skipwhite skipempty
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting. " This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator syn match reasonExternCrateString /".*"\_s*as/ contained nextgroup=reasonIdentifier skipwhite transparent skipempty contains=reasonString,reasonOperator
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty syn keyword reasonObsoleteExternMod mod contained nextgroup=reasonIdentifier skipwhite skipempty
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match reasonIdentifier contains=reasonIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match reasonFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
" "
syn match labelArgument "\(\l\|_\)\(\w\|'\)*::\(?\)\?"lc=0 "Allows any space between label name and :: syn match labelArgument "\(\l\|_\)\(\w\|'\)*::\(?\)\?"lc=0 "Allows any space between label name and ::
syn match labelArgumentPunned "::\(?\)\?\(\l\|_\)\(\w\|'\)*"lc=0 "Allows any space between label name and :: syn match labelArgumentPunned "::\(?\)\?\(\l\|_\)\(\w\|'\)*"lc=0 "Allows any space between label name and ::
syn match rustEnumVariant "\<\u\(\w\|'\)*\>[^\.]"me=e-1 syn match reasonEnumVariant "\<\u\(\w\|'\)*\>[^\.]"me=e-1
" Polymorphic variants " Polymorphic variants
syn match rustEnumVariant "`\w\(\w\|'\)*\>" syn match reasonEnumVariant "`\w\(\w\|'\)*\>"
syn match rustModPath "\<\u\w*\." syn match reasonModPath "\<\u\w*\."
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained syn region reasonBoxPlacement matchgroup=reasonBoxPlacementParens start="(" end=")" contains=TOP contained
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since " Ideally we'd have syntax rules set up to match arbitrary expressions. Since
" we don't, we'll just define temporary contained rules to handle balancing " we don't, we'll just define temporary contained rules to handle balancing
" delimiters. " delimiters.
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent syn region reasonBoxPlacementBalance start="(" end=")" containedin=reasonBoxPlacement transparent
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent syn region reasonBoxPlacementBalance start="\[" end="\]" containedin=reasonBoxPlacement transparent
" {} are handled by rustFoldBraces " {} are handled by reasonFoldBraces
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount syn region reasonMacroRepeat matchgroup=reasonMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=reasonMacroRepeatCount
syn match rustMacroRepeatCount ".\?[*+]" contained syn match reasonMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+" syn match reasonMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2 " Reserved (but not yet used) keywords {{{2
syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro syn keyword reasonReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro
" Built-in types {{{2 " Built-in types {{{2
syn keyword rustType int float option list array unit ref bool string syn keyword reasonType int float option list array unit ref bool string
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2 " Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
" This section is just straight transformation of the contents of the prelude, " This section is just straight transformation of the contents of the prelude,
" to make it easy to update. " to make it easy to update.
" Reexported core operators {{{3 " Reexported core operators {{{3
syn keyword rustTrait Copy Send Sized Sync syn keyword reasonTrait Copy Send Sized Sync
syn keyword rustTrait Drop Fn FnMut FnOnce syn keyword reasonTrait Drop Fn FnMut FnOnce
" Reexported functions {{{3 " Reexported functions {{{3
" Theres no point in highlighting these; when one writes drop( or drop::< it " Theres no point in highlighting these; when one writes drop( or drop::< it
" gets the same highlighting anyway, and if someone writes `let drop = …;` we " gets the same highlighting anyway, and if someone writes `let drop = …;` we
" dont really want *that* drop to be highlighted. " dont really want *that* drop to be highlighted.
"syn keyword rustFunction drop "syn keyword reasonFunction drop
" Reexported types and traits {{{3 " Reexported types and traits {{{3
syn keyword rustTrait Box syn keyword reasonTrait Box
syn keyword rustTrait ToOwned syn keyword reasonTrait ToOwned
syn keyword rustTrait Clone syn keyword reasonTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord syn keyword reasonTrait PartialEq PartialOrd Eq Ord
syn keyword rustTrait AsRef AsMut Into From syn keyword reasonTrait AsRef AsMut Into From
syn keyword rustTrait Default syn keyword reasonTrait Default
syn keyword rustTrait Iterator Extend IntoIterator syn keyword reasonTrait Iterator Extend IntoIterator
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator syn keyword reasonTrait DoubleEndedIterator ExactSizeIterator
syn keyword rustEnum Option syn keyword reasonEnum Option
syn keyword rustEnumVariant Some None syn keyword reasonEnumVariant Some None
syn keyword rustEnum Result syn keyword reasonEnum Result
syn keyword rustEnumVariant Ok Err syn keyword reasonEnumVariant Ok Err
syn keyword rustTrait SliceConcatExt syn keyword reasonTrait SliceConcatExt
syn keyword rustTrait String ToString syn keyword reasonTrait String ToString
syn keyword rustTrait Vec syn keyword reasonTrait Vec
" Other syntax {{{2 " Other syntax {{{2
syn keyword rustSelf self syn keyword reasonSelf self
syn keyword rustBoolean true false syn keyword reasonBoolean true false
" This is merely a convention; note also the use of [A-Z], restricting it to " This is merely a convention; note also the use of [A-Z], restricting it to
" latin identifiers rather than the full Unicode uppercase. I have not used " latin identifiers rather than the full Unicode uppercase. I have not used
" [:upper:] as it depends upon 'noignorecase' " [:upper:] as it depends upon 'noignorecase'
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*" "syn match reasonCapsIdent display "[A-Z]\w\(\w\)*"
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?" syn match reasonOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
" This one isn't *quite* right, as we could have binary-& with a reference " This one isn't *quite* right, as we could have binary-& with a reference
" This isn't actually correct; a closure with no arguments can be `|| { }`. " This isn't actually correct; a closure with no arguments can be `|| { }`.
" Last, because the & in && isn't a sigil " Last, because the & in && isn't a sigil
syn match rustOperator display "&&\|||" syn match reasonOperator display "&&\|||"
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen, " This is reasonArrowCharacter rather than reasonArrow for the sake of matchparen,
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details. " so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
syn match rustArrowCharacter display "=>" syn match reasonArrowCharacter display "=>"
syn match rustEscapeError display contained /\\./ syn match reasonEscapeError display contained /\\./
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ syn match reasonEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/ syn match reasonEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/ syn match reasonEscapeUnicode display contained /\\u{\x\{1,6}}/
syn match rustStringContinuation display contained /\\\n\s*/ syn match reasonStringContinuation display contained /\\\n\s*/
syn region rustString start='{j|' end='|j}' contains=rustMacroVariable,@Spell syn region reasonString start='{j|' end='|j}' contains=reasonMacroVariable,@Spell
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation syn region reasonString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=reasonEscape,reasonEscapeError,reasonStringContinuation
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell syn region reasonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation,@Spell
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell syn region reasonString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive syn region reasonAttribute start="#!\?\[" end="\]" contains=reasonString,reasonDerive
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait syn region reasonDerive start="derive(" end=")" contained contains=reasonDeriveTrait
" This list comes from src/libsyntax/ext/deriving/mod.rs " This list comes from src/libsyntax/ext/deriving/mod.rs
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show). " Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy syn keyword reasonDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
" Number literals " Number literals
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\=" syn match reasonDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" syn match reasonHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" syn match reasonOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\=" syn match reasonBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
" Special case for numbers of the form "1." which are float literals, unless followed by " Special case for numbers of the form "1." which are float literals, unless followed by
" an identifier, which makes them integer literals with a method call or field access, " an identifier, which makes them integer literals with a method call or field access,
" or by another ".", which makes them integer literals followed by the ".." token. " or by another ".", which makes them integer literals followed by the ".." token.
" (This must go first so the others take precedence.) " (This must go first so the others take precedence.)
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!" syn match reasonFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
" To mark a number as a normal float, it must have at least one of the three things integral values don't have: " To mark a number as a normal float, it must have at least one of the three things integral values don't have:
" a decimal point and more numbers; an exponent; and a type suffix. " a decimal point and more numbers; an exponent; and a type suffix.
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\=" syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)" syn match reasonFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
" For the benefit of delimitMate " For the benefit of delimitMate
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ syn match reasonCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). " The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ syn match reasonCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode syn match reasonCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=reasonEscape,reasonEscapeError,reasonCharacterInvalid,reasonCharacterInvalidUnicode
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid syn match reasonCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonCharacterInvalid
syn match rustShebang /\%^#![^[].*/ syn match reasonShebang /\%^#![^[].*/
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell syn region reasonCommentLine start="//" end="$" contains=reasonTodo,@Spell
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell syn region reasonCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=reasonTodo,@Spell
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell syn region reasonCommentBlock matchgroup=reasonCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=reasonTodo,reasonCommentBlockNest,@Spell
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell syn region reasonCommentBlockDoc matchgroup=reasonCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=reasonTodo,reasonCommentBlockDocNest,@Spell
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent syn region reasonCommentBlockNest matchgroup=reasonCommentBlock start="/\*" end="\*/" contains=reasonTodo,reasonCommentBlockNest,@Spell contained transparent
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent syn region reasonCommentBlockDocNest matchgroup=reasonCommentBlockDoc start="/\*" end="\*/" contains=reasonTodo,reasonCommentBlockDocNest,@Spell contained transparent
" FIXME: this is a really ugly and not fully correct implementation. Most " FIXME: this is a really ugly and not fully correct implementation. Most
" importantly, a case like ``/* */*`` should have the final ``*`` not being in " importantly, a case like ``/* */*`` should have the final ``*`` not being in
" a comment, but in practice at present it leaves comments open two levels " a comment, but in practice at present it leaves comments open two levels
@@ -176,79 +176,79 @@ syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*"
" then you must deal with cases like ``/*/**/*/``. And don't try making it " then you must deal with cases like ``/*/**/*/``. And don't try making it
" worse with ``\%(/\@<!\*\)\@<!``, either... " worse with ``\%(/\@<!\*\)\@<!``, either...
syn keyword rustTodo contained TODO FIXME XXX NB NOTE syn keyword reasonTodo contained TODO FIXME XXX NB NOTE
" Folding rules {{{2 " Folding rules {{{2
" Trivial folding rules to begin with. " Trivial folding rules to begin with.
" FIXME: use the AST to make really good folding " FIXME: use the AST to make really good folding
syn region rustFoldBraces start="{" end="}" transparent fold syn region reasonFoldBraces start="{" end="}" transparent fold
" Default highlighting {{{1 " Default highlighting {{{1
hi def link labelArgument Special hi def link labelArgument Special
hi def link labelArgumentPunned Special hi def link labelArgumentPunned Special
hi def link rustDecNumber rustNumber hi def link reasonDecNumber reasonNumber
hi def link rustHexNumber rustNumber hi def link reasonHexNumber reasonNumber
hi def link rustOctNumber rustNumber hi def link reasonOctNumber reasonNumber
hi def link rustBinNumber rustNumber hi def link reasonBinNumber reasonNumber
hi def link rustIdentifierPrime rustIdentifier hi def link reasonIdentifierPrime reasonIdentifier
hi def link rustTrait rustType hi def link reasonTrait reasonType
hi def link rustDeriveTrait rustTrait hi def link reasonDeriveTrait reasonTrait
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters hi def link reasonMacroRepeatCount reasonMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro hi def link reasonMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define hi def link reasonMacroVariable Define
hi def link rustEscape Special hi def link reasonEscape Special
hi def link rustEscapeUnicode rustEscape hi def link reasonEscapeUnicode reasonEscape
hi def link rustEscapeError Error hi def link reasonEscapeError Error
hi def link rustStringContinuation Special hi def link reasonStringContinuation Special
hi def link rustString String hi def link reasonString String
hi def link rustCharacterInvalid Error hi def link reasonCharacterInvalid Error
hi def link rustCharacterInvalidUnicode rustCharacterInvalid hi def link reasonCharacterInvalidUnicode reasonCharacterInvalid
hi def link rustCharacter Character hi def link reasonCharacter Character
hi def link rustNumber Number hi def link reasonNumber Number
hi def link rustBoolean Boolean hi def link reasonBoolean Boolean
hi def link rustEnum rustType hi def link reasonEnum reasonType
hi def link rustEnumVariant Function hi def link reasonEnumVariant Function
hi def link rustModPath Macro hi def link reasonModPath Macro
hi def link rustConstant Constant hi def link reasonConstant Constant
hi def link rustSelf Constant hi def link reasonSelf Constant
hi def link rustFloat Float hi def link reasonFloat Float
hi def link rustArrowCharacter rustOperator hi def link reasonArrowCharacter reasonOperator
hi def link rustOperator Keyword hi def link reasonOperator Keyword
hi def link rustKeyword Keyword hi def link reasonKeyword Keyword
hi def link rustReservedKeyword Error hi def link reasonReservedKeyword Error
hi def link rustConditional StorageClass hi def link reasonConditional StorageClass
hi def link rustIdentifier Identifier hi def link reasonIdentifier Identifier
hi def link rustCapsIdent rustIdentifier hi def link reasonCapsIdent reasonIdentifier
hi def link rustFunction Function hi def link reasonFunction Function
hi def link rustFuncName Function hi def link reasonFuncName Function
hi def link rustShebang Comment hi def link reasonShebang Comment
hi def link rustCommentLine Comment hi def link reasonCommentLine Comment
hi def link rustCommentLineDoc Comment hi def link reasonCommentLineDoc Comment
hi def link rustCommentBlock rustCommentLine hi def link reasonCommentBlock reasonCommentLine
hi def link rustCommentBlockDoc rustCommentLineDoc hi def link reasonCommentBlockDoc reasonCommentLineDoc
hi def link rustAssert PreCondit hi def link reasonAssert PreCondit
hi def link rustPanic PreCondit hi def link reasonPanic PreCondit
hi def link rustType Type hi def link reasonType Type
hi def link rustTodo Todo hi def link reasonTodo Todo
hi def link rustAttribute PreProc hi def link reasonAttribute PreProc
hi def link rustDerive PreProc hi def link reasonDerive PreProc
hi def link rustStorage Conditional hi def link reasonStorage Conditional
hi def link rustStorageIdent StorageClass hi def link reasonStorageIdent StorageClass
hi def link rustObsoleteStorage Error hi def link reasonObsoleteStorage Error
hi def link rustExternCrate rustKeyword hi def link reasonExternCrate reasonKeyword
hi def link rustObsoleteExternMod Error hi def link reasonObsoleteExternMod Error
hi def link rustBoxPlacementParens Delimiter hi def link reasonBoxPlacementParens Delimiter
" Other Suggestions: " Other Suggestions:
" hi rustAttribute ctermfg=cyan " hi reasonAttribute ctermfg=cyan
" hi rustDerive ctermfg=cyan " hi reasonDerive ctermfg=cyan
" hi rustAssert ctermfg=yellow " hi reasonAssert ctermfg=yellow
" hi rustPanic ctermfg=red " hi reasonPanic ctermfg=red
syn sync minlines=200 syn sync minlines=200
syn sync maxlines=500 syn sync maxlines=500
let b:current_syntax = "rust" let b:current_syntax = "reason"
endif endif

View File

@@ -93,7 +93,7 @@ if exists("ruby_operators") || exists("ruby_pseudo_operators")
syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||" syn match rubyBooleanOperator "\%(\w\|[^\x00-\x7F]\)\@1<!!\|&&\|||"
syn match rubyRangeOperator "\.\.\.\=" syn match rubyRangeOperator "\.\.\.\="
syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^=" syn match rubyAssignmentOperator "=>\@!\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|||=\||=\|%=\|+=\|>>=\|<<=\|\^="
syn match rubyAssignmentOperator "=>\@!" containedin=rubyBlockParameterList " TODO: this is inelegant syn match rubyAssignmentOperator "=>\@!" contained containedin=rubyBlockParameterList " TODO: this is inelegant
syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~" syn match rubyEqualityOperator "===\|==\|!=\|!\~\|=\~"
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\%(\w\|[^\x00-\x7F]\)[?!]\=\|[]})]\)\@2<=\[" end="]" contains=ALLBUT,@rubyNotTop
@@ -194,7 +194,7 @@ SynFold ':' syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@=" syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@="
syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop containedin=rubyBlockParameterList syn region rubyParentheses start="(" end=")" contains=ALLBUT,@rubyNotTop contained containedin=rubyBlockParameterList
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\_s*\)\@32<=|" end="|" contains=ALLBUT,@rubyNotTop,@rubyProperOperator
if exists('ruby_global_variable_error') if exists('ruby_global_variable_error')

File diff suppressed because it is too large Load Diff

View File

@@ -48,7 +48,9 @@ syn keyword valaConstant false null true
" Exceptions " Exceptions
syn keyword valaException try catch finally throw syn keyword valaException try catch finally throw
" Unspecified Statements " Unspecified Statements
syn keyword valaUnspecifiedStatement as base construct delete get in is lock new out params ref sizeof set this throws typeof using value var yield syn keyword valaUnspecifiedStatement as base construct delete get in is lock new out params ref sizeof set this throws typeof value var yield
" Includes
syn match valaInclude "^\s*\zs\<using\>\ze\s\w"
" Arrays and Lists " Arrays and Lists
syn match valaArray "\(\w\(\w\)*\(\s\+\)\?<\)\+\(\(\s\+\)\?\w\(\w\)*\(?\|\*\)\?\(\,\)\?\)\+>\+" syn match valaArray "\(\w\(\w\)*\(\s\+\)\?<\)\+\(\(\s\+\)\?\w\(\w\)*\(?\|\*\)\?\(\,\)\?\)\+>\+"
" Methods " Methods
@@ -141,6 +143,10 @@ syn match valaNumber display "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fF
syn match valaNumber display "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" syn match valaNumber display "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
syn match valaNumber display "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" syn match valaNumber display "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
" Lambda definitions (ported from java.vim)
" needs to be defined after the parenthesis error catcher to work
syn match valaLambdaDef "([a-zA-Z0-9_<>\[\], \t]*)\s*=>"
" when wanted, highlight trailing white space " when wanted, highlight trailing white space
if exists("vala_space_errors") if exists("vala_space_errors")
if !exists("vala_no_trail_space_error") if !exists("vala_no_trail_space_error")
@@ -172,10 +178,12 @@ hi def link valaModifier StorageClass
hi def link valaConstant Constant hi def link valaConstant Constant
hi def link valaException Exception hi def link valaException Exception
hi def link valaUnspecifiedStatement Statement hi def link valaUnspecifiedStatement Statement
hi def link valaInclude Include
hi def link valaUnspecifiedKeyword Keyword hi def link valaUnspecifiedKeyword Keyword
hi def link valaContextualStatement Statement hi def link valaContextualStatement Statement
hi def link valaArray StorageClass hi def link valaArray StorageClass
hi def link valaMethod Function hi def link valaMethod Function
hi def link valaLambdaDef Function
hi def link valaOperator Operator hi def link valaOperator Operator
hi def link valaDelimiter Delimiter hi def link valaDelimiter Delimiter
hi def link valaEnumField Constant hi def link valaEnumField Constant

View File

@@ -36,8 +36,8 @@ syn match zigBuiltinFn "\v\@(compileLog|ctz|popCount|divExact|divFloor|divTrunc)
syn match zigBuiltinFn "\v\@(embedFile|export|tagName|TagType|errorName|call)>" syn match zigBuiltinFn "\v\@(embedFile|export|tagName|TagType|errorName|call)>"
syn match zigBuiltinFn "\v\@(errorReturnTrace|fence|fieldParentPtr|field|unionInit)>" syn match zigBuiltinFn "\v\@(errorReturnTrace|fence|fieldParentPtr|field|unionInit)>"
syn match zigBuiltinFn "\v\@(frameAddress|import|newStackCall|asyncCall|intToPtr|IntType)>" syn match zigBuiltinFn "\v\@(frameAddress|import|newStackCall|asyncCall|intToPtr|IntType)>"
syn match zigBuiltinFn "\v\@(maxValue|memberCount|memberName|memberType|as)>" syn match zigBuiltinFn "\v\@(memberCount|memberName|memberType|as)>"
syn match zigBuiltinFn "\v\@(memcpy|memset|minValue|mod|mulWithOverflow|splat)>" syn match zigBuiltinFn "\v\@(memcpy|memset|mod|mulWithOverflow|splat)>"
syn match zigBuiltinFn "\v\@(bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)>" syn match zigBuiltinFn "\v\@(bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)>"
syn match zigBuiltinFn "\v\@(ptrToInt|rem|returnAddress|setCold|Type|shuffle)>" syn match zigBuiltinFn "\v\@(ptrToInt|rem|returnAddress|setCold|Type|shuffle)>"
syn match zigBuiltinFn "\v\@(setRuntimeSafety|setEvalBranchQuota|setFloatMode)>" syn match zigBuiltinFn "\v\@(setRuntimeSafety|setEvalBranchQuota|setFloatMode)>"