codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Expect3" Maintainer: Ralph Jennings <knowbudy@oro.net>4" Last Change: 2012 Jun 015" (Dominique Pelle added @Spell)6 7" quit when a syntax file was already loaded8if exists("b:current_syntax")9 finish10endif11 12" Reserved Expect variable prefixes.13syn match expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*"14syn match expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*"15 16" Normal Expect variables.17syn match expectVariables "\$env([^)]*)"18syn match expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*"19syn match expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout"20 21" Expect variable arrays.22syn match expectVariables "\$\(expect\|interact\)_out([^)]*)" contains=expectOutVar23 24" User defined variables.25syn match expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*"26 27" Reserved Expect command prefixes.28syn match expectCommand "exp_[a-zA-Z0-9_]*"29 30" Normal Expect commands.31syn keyword expectStatement close debug disconnect32syn keyword expectStatement exit exp_continue exp_internal exp_open33syn keyword expectStatement exp_pid exp_version34syn keyword expectStatement fork inter_return interpreter35syn keyword expectStatement log_file log_user match_max overlay36syn keyword expectStatement parity remove_nulls return37syn keyword expectStatement send send_error send_log send_user38syn keyword expectStatement sleep spawn strace stty system39syn keyword expectStatement timestamp trace trap wait40 41" Tcl commands recognized and used by Expect.42syn keyword expectCommand proc43syn keyword expectConditional if else44syn keyword expectRepeat while for foreach45 46" Expect commands with special arguments.47syn keyword expectStatement expect expect_after expect_background nextgroup=expectExpectOpts48syn keyword expectStatement expect_before expect_user interact nextgroup=expectExpectOpts49 50syn match expectSpecial contained "\\."51 52" Options for "expect", "expect_after", "expect_background",53" "expect_before", "expect_user", and "interact".54syn keyword expectExpectOpts default eof full_buffer null return timeout55 56syn keyword expectOutVar contained spawn_id seconds seconds_total57syn keyword expectOutVar contained string start end buffer58 59" Numbers (Tcl style).60syn case ignore61 syn match expectNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"62 "floating point number, with dot, optional exponent63 syn match expectNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"64 "floating point number, starting with a dot, optional exponent65 syn match expectNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"66 "floating point number, without dot, with exponent67 syn match expectNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"68 "hex number69 syn match expectNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"70 "syn match expectIdentifier "\<[a-z_][a-z0-9_]*\>"71syn case match72 73syn region expectString start=+"+ end=+"+ contains=@Spell,expectVariables,expectSpecial74 75" Are these really comments in Expect? (I never use it, so I'm just guessing).76syn keyword expectTodo contained TODO77syn match expectComment "#.*$" contains=@Spell,expectTodo78syn match expectSharpBang "\%^#!.*"79 80" Define the default highlighting.81" Only when an item doesn't have highlighting yet82 83hi def link expectSharpBang PreProc84hi def link expectVariables Special85hi def link expectCommand Function86hi def link expectStatement Statement87hi def link expectConditional Conditional88hi def link expectRepeat Repeat89hi def link expectExpectOpts Keyword90hi def link expectOutVar Special91hi def link expectSpecial Special92hi def link expectNumber Number93 94hi def link expectString String95 96hi def link expectComment Comment97hi def link expectTodo Todo98"hi def link expectIdentifier Identifier99 100 101let b:current_syntax = "expect"102 103" vim: ts=8104 