2 " Language: gretl (http://gretl.sf.net)
3 " Maintainer: Vaidotas Zemlys <zemlys@gmail.com>
4 " Last Change: 2006 Apr 30
5 " Filenames: *.inp *.gretl
6 " URL: http://uosis.mif.vu.lt/~zemlys/vim-syntax/gretl.vim
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
12 elseif exists("b:current_syntax")
17 setlocal iskeyword=@,48-57,_,.
19 set iskeyword=@,48-57,_,.
25 " string enclosed in double quotes
26 syn region gString start=/"/ skip=/\\\\\|\\"/ end=/"/
27 " number with no fractional part or exponent
28 syn match gNumber /\d\+/
29 " floating point number with integer and fractional parts and optional exponent
30 syn match gFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
31 " floating point number with no integer part and optional exponent
32 syn match gFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
33 " floating point number with no fractional part and optional exponent
34 syn match gFloat /\d\+[Ee][-+]\=\d\+/
37 syn keyword gCommands add addobs addto adf append ar arch arma break boxplot chow coeffsum coint coint2 corc corr corrgm criteria critical cusum data delete diff else end endif endloop eqnprint equation estimate fcast fcasterr fit freq function funcerr garch genr gnuplot graph hausman hccm help hilu hsk hurst if import include info kpss label labels lad lags ldiff leverage lmtest logistic logit logs loop mahal meantest mle modeltab mpols multiply nls nulldata ols omit omitfrom open outfile panel pca pergm plot poisson pooled print printf probit pvalue pwe quit remember rename reset restrict rhodiff rmplot run runs scatters sdiff set setobs setmiss shell sim smpl spearman square store summary system tabprint testuhat tobit transpos tsls var varlist vartest vecm vif wls
40 syn keyword gGenrFunc log exp sin cos tan atan diff ldiff sdiff mean sd min max sort int ln coeff abs rho sqrt sum nobs firstobs lastobs normal uniform stderr cum missing ok misszero corr vcv var sst cov median zeromiss pvalue critical obsnum mpow dnorm cnorm gamma lngamma resample hpfilt bkfilt fracdiff varnum isvector islist nelem
43 " identifier with leading letter and optional following keyword characters
44 syn match gIdentifier /\a\k*/
46 " Variable with leading $
47 syn match gVariable /\$\k*/
52 syn match gDelimiter /[,;:]/
55 syn region gRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError,gBCstart,gBCend
56 syn region gRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
57 syn region gRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
58 syn match gError /[)\]}]/
59 syn match gBraceError /[)}]/ contained
60 syn match gCurlyError /[)\]]/ contained
61 syn match gParenError /[\]}]/ contained
64 syn match gComment /#.*/
65 syn match gBCstart /(\*/
66 syn match gBCend /\*)/
68 syn region gBlockComment matchgroup=gCommentStart start="(\*" end="\*)"
70 " Define the default highlighting.
71 " For version 5.7 and earlier: only when not done already
72 " For version 5.8 and later: only when an item doesn't have highlighting yet
73 if version >= 508 || !exists("did_r_syn_inits")
75 let did_r_syn_inits = 1
76 command -nargs=+ HiLink hi link <args>
78 command -nargs=+ HiLink hi def link <args>
80 HiLink gComment Comment
81 HiLink gCommentStart Comment
82 HiLink gBlockComment Comment
85 HiLink gBoolean Boolean
87 HiLink gCommands Repeat
89 HiLink gDelimiter Delimiter
91 HiLink gBraceError Error
92 HiLink gCurlyError Error
93 HiLink gParenError Error
94 HiLink gIdentifier Normal
95 HiLink gVariable Identifier
100 let b:current_syntax="gretl"