239
239
(modify-syntax-entry ?/ ". 14" SAS-syntax-table) ; comment character
240
240
(modify-syntax-entry ?. "w" SAS-syntax-table))
242
(if (or window-system
243
noninteractive) ; compilation!
247
(defvar SAS-mode-font-lock-keywords
248
(if ess-sas-run-make-regexp
251
(cons "^[ \t]*%?\\*.*;" font-lock-comment-face)
252
(cons ";[ \t]*%?\\*.*;" font-lock-comment-face)
253
(list "/\\*\\([^*/]\\)*\\*/" 0 font-lock-comment-face t)
255
;; SAS execution blocks, DATA/RUN, PROC/RUN, %MACRO/%MEND
256
(cons "\\<\\(data\\|run\\|%macro\\|%mend\\)\\>" font-lock-reference-face)
257
(cons "\\<proc[ \t]+[a-z][a-z_0-9]+" font-lock-reference-face)
263
"%?do[ \t]*" (make-regexp '("over" "%?until" "%?while") t) "?"
265
font-lock-keyword-face)
271
"abort" "array" "attrib" "by" "delete" "display" "dm"
272
"drop" "error" "file" "filename" "footnote\\(10?\\|[2-9]\\)?"
274
"%go[ \t]*to" "%if" "%then" "%else"
275
"go[ \t]*to" "if" "then" "else"
276
"infile" "informat" "input" "%input" "keep" "label"
277
"length" "libname" "link"
278
"merge" "missing" "modify" "note" "options" "goptions" "output"
279
"otherwise" "put" "%put" "rename" "retain" "select" "when" "set"
280
"skip" "title\\(10?\\|[2-9]\\)?" "where" "window" "update" "out"
281
"change" "class" "exchange" "exclude" "freq" "id" "index"
282
"model" "plot" "save" "sum" "tables?" "var" "weight" "with"
283
"manova" "repeated" "value" "random" "means" "lsmeans"
284
;; SAS macro statements not handled above
285
"%global" "%include" "%local" "%let" "%sysexec"
287
font-lock-keyword-face)
289
;; SAS statements that must be followed by a semi-colon
294
"cards4?" "end" "%end" "endsas" "list" "lostcard" "page"
296
) t) "\\>" "[ \t]*;")
297
font-lock-keyword-face)
299
;; SAS/GRAPH statements not handled above
303
'("axis" "legend" "pattern" "symbol") t) "\\([1-9][0-9]?\\)?"
305
font-lock-keyword-face)
307
;; SAS functions and SAS macro functions
308
(cons "%[a-z_][a-z_0-9]*[ \t]*[(;]"
309
font-lock-function-name-face)
310
(cons "\\<call[ \t]+[a-z_][a-z_0-9]*[ \t]*("
311
font-lock-function-name-face)
317
"abs" "arcos" "arsin" "atan" "betainv" "byte" "ceil" "cinv"
318
"collate" "compress" "cosh?" "css" "cv"
319
"daccdb" "daccdbsl" "daccsl" "daccsyd" "dacctab"
320
"depdb" "depdbsl" "depsl" "depsyd" "deptab"
321
"date" "datejul" "datepart" "datetime" "day" "hms" "dhms" "dif"
322
"digamma" "dim" "erfc?" "exp" "finv"
323
"fipnamel?" "fipstate" "floor" "fuzz" "gaminv" "gamma"
324
"hbound" "hour" "indexc?" "input" "int" "intck" "intnx" "intrr"
325
"irr" "juldate" "kurtosis" "lag" "lbound" "left" "length"
326
"lgamma" "log" "log10" "log2" "max" "mdy" "mean" "min" "minute"
327
"mod" "month" "mort" "n" "netpv" "nmiss" "normal" "npv"
242
(require 'font-lock); fontification also works in terminals!
243
;; (if (or window-system
244
;; noninteractive) ; compilation!
248
(defvar SAS-mode-font-lock-keywords
249
(if ess-sas-run-make-regexp
252
(cons "^[ \t]*%?\\*.*;" font-lock-comment-face)
253
(cons ";[ \t]*%?\\*.*;" font-lock-comment-face)
254
(list "/\\*\\([^*/]\\)*\\*/" 0 font-lock-comment-face t)
256
;; SAS execution blocks, DATA/RUN, PROC/RUN, %MACRO/%MEND
257
(cons "\\<\\(data\\|run\\|%macro\\|%mend\\)\\>" font-lock-constant-face)
258
(cons "\\<proc[ \t]+[a-z][a-z_0-9]+" font-lock-constant-face)
264
"%?do[ \t]*" (make-regexp '("over" "%?until" "%?while") t) "?"
266
font-lock-keyword-face)
272
"abort" "array" "attrib" "by" "delete" "display" "dm"
273
"drop" "error" "file" "filename" "footnote\\(10?\\|[2-9]\\)?"
275
"%go[ \t]*to" "%if" "%then" "%else"
276
"go[ \t]*to" "if" "then" "else"
277
"infile" "informat" "input" "%input" "keep" "label"
278
"length" "libname" "link"
279
"merge" "missing" "modify" "note" "options" "goptions" "output"
280
"otherwise" "put" "%put" "rename" "retain" "select" "when" "set"
281
"skip" "title\\(10?\\|[2-9]\\)?" "where" "window" "update" "out"
282
"change" "class" "exchange" "exclude" "freq" "id" "index"
283
"model" "plot" "save" "sum" "tables?" "var" "weight" "with"
284
"manova" "repeated" "value" "random" "means" "lsmeans"
285
;; SAS macro statements not handled above
286
"%global" "%include" "%local" "%let" "%sysexec"
288
font-lock-keyword-face)
290
;; SAS statements that must be followed by a semi-colon
295
"cards4?" "end" "%end" "endsas" "list" "lostcard" "page"
297
) t) "\\>" "[ \t]*;")
298
font-lock-keyword-face)
300
;; SAS/GRAPH statements not handled above
304
'("axis" "legend" "pattern" "symbol") t) "\\([1-9][0-9]?\\)?"
306
font-lock-keyword-face)
308
;; SAS functions and SAS macro functions
309
(cons "%[a-z_][a-z_0-9]*[ \t]*[(;]"
310
font-lock-function-name-face)
311
(cons "\\<call[ \t]+[a-z_][a-z_0-9]*[ \t]*("
312
font-lock-function-name-face)
318
"abs" "arcos" "arsin" "atan" "betainv" "byte" "ceil" "cinv"
319
"collate" "compress" "cosh?" "css" "cv"
320
"daccdb" "daccdbsl" "daccsl" "daccsyd" "dacctab"
321
"depdb" "depdbsl" "depsl" "depsyd" "deptab"
322
"date" "datejul" "datepart" "datetime" "day" "hms" "dhms" "dif"
323
"digamma" "dim" "erfc?" "exp" "finv"
324
"fipnamel?" "fipstate" "floor" "fuzz" "gaminv" "gamma"
325
"hbound" "hour" "indexc?" "input" "int" "intck" "intnx" "intrr"
326
"irr" "juldate" "kurtosis" "lag" "lbound" "left" "length"
327
"lgamma" "log" "log10" "log2" "max" "mdy" "mean" "min" "minute"
328
"mod" "month" "mort" "n" "netpv" "nmiss" "normal" "npv"
328
329
;;;) t) "\\>" "[ \t]*(")
329
330
;;; font-lock-function-name-face)
331
332
;;; (cons (concat "\\<"
332
333
;;;(make-regexp '(
333
"probbeta" "probbnml" "probchi" "probf" "probgam" "probhypr"
334
"probit" "probnegb" "probnorm" "probt"
335
"ordinal" "poisson" "put" "qtr" "range" "rank" "repeat"
336
"ranbin" "rancau" "ranexp" "rangam" "rannor" "ranpoi"
337
"rantbl" "rantri" "ranuni"
338
"reverse" "right" "round" "saving" "scan" "second" "sign" "sinh?"
339
"sqrt" "std" "stderr" "stfips" "stnamel?" "substr" "sum"
340
"symget" "tanh?" "time" "timepart" "tinv" "today" "translate"
341
"trigamma" "trim" "trunc" "uniform" "upcase" "uss" "var"
342
"verify" "weekday" "year" "yyq"
343
"zipfips" "zipnamel?" "zipstate"
334
"probbeta" "probbnml" "probchi" "probf" "probgam" "probhypr"
335
"probit" "probnegb" "probnorm" "probt"
336
"ordinal" "poisson" "put" "qtr" "range" "rank" "repeat"
337
"ranbin" "rancau" "ranexp" "rangam" "rannor" "ranpoi"
338
"rantbl" "rantri" "ranuni"
339
"reverse" "right" "round" "saving" "scan" "second" "sign" "sinh?"
340
"sqrt" "std" "stderr" "stfips" "stnamel?" "substr" "sum"
341
"symget" "tanh?" "time" "timepart" "tinv" "today" "translate"
342
"trigamma" "trim" "trunc" "uniform" "upcase" "uss" "var"
343
"verify" "weekday" "year" "yyq"
344
"zipfips" "zipnamel?" "zipstate"
344
345
;;;) t) "\\>" "[ \t]*(")
345
346
;;; font-lock-function-name-face)
349
350
;;; ;; SCL functions that are known to work with SAS macro function %sysfunc
350
351
;;; (cons (concat "\\<"
351
352
;;;(make-regexp '(
352
"airy" "band" "blshift" "brshift" "bnot" "bor" "bxor"
353
"cnonct" "fnonct" "tnonct" "compbl" "dairy" "dequote"
355
"indexw" "inputc" "inputn" "lowcase"
356
"putc" "putn" "quote" "resolve" "soundex" "sysprod"
358
"%sysfunc" "attrc" "attrn" "cexist" "close" "dclose" "dnum"
359
"dopen" "dread" "exist" "fclose" "fetchobs" "fileexist"
360
"finfo" "fopen" "fput" "fwrite" "getoption"
361
"getvarc" "getvarn" "libname" "libref" "open" "optgetn" "optsetn"
362
"pathname" "sysmsg" "varfmt" "varlabel" "varnum" "vartype"
363
) t) "\\>" "[ \t]*(")
364
font-lock-function-name-face)
367
;; .log NOTE: messages
368
(cons "^NOTE: .*$" font-lock-reference-face)
370
;; .log ERROR: messages
371
(cons "^ERROR: .*$" font-lock-keyword-face)
373
;; .log WARNING: messages
374
(cons "^WARNING: .*$" font-lock-function-name-face)
377
;; /* */ handled by grammar above
378
;; (list "/\\*.*\\*/" 0 font-lock-comment-face t)
379
(cons "\\(^[0-9]*\\|;\\)[ \t]*\\(%?\\*\\|comment\\).*\\(;\\|$\\)" font-lock-comment-face)
381
;; SAS execution blocks, DATA/RUN, PROC/RUN, SAS Macro Statements
382
(cons "\\<%do[ \t]*\\(%until\\|%while\\)?\\>"
383
font-lock-reference-face)
384
;;(cons (concat "\\(^[0-9]*\\|;\\)[ \t]*"
385
;;"%\\(end\\|global\\|local\\|m\\(acro\\|end\\)\\)"
386
;;"\\>") font-lock-reference-face)
387
(cons "\\<%\\(end\\|global\\|local\\|m\\(acro\\|end\\)\\)\\>"
388
font-lock-reference-face)
390
(cons (concat "\\(^[0-9]*\\|;\\|):\\|%then\\|%else\\)[ \t]*"
391
"\\(data\\|endsas\\|finish\\|quit\\|run\\|start\\)[ \t\n;]")
392
font-lock-reference-face)
393
(cons (concat "\\(^[0-9]*\\|;\\|):\\|%then\\|%else\\)[ \t]*"
394
"proc[ \t]+[a-z][a-z_0-9]+") font-lock-reference-face)
396
;;(cons (concat "\\(^[0-9]*\\|;\\|%then\\|%else\\)[ \t]*"
397
;;"\\(%\\(go[ \t]*to\\|i\\(f\\|n\\(clude\\|put\\)\\)\\|let\\|put\\|sysexec\\)\\)"
398
;;"\\>") font-lock-reference-face)
399
(cons "\\<%\\(go[ \t]*to\\|i\\(f\\|n\\(clude\\|put\\)\\)\\|let\\|put\\|sysexec\\)\\>"
400
font-lock-reference-face)
402
(cons "\\<%\\(by\\|else\\|t\\(o\\|hen\\)\\)\\>"
403
font-lock-reference-face)
405
;; SAS dataset options/PROC statements followed by an equal sign/left parentheses
409
"\\(attrib\\|by\\|compress\\|d\\(ata\\|rop\\)\\|f\\(irstobs\\|ormat\\)"
410
"\\|i\\(d\\|f\\|n\\)\\|ke\\(ep\\|y\\)\\|l\\(abel\\|ength\\)"
411
"\\|o\\(bs\\|rder\\|ut\\)\\|rename\\|s\\(ortedby\\|plit\\)"
414
font-lock-keyword-face)
415
(cons "\\<\\(in\\(:\\|dex[ \t]*=\\)?\\|until\\|wh\\(en\\|ile\\)\\)[ \t]*("
416
font-lock-keyword-face)
420
"\\(^[0-9]*\\|):\\|[;,]\\|then\\|else\\)[ \t]*"
421
"\\(a\\(bort\\|rray\\|ttrib\\)\\|by"
422
"\\|c\\(hange\\|lass\\|ontrast\\)"
423
"\\|d\\(elete\\|isplay\\|m\\|o\\([ \t]+\\(data\\|over\\)\\)?\\|rop\\)"
424
"\\|e\\(rror\\|stimate\\|xc\\(hange\\|lude\\)\\)"
425
"\\|f\\(ile\\(name\\)?\\|o\\(otnote\\(10?\\|[2-9]\\)?\\|rmat\\)\\|req\\)"
426
"\\|go\\([ \t]*to\\|ptions\\)"
427
"\\|i\\(d\\|f\\|n\\(dex\\|f\\(ile\\|ormat\\)\\|put\\|value\\)\\)"
428
"\\|keep\\|l\\(abel\\|ength\\|i\\(bname\\|nk\\|st\\)\\|smeans\\)"
429
"\\|m\\(anova\\|e\\(ans\\|rge\\)\\|issing\\|od\\(el\\|ify\\)\\)\\|note"
430
"\\|o\\(ptions\\|therwise\\|utput\\)\\|p\\(arms\\|lot\\|ut\\)"
431
"\\|r\\(andom\\|e\\(name\\|peated\\|tain\\)\\)"
432
"\\|s\\(ave\\|e\\(lect\\|t\\)\\|kip\\|trata\\|umby\\)"
433
"\\|t\\(ables?\\|i\\(me\\|tle\\(10?\\|[2-9]\\)?\\)\\)\\|update"
434
"\\|va\\(lue\\|r\\)\\|w\\(eight\\|here\\|i\\(ndow\\|th\\)\\)"
436
;; IML statements that are not also SAS statements
437
"\\|append\\|c\\(lose\\(file\\)?\\|reate\\)\\|edit\\|f\\(ind\\|orce\\|ree\\)"
438
"\\|insert\\|load\\|mattrib\\|p\\(a[ru]se\\|rint\\|urge\\)"
439
"\\|re\\(move\\|peat\\|place\\|set\\|sume\\)"
440
"\\|s\\(et\\(in\\|out\\)\\|how\\|ort\\|tore\\|ummary\\)\\|use\\)?"
442
"\\>") font-lock-keyword-face)
446
;; (cons "\\<\\(\\(then\\|else\\)[ \t]*\\)?\\(do\\([ \t]*over\\)?\\|else\\)\\>"
447
;; font-lock-keyword-face)
449
;; SAS statements that must be followed by a semi-colon
451
"\\(^[0-9]*\\|):\\|[;,]\\|then\\|else\\)[ \t]*"
452
"\\(cards4?\\|datalines\\|end\\|l\\(ostcard\\)\\|page\\|return\\|stop\\)?"
453
"[ \t]*;") font-lock-keyword-face)
455
;; SAS/GRAPH statements not handled above
457
"\\(^[0-9]*\\|):\\|[;,]\\)[ \t]*"
458
"\\(axis\\|legend\\|pattern\\|symbol\\)"
459
"\\([1-9][0-9]?\\)?\\>") font-lock-keyword-face)
461
;; SAS Datastep functions and SAS macro functions
462
;(cons "%[a-z_][a-z_0-9]*[ \t]*[(;]"
463
;; SAS macro functions occasionally defined with no arguments
464
(cons "%[a-z_][a-z_0-9]*[ \t();,]"
465
font-lock-function-name-face)
466
(cons "\\<call[ \t]+[a-z_][a-z_0-9]*[ \t]*("
467
font-lock-function-name-face)
471
"\\(a\\(bs\\|r\\(cos\\|sin\\)\\|tan\\)\\|b\\(etainv\\|yte\\)"
472
"\\|c\\(eil\\|inv\\|o\\(llate\\|mpress\\|sh?\\)\\|ss\\|v\\)"
473
"\\|dacc\\(db\\(\\|sl\\)\\|s\\(l\\|yd\\)\\|tab\\)"
474
"\\|dep\\(db\\(\\|sl\\)\\|s\\(l\\|yd\\)\\|tab\\)"
475
"\\|d\\(a\\(te\\(\\|jul\\|part\\|time\\)\\|y\\)\\|hms\\|i\\([fm]\\|gamma\\)\\)"
476
"\\|e\\(rfc?\\|xp\\)"
477
"\\|f\\(i\\(nv\\|p\\(namel?\\|state\\)\\)\\|loor\\|uzz\\)\\|gam\\(inv\\|ma\\)"
478
"\\|h\\(bound\\|ms\\|our\\)\\|i\\(n\\(dexc?\\|put\\|t\\(\\|ck\\|nx\\|rr\\)\\)\\|rr\\)"
479
"\\|juldate\\|kurtosis\\|l\\(ag\\|bound\\|e\\(ft\\|ngth\\)\\|gamma\\|og\\(\\|10\\|2\\)\\)"
480
"\\|m\\(ax\\|dy\\|ean\\|in\\(\\|ute\\)\\|o\\(d\\|nth\\|rt\\)\\)\\|n\\(\\|etpv\\|miss\\|ormal\\|pv\\)"
481
"\\|prob\\([ft]\\|b\\(eta\\|nml\\)\\|chi\\|gam\\|hypr\\|it\\|n\\(egb\\|orm\\)\\)"
482
"\\|ordinal\\|p\\(oisson\\|ut\\)\\|qtr\\|r\\(e\\(peat\\|verse\\)\\|ight\\|ound\\)"
483
"\\|ran\\(bin\\|cau\\|exp\\|g\\(am\\|e\\)\\|k\\|nor\\|poi\\|t\\(bl\\|ri\\)\\|uni\\)"
484
"\\|s\\(aving\\|can\\|econd\\|i\\(gn\\|nh?\\)\\|qrt\\|t\\(d\\(\\|err\\)\\|fips\\|namel?\\)\\|u\\(bstr\\|m\\)\\|ymget\\)"
485
"\\|t\\(anh?\\|i\\(me\\(\\|part\\)\\|nv\\)\\|oday\\|r\\(anslate\\|i\\(gamma\\|m\\)\\|unc\\)\\)"
486
"\\|u\\(niform\\|pcase\\|ss\\)\\|v\\(ar\\|erify\\)"
487
"\\|weekday\\|y\\(ear\\|yq\\)\\|zip\\(fips\\|namel?\\|state\\)"
353
"airy" "band" "blshift" "brshift" "bnot" "bor" "bxor"
354
"cnonct" "fnonct" "tnonct" "compbl" "dairy" "dequote"
356
"indexw" "inputc" "inputn" "lowcase"
357
"putc" "putn" "quote" "resolve" "soundex" "sysprod"
359
"%sysfunc" "attrc" "attrn" "cexist" "close" "dclose" "dnum"
360
"dopen" "dread" "exist" "fclose" "fetchobs" "fileexist"
361
"finfo" "fopen" "fput" "fwrite" "getoption"
362
"getvarc" "getvarn" "libname" "libref" "open" "optgetn" "optsetn"
363
"pathname" "sysmsg" "varfmt" "varlabel" "varnum" "vartype"
364
) t) "\\>" "[ \t]*(")
365
font-lock-function-name-face)
368
;; .log NOTE: messages
369
(cons "^NOTE: .*$" font-lock-constant-face)
371
;; .log ERROR: messages
372
(cons "^ERROR: .*$" font-lock-keyword-face)
374
;; .log WARNING: messages
375
(cons "^WARNING: .*$" font-lock-function-name-face)
378
;; /* */ handled by grammar above
379
;; (list "/\\*.*\\*/" 0 font-lock-comment-face t)
380
(cons "\\(^[0-9]*\\|;\\)[ \t]*\\(%?\\*\\|comment\\).*\\(;\\|$\\)" font-lock-comment-face)
382
;; SAS execution blocks, DATA/RUN, PROC/RUN, SAS Macro Statements
383
(cons "\\<%do[ \t]*\\(%until\\|%while\\)?\\>"
384
font-lock-constant-face)
385
;;(cons (concat "\\(^[0-9]*\\|;\\)[ \t]*"
386
;;"%\\(end\\|global\\|local\\|m\\(acro\\|end\\)\\)"
387
;;"\\>") font-lock-constant-face)
388
(cons "\\<%\\(end\\|global\\|local\\|m\\(acro\\|end\\)\\)\\>"
389
font-lock-constant-face)
391
(cons (concat "\\(^[0-9]*\\|;\\|):\\|%then\\|%else\\)[ \t]*"
392
"\\(data\\|endsas\\|finish\\|quit\\|run\\|start\\)[ \t\n;]")
393
font-lock-constant-face)
394
(cons (concat "\\(^[0-9]*\\|;\\|):\\|%then\\|%else\\)[ \t]*"
395
;;"proc[ \t]+[a-z][a-z_0-9]+") font-lock-constant-face)
397
;;SAS/Base, SAS/Graph, SAS/FSP and common add-ons
399
"\\|c\\(a\\(lendar\\|talog\\)\\|port\\|o\\(mpare\\|ntents\\|py\\|rr\\)\\)"
400
"\\|d\\(atasets\\|bcstab\\|isplay\\)\\|ex\\(plode\\|port\\)"
401
"\\|f\\(orm\\(at\\|s\\)\\|req\\|s\\(browse\\|edit\\|l\\(etter\\|ist\\)\\|view\\)\\)"
402
"\\|g?\\(chart\\|p\\(lot\\|rint\\)\\)"
403
"\\|g\\(anno\\|contour\\|device\\|font\\|\\(key\\)?map\\|options\\|project"
404
"\\|re\\(duce\\|move\\|play\\)\\|slide\\|testit\\|3\\(d\\|grid\\)\\)"
405
"\\|[cg]?import\\|i\\(ml\\|nsight\\)\\|means\\|options\\|p\\(menu\\|rintto\\)"
406
"\\|r\\(ank\\|e\\(gistry\\|port\\)\\)"
407
"\\|s\\(ort\\|ql\\|tandard\\|ummary\\)"
408
"\\|t\\(abulate\\|imeplot\\|ran\\(spose\\|tab\\)\\)\\|univariate"
409
;;SAS/Stat and SAS/ETS
410
"\\|a\\(ceclus\\|nova\\|rima\\|utoreg\\)\\|boxplot"
411
"\\|c\\(a\\(lis\\|n\\(corr\\|disc\\)\\|tmod\\)\\|itibase\\|luster\\|o\\(mputab\\|rresp\\)\\)"
412
"\\|discrim\\|expand\\|f\\(a\\(ctor\\|stclus\\)\\|orecast\\|req\\)"
413
"\\|g\\(enmod\\|lm\\(mod\\|power\\)?\\)\\|inbreed\\|k\\(de\\|rige2d\\)"
414
"\\|l\\(attice\\|ife\\(reg\\|test\\)\\|o\\(ess\\|gistic\\)\\)"
415
"\\|m\\(ds\\|ixed\\|o\\(de\\(clus\\|l\\)\\|rtgage\\)\\|ulttest\\)"
416
"\\|n\\(ested\\|l\\(in\\|mixed\\)\\|par1way\\)\\|orthoreg"
417
"\\|p\\(dlreg\\|hreg\\|l\\(an\\|s\\)\\|ower\\|r\\(in\\(comp\\|qual\\)\\|obit\\)\\)\\|rs?reg"
418
"\\|s\\(core\\|im\\(2d\\|lin\\)\\|pectra\\|t\\(atespace\\|dize\\|epdisc\\)\\|urvey\\(means\\|reg\\|select\\)\\|yslin\\)"
419
"\\|t\\(phreg\\|pspline\\|r\\(ansreg\\|ee\\)\\|test\\)"
420
"\\|var\\(clus\\|comp\\|iogram\\)\\|x11"
421
"\\)") font-lock-constant-face)
423
;;(cons (concat "\\(^[0-9]*\\|;\\|%then\\|%else\\)[ \t]*"
424
;;"\\(%\\(go[ \t]*to\\|i\\(f\\|n\\(clude\\|put\\)\\)\\|let\\|put\\|sysexec\\)\\)"
425
;;"\\>") font-lock-constant-face)
426
(cons "\\<%\\(go[ \t]*to\\|i\\(f\\|n\\(clude\\|put\\)\\)\\|let\\|put\\|sysexec\\)\\>"
427
font-lock-constant-face)
429
(cons "\\<%\\(by\\|else\\|t\\(o\\|hen\\)\\)\\>"
430
font-lock-constant-face)
432
;; SAS dataset options/PROC statements followed by an equal sign/left parentheses
436
"\\(attrib\\|by\\|compress\\|d\\(ata\\|rop\\)\\|f\\(irstobs\\|ormat\\)"
437
"\\|i\\(d\\|f\\|n\\)\\|ke\\(ep\\|y\\)\\|l\\(abel\\|ength\\)"
438
"\\|o\\(bs\\|rder\\|ut\\)\\|rename\\|s\\(ortedby\\|plit\\)"
441
font-lock-keyword-face)
442
(cons "\\<\\(in\\(:\\|dex[ \t]*=\\)?\\|until\\|wh\\(en\\|ile\\)\\)[ \t]*("
443
font-lock-keyword-face)
447
"\\(^[0-9]*\\|):\\|[;,]\\|then\\|else\\)[ \t]*"
448
"\\(a\\(bort\\|rray\\|ttrib\\)\\|by"
449
"\\|c\\(hange\\|lass\\|ontrast\\)"
450
"\\|d\\(elete\\|isplay\\|m\\|o\\([ \t]+\\(data\\|over\\)\\)?\\|rop\\)"
451
"\\|e\\(rror\\|stimate\\|xc\\(hange\\|lude\\)\\)"
452
"\\|f\\(ile\\(name\\)?\\|o\\(otnote\\(10?\\|[2-9]\\)?\\|rmat\\)\\|req\\)"
453
"\\|go\\([ \t]*to\\|ptions\\)"
454
"\\|[hv]bar\\(3d\\)?"
455
"\\|i\\(d\\|f\\|n\\(dex\\|f\\(ile\\|ormat\\)\\|put\\|value\\)\\)"
456
"\\|keep\\|l\\(abel\\|ength\\|i\\(bname\\|nk\\|st\\)\\|smeans\\)"
457
"\\|m\\(anova\\|e\\(ans\\|rge\\)\\|issing\\|od\\(el\\|ify\\)\\)\\|note"
458
"\\|o\\(ptions\\|therwise\\|utput\\)\\|p\\(arms\\|lot2?\\|ut\\)"
459
"\\|r\\(andom\\|e\\(name\\|peated\\|tain\\)\\)"
460
"\\|s\\(ave\\|e\\(lect\\|t\\)\\|kip\\|trata\\|umby\\)"
461
"\\|t\\(ables?\\|i\\(me\\|tle\\(10?\\|[2-9]\\)?\\)\\)\\|update"
462
"\\|va\\(lue\\|r\\)\\|w\\(eight\\|here\\|i\\(ndow\\|th\\)\\)"
464
;; IML statements that are not also SAS statements
465
"\\|append\\|c\\(lose\\(file\\)?\\|reate\\)\\|edit\\|f\\(ind\\|orce\\|ree\\)"
466
"\\|insert\\|load\\|mattrib\\|p\\(a[ru]se\\|rint\\|urge\\)"
467
"\\|re\\(move\\|peat\\|place\\|set\\|sume\\)"
468
"\\|s\\(et\\(in\\|out\\)\\|how\\|ort\\|tore\\|ummary\\)\\|use\\)?"
470
"\\>") font-lock-keyword-face)
474
;; (cons "\\<\\(\\(then\\|else\\)[ \t]*\\)?\\(do\\([ \t]*over\\)?\\|else\\)\\>"
475
;; font-lock-keyword-face)
477
;; SAS statements that must be followed by a semi-colon
479
"\\(^[0-9]*\\|):\\|[;,]\\|then\\|else\\)[ \t]*"
480
"\\(cards4?\\|datalines\\|end\\|l\\(ostcard\\)\\|page\\|return\\|stop\\)?"
481
"[ \t]*;") font-lock-keyword-face)
483
;; SAS/GRAPH statements not handled above
485
"\\(^[0-9]*\\|):\\|[;,]\\)[ \t]*"
486
"\\(axis\\|legend\\|pattern\\|symbol\\)"
487
"\\([1-9][0-9]?\\)?\\>") font-lock-keyword-face)
489
;; SAS Datastep functions and SAS macro functions
490
;(cons "%[a-z_][a-z_0-9]*[ \t]*[(;]"
491
;; SAS macro functions occasionally defined with no arguments
492
;; which means they can be followed by any character that can
493
;; separate tokens, however, they are most likely to be followed
494
;; by operat-ions/ors
495
(cons "%[a-z_][a-z_0-9]*[- \t();,+*/=<>]"
496
font-lock-function-name-face)
497
(cons "\\<call[ \t]+[a-z_][a-z_0-9]*[ \t]*("
498
font-lock-function-name-face)
502
"\\(a\\(bs\\|r\\(cos\\|sin\\)\\|tan\\)\\|b\\(etainv\\|yte\\)"
503
"\\|c\\(eil\\|inv\\|o\\(llate\\|mpress\\|sh?\\)\\|ss\\|v\\)"
504
"\\|dacc\\(db\\(\\|sl\\)\\|s\\(l\\|yd\\)\\|tab\\)"
505
"\\|dep\\(db\\(\\|sl\\)\\|s\\(l\\|yd\\)\\|tab\\)"
506
"\\|d\\(a\\(te\\(\\|jul\\|part\\|time\\)\\|y\\)\\|hms\\|i\\(f[0-9]*\\|m\\|gamma\\)\\)"
507
"\\|e\\(rfc?\\|xp\\)"
508
"\\|f\\(i\\(nv\\|p\\(namel?\\|state\\)\\)\\|loor\\|uzz\\)\\|gam\\(inv\\|ma\\)"
509
"\\|h\\(bound\\|ms\\|our\\)\\|i\\(n\\(dexc?\\|put\\|t\\(\\|ck\\|nx\\|rr\\)\\)\\|rr\\)"
510
"\\|juldate\\|kurtosis\\|l\\(ag[0-9]*\\|bound\\|e\\(ft\\|ngth\\)\\|gamma\\|og\\(\\|10\\|2\\)\\)"
511
"\\|m\\(ax\\|dy\\|ean\\|in\\(\\|ute\\)\\|o\\(d\\|nth\\|rt\\)\\)\\|n\\(\\|etpv\\|miss\\|ormal\\|pv\\)"
512
"\\|prob\\([ft]\\|b\\(eta\\|nml\\)\\|chi\\|gam\\|hypr\\|it\\|n\\(egb\\|orm\\)\\)"
513
"\\|ordinal\\|p\\(oisson\\|ut\\)\\|qtr\\|r\\(e\\(peat\\|verse\\)\\|ight\\|ound\\)"
514
"\\|ran\\(bin\\|cau\\|exp\\|g\\(am\\|e\\)\\|k\\|nor\\|poi\\|t\\(bl\\|ri\\)\\|uni\\)"
515
"\\|s\\(aving\\|can\\|econd\\|i\\(gn\\|nh?\\)\\|qrt\\|t\\(d\\(\\|err\\)\\|fips\\|namel?\\)\\|u\\(bstr\\|m\\)\\|ymget\\)"
516
"\\|t\\(anh?\\|i\\(me\\(\\|part\\)\\|nv\\)\\|oday\\|r\\(anslate\\|i\\(gamma\\|m\\)\\|unc\\)\\)"
517
"\\|u\\(niform\\|pcase\\|ss\\)\\|v\\(ar\\|erify\\)"
518
"\\|weekday\\|y\\(ear\\|yq\\)\\|zip\\(fips\\|namel?\\|state\\)"
489
520
;;; ;; SAS functions introduced in Technical Report P-222
491
"\\|airy\\|b\\(and\\|lshift\\|not\\|or\\|rshift\\|xor\\)"
492
"\\|c\\(nonct\\|ompbl\\)\\|d\\(airy\\|equote\\)\\|fnonct\\|tnonct"
493
"\\|i\\(bessel\\|n\\(dexw\\|put[cn]\\)\\)\\|jbessel\\|put[cn]"
494
"\\|lowcase\\|quote\\|resolve\\|s\\(oundex\\|ysprod\\)\\|tr\\(anwrd\\|imn\\)"
522
"\\|airy\\|b\\(and\\|lshift\\|not\\|or\\|rshift\\|xor\\)"
523
"\\|c\\(nonct\\|ompbl\\)\\|d\\(airy\\|equote\\)\\|fnonct\\|tnonct"
524
"\\|i\\(bessel\\|n\\(dexw\\|put[cn]\\)\\)\\|jbessel\\|put[cn]"
525
"\\|lowcase\\|quote\\|resolve\\|s\\(oundex\\|ysprod\\)\\|tr\\(anwrd\\|imn\\)"
496
527
;;; ;; IML functions that are not also Datastep functions
497
"\\|a\\(ll\\|ny\\|pply\\|rmasim\\)\\|b\\(lock\\|ranks\\|tran\\)"
498
"\\|c\\(har\\|hoose\\|on\\(cat\\|tents\\|vexit\\|vmod\\)\\|ovlag\\|shape\\|usum\\|vexhull\\)"
499
"\\|d\\(atasets\\|esignf?\\|et\\|iag\\|o\\|uration\\)"
500
"\\|e\\(chelon\\|igv\\(al\\|ec\\)\\)\\|f\\(ft\\|orward\\)\\|ginv"
501
"\\|h\\(alf\\|ankel\\|dir\\|ermite\\|omogen\\)"
502
"\\|i\\(\\|fft\\|nsert\\|nv\\(updt\\)?\\)\\|j\\(\\|root\\)\\|loc\\|mad"
503
"\\|n\\(ame\\|col\\|leng\\|row\\|um\\)\\|o\\(pscal\\|rpol\\)"
504
"\\|p\\(olyroot\\|roduct\\|v\\)\\|r\\(anktie\\|ates\\|atio\\|emove\\|eturn\\|oot\\|owcatc?\\)"
505
"\\|s\\(etdif\\|hape\\|olve\\|plinev\\|pot\\|qrsym\\|ssq\\|torage\\|weep\\|ymsqr\\)"
506
"\\|t\\(\\|eigv\\(al\\|ec\\)\\|oeplitz\\|race\\|risolv\\|ype\\)"
507
"\\|uni\\(on\\|que\\)\\|v\\(alue\\|ecdiag\\)\\|x\\(mult\\|sect\\)\\|yield"
528
"\\|a\\(ll\\|ny\\|pply\\|rmasim\\)\\|b\\(lock\\|ranks\\|tran\\)"
529
"\\|c\\(har\\|hoose\\|on\\(cat\\|tents\\|vexit\\|vmod\\)\\|ovlag\\|shape\\|usum\\|vexhull\\)"
530
"\\|d\\(atasets\\|esignf?\\|et\\|iag\\|o\\|uration\\)"
531
"\\|e\\(chelon\\|igv\\(al\\|ec\\)\\)\\|f\\(ft\\|orward\\)\\|ginv"
532
"\\|h\\(alf\\|ankel\\|dir\\|ermite\\|omogen\\)"
533
"\\|i\\(\\|fft\\|nsert\\|nv\\(updt\\)?\\)\\|j\\(\\|root\\)\\|loc\\|mad"
534
"\\|n\\(ame\\|col\\|leng\\|row\\|um\\)\\|o\\(pscal\\|rpol\\)"
535
"\\|p\\(olyroot\\|roduct\\|v\\)\\|r\\(anktie\\|ates\\|atio\\|emove\\|eturn\\|oot\\|owcatc?\\)"
536
"\\|s\\(etdif\\|hape\\|olve\\|plinev\\|pot\\|qrsym\\|ssq\\|torage\\|weep\\|ymsqr\\)"
537
"\\|t\\(\\|eigv\\(al\\|ec\\)\\|oeplitz\\|race\\|risolv\\|ype\\)"
538
"\\|uni\\(on\\|que\\)\\|v\\(alue\\|ecdiag\\)\\|x\\(mult\\|sect\\)\\|yield"
509
540
;;; ;; SCL functions that are known to work with SAS macro function %sysfunc
511
"\\|attr[cn]\\|c\\(exist\\|lose\\)\\|d\\(close\\|num\\|open\\|read\\)"
512
"\\|exist\\|f\\(close\\|etchobs\\|i\\(leexist\\|nfo\\)\\|open\\|put\\|write\\)"
513
"\\|get\\(option\\|var[cn]\\)\\|lib\\(name\\|ref\\)\\|op\\(en\\|t\\(getn\\|setn\\)\\)"
514
"\\|pathname\\|sysmsg\\|var\\(fmt\\|l\\(abel\\|en\\)\\|n\\(ame\\|um\\)\\|type\\)\\)"
515
"[ \t]*(") font-lock-function-name-face)
517
"Font Lock regexs for SAS.")
519
(defvar SAS-mode-font-lock-keywords "") ;; empty if not window-system
520
); only if window-system
542
"\\|attr[cn]\\|c\\(exist\\|lose\\)\\|d\\(close\\|num\\|open\\|read\\)"
543
"\\|exist\\|f\\(close\\|etchobs\\|i\\(leexist\\|nfo\\)\\|open\\|put\\|write\\)"
544
"\\|get\\(option\\|var[cn]\\)\\|lib\\(name\\|ref\\)\\|op\\(en\\|t\\(getn\\|setn\\)\\)"
545
"\\|pathname\\|sysmsg\\|var\\(fmt\\|l\\(abel\\|en\\)\\|n\\(ame\\|um\\)\\|type\\)\\)"
546
"[ \t]*(") font-lock-function-name-face)
548
"Font Lock regexs for SAS.")
522
551
(defvar SAS-editing-alist
523
552
'((sentence-end . ";[\t\n */]*")