blob: 671142a9eaac3bcad642e0b14e8302a57b972973 [file] [log] [blame]
Bram Moolenaar4770d092006-01-12 23:22:24 +00001" Vim syntax file
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00002" Language: gretl (http://gretl.sf.net)
Bram Moolenaar4770d092006-01-12 23:22:24 +00003" Maintainer: Vaidotas Zemlys <zemlys@gmail.com>
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00004" Last Change: 2006 Apr 30
Bram Moolenaar4770d092006-01-12 23:22:24 +00005" Filenames: *.inp *.gretl
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00006" URL: http://uosis.mif.vu.lt/~zemlys/vim-syntax/gretl.vim
Bram Moolenaar4770d092006-01-12 23:22:24 +00007
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02008" quit when a syntax file was already loaded
9if exists("b:current_syntax")
Bram Moolenaar4770d092006-01-12 23:22:24 +000010 finish
11endif
12
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020013setlocal iskeyword=@,48-57,_,.
Bram Moolenaar4770d092006-01-12 23:22:24 +000014
15syn case match
16
17" Constant
18" string enclosed in double quotes
19syn region gString start=/"/ skip=/\\\\\|\\"/ end=/"/
20" number with no fractional part or exponent
21syn match gNumber /\d\+/
22" floating point number with integer and fractional parts and optional exponent
23syn match gFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
24" floating point number with no integer part and optional exponent
25syn match gFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
26" floating point number with no fractional part and optional exponent
27syn match gFloat /\d\+[Ee][-+]\=\d\+/
28
29" Gretl commands
30syn 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
31
32"Gretl genr functions
33syn 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
34
35" Identifier
36" identifier with leading letter and optional following keyword characters
37syn match gIdentifier /\a\k*/
38
39" Variable with leading $
40syn match gVariable /\$\k*/
41" Arrow
42syn match gArrow /<-/
43
44" Special
45syn match gDelimiter /[,;:]/
46
47" Error
48syn region gRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError,gBCstart,gBCend
49syn region gRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
50syn region gRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
51syn match gError /[)\]}]/
52syn match gBraceError /[)}]/ contained
53syn match gCurlyError /[)\]]/ contained
54syn match gParenError /[\]}]/ contained
55
56" Comment
57syn match gComment /#.*/
58syn match gBCstart /(\*/
59syn match gBCend /\*)/
60
61syn region gBlockComment matchgroup=gCommentStart start="(\*" end="\*)"
62
63" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020064" Only when an item doesn't have highlighting yet
Bram Moolenaarf37506f2016-08-31 22:22:10 +020065hi def link gComment Comment
66hi def link gCommentStart Comment
67hi def link gBlockComment Comment
68hi def link gString String
69hi def link gNumber Number
70hi def link gBoolean Boolean
71hi def link gFloat Float
72hi def link gCommands Repeat
73hi def link gGenrFunc Type
74hi def link gDelimiter Delimiter
75hi def link gError Error
76hi def link gBraceError Error
77hi def link gCurlyError Error
78hi def link gParenError Error
79hi def link gIdentifier Normal
80hi def link gVariable Identifier
81hi def link gArrow Repeat
Bram Moolenaar4770d092006-01-12 23:22:24 +000082
83let b:current_syntax="gretl"
84
85" vim: ts=8 sw=2