view runtime/syntax/gretl.vim @ 33988:7c30841c60a0 v9.0.2180

patch 9.0.2180: POSIX function name in exarg causes issues Commit: https://github.com/vim/vim/commit/6fdb6280821a822768df5689a5d727e37d38306c Author: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Date: Tue Dec 19 20:53:07 2023 +0100 patch 9.0.2180: POSIX function name in exarg causes issues Problem: POSIX function name in exarg struct causes issues on OpenVMS Solution: Rename getline member in exarg struct to ea_getline, remove isinf() workaround for VMS There are compilers that do not treat well POSIX functions - like getline - usage in the structs. Older VMS compilers could digest this... but the newer OpenVMS compilers ( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these structs. This could be limited to getline() that is defined via getdelim() and might not affect all POSIX functions in general - but avoiding POSIX function names usage in the structs is a "safe side" practice without compromising the functionality or the code readability. The previous OpenVMS X86 port used a workaround limiting the compiler capabilities using __CRTL_VER_OVERRIDE=80400000 In order to make the OpenVMS port future proof, this pull request proposes a possible solution. closes: #13704 Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Dec 2023 21:00:04 +0100
parents 46763b01cd9a
children
line wrap: on
line source

" Vim syntax file
" Language:	gretl (http://gretl.sf.net)
" Maintainer:	Vaidotas Zemlys <zemlys@gmail.com>
" Last Change:  2006 Apr 30
" Filenames:	*.inp *.gretl
" URL:	http://uosis.mif.vu.lt/~zemlys/vim-syntax/gretl.vim

" quit when a syntax file was already loaded
if exists("b:current_syntax")
  finish
endif

setlocal iskeyword=@,48-57,_,.

syn case match

" Constant
" string enclosed in double quotes
syn region gString start=/"/ skip=/\\\\\|\\"/ end=/"/
" number with no fractional part or exponent
syn match gNumber /\d\+/
" floating point number with integer and fractional parts and optional exponent
syn match gFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
" floating point number with no integer part and optional exponent
syn match gFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
" floating point number with no fractional part and optional exponent
syn match gFloat /\d\+[Ee][-+]\=\d\+/

" Gretl commands
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 

"Gretl genr functions
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 

" Identifier
" identifier with leading letter and optional following keyword characters
syn match gIdentifier /\a\k*/

"  Variable with leading $
syn match gVariable /\$\k*/
" Arrow
syn match gArrow /<-/

" Special
syn match gDelimiter /[,;:]/

" Error
syn region gRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError,gBCstart,gBCend
syn region gRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
syn region gRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
syn match gError      /[)\]}]/
syn match gBraceError /[)}]/ contained
syn match gCurlyError /[)\]]/ contained
syn match gParenError /[\]}]/ contained

" Comment
syn match gComment /#.*/
syn match gBCstart /(\*/
syn match gBCend /\*)/

syn region gBlockComment matchgroup=gCommentStart start="(\*" end="\*)"

" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link gComment      Comment
hi def link gCommentStart Comment
hi def link gBlockComment Comment
hi def link gString       String
hi def link gNumber       Number
hi def link gBoolean      Boolean
hi def link gFloat        Float
hi def link gCommands     Repeat	
hi def link gGenrFunc     Type
hi def link gDelimiter    Delimiter
hi def link gError        Error
hi def link gBraceError   Error
hi def link gCurlyError   Error
hi def link gParenError   Error
hi def link gIdentifier   Normal
hi def link gVariable     Identifier
hi def link gArrow	       Repeat

let b:current_syntax="gretl"

" vim: ts=8 sw=2