2023-10-03 11:14:36 +08:00
/ *
Language : Stata
Author : Brian Quistorff < bquistorff @ gmail . com >
Contributors : Drew McDonald < drewmcdo @ gmail . com >
Description : Stata is a general - purpose statistical software package created in 1985 by StataCorp .
Website : https : //en.wikipedia.org/wiki/Stata
Category : scientific
* /
/ *
This is a fork and modification of Drew McDonald ' s file ( https : //github.com/drewmcdonald/stata-highlighting). I have also included a list of builtin commands from https://bugs.kde.org/show_bug.cgi?id=135646.
* /
function stata ( hljs ) {
return {
name : 'Stata' ,
aliases : [
'do' ,
'ado'
] ,
case _insensitive : true ,
keywords : ' if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac _7 acprplot acprplot _7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova _estat anova _terms anovadef aorder ap app appe appen append arch arch _dr arch _estat arch _p archlm areg areg _p args arima arima _dr arima _estat arima _p as asmprobit asmprobit _estat asmprobit _lf asmprobit _mfx _ _dlg asmprobit _p ass asse asser assert avplot avplot _7 avplots avplots _7 bcskew0 bgodfrey bias binreg bip0 _lf biplot bipp _lf bipr _lf bipr _p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap _8 boxco _l boxco _p boxcox boxcox _6 boxcox _p bprobit br break brier bro brow brows browse brr brrstat bs bs _7 bsampl _w bsample bsample _7 bsqreg bstat bstat _7 bstat _8 bstrap bstrap _7 bubble bubbleplot ca ca _estat ca _p cabiplot camat canon canon _8 canon _8 _p canon _estat canon _p cap caprojection capt captu captur capture cat cc cchart cchart _7 cci cd censobs _table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog _lf clog _p clogi clogi _sw clogit clogit _lf clogit _p clogitp clogl _sw cloglog clonevar clslistarray cluster cluster _measures cluster _stop cluster _tree cluster _tree _8 clustermat cmdlog cnr cnre cnreg cnreg _p cnreg _sw cnsreg codebook collaps4 collapse colormult _nb colormult _nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr _anti corr _kmo corr _smc corre correl correla correlat correlate corrgram cou coun count cox cox _p cox _sw coxbase coxhaz coxvar cprplot cprplot _7 crc cret cretu cretur creturn cross cs cscript cscript _log csi ct ct _is ctset ctst _5 ctst _st cttost cumsp cumsp _7 cumul cusum cusum _7 cutil d | 0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di _g dir dirstats dis discard disp disp _res disp _s displ displa display distinct do doe doed doedi doedit dotplot dotplot _7 dprobit drawnorm drop ds ds _util dstdize duplicates durbina dwstat dydx e | 0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg _lf ereg _p ereg _sw ereghet ereghet _glf ereghet _glf _sh ereghet _gp ereghet _ilf ereghet _ilf _sh ereghet _ip eret eretu eretur ereturn err erro error esize est est _cfexist est _cfname est _clickable est _expand est _hold est _table est _unhold est _unholdok estat estat _default estat _summ estat _vce _only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor _estat factor _p factor _pca _rotated factor _rotate factormat fcast fcast _compute fcast _graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh _st file open file read file close file filefilter fillin find _hlp _file findfile findit findit _7 fit fl fli flis flist for5 _0 forest forestplot form forma format fpredict frac _154 frac _adj frac _chk frac _cox frac _ddp frac _dis frac _dv frac _in frac _mun frac _pp frac _pq frac _pv frac _wgt frac _xo fracgen fracplot fracplot _7 fracpoly fracpred fron _ex fron _hn fron _p fron _tn fron _tn2 frontier ftodate ftoe ftomdy ftowdate funnel funnelplot g | 0 gamhet _glf gamhet _gp gamhet _ilf gamhet _ip gamma gamma _d2 gamma _p gamma _sw gammahet gdi _hexagon gdi _spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder _7 glim _l01 glim _l02 glim _l03 glim _l04 glim _l05 glim _l06 glim _l07 glim _l08 glim _l09 glim _l10 glim _l11 glim _l12 glim _lf glim _mu glim _nw1 glim _nw2 glim _nw3 glim _p glim _v1 glim _v2 glim _v3 glim _v4 glim _v5 glim _v6 glim _v7 glm glm _6 glm _p glm _sw glmpred glo glob globa global glogit glogit _8 glogit _p gmeans gnbre _lf gnbreg gnbreg _5 gnbreg _p gomp _lf gompe _sw gomper _p gompertz gompertzhet gomphet _glf gomphet _glf _sh gomphet _gp gomphet _ilf gomphet _ilf _sh gomphet _ip gphdot gphpen gphprint gprefs gprobi _p gprobit gprobit _8 gr gr7 gr _copy gr _current
contains : [
{
className : 'symbol' ,
begin : /`[a-zA-Z0-9_]+'/
} ,
{
className : 'variable' ,
begin : /\$\{?[a-zA-Z0-9_]+\}?/ ,
relevance : 0
} ,
{
className : 'string' ,
variants : [
{ begin : '`"[^\r\n]*?"\'' } ,
{ begin : '"[^\r\n"]*"' }
]
} ,
{
className : 'built_in' ,
variants : [ { begin : '\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()' } ]
} ,
hljs . COMMENT ( '^[ \t]*\\*.*$' , false ) ,
hljs . C _LINE _COMMENT _MODE ,
hljs . C _BLOCK _COMMENT _MODE
]
} ;
}
module . exports = stata ;