]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/sas.js
1 /*! `sas` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Mauricio Caceres <mauricio.caceres.bravo@gmail.com>
9 Description: Syntax Highlighting for SAS
13 /** @type LanguageFn */
15 const regex
= hljs
.regex
;
16 // Data step and PROC SQL statements
17 const SAS_KEYWORDS
= [
130 // Built-in SAS functions
413 // Built-in macro functions
414 const MACRO_FUNCTIONS
= [
494 case_insensitive: true,
497 keyword: SAS_KEYWORDS
501 // Distinct highlight for proc <proc>, data, run, quit
502 className: 'keyword',
503 begin: /^\s
*(proc
[\w
\d_
]+|data
|run
|quit
)[\s
;]/
507 className: 'variable',
508 begin: /&[a-zA-Z_&][a-zA-Z0-9_]*\.?/
526 /[a-zA-Z_&][a-zA-Z0-9_]*/
533 { // Built-in macro variables
534 className: 'built_in',
535 begin: '%' + regex
.either(...MACRO_FUNCTIONS
)
538 // User-defined macro functions
539 className: 'title.function',
540 begin: /%[a-zA-Z_][a-zA-Z_0-9]*/
543 // TODO: this is most likely an incorrect classification
544 // built_in may need more nuance
545 // https://github.com/highlightjs/highlight.js/issues/2521
547 begin: regex
.either(...FUNCTIONS
) + '(?=\\()'
552 hljs
.APOS_STRING_MODE
,
553 hljs
.QUOTE_STRING_MODE
556 hljs
.COMMENT('\\*', ';'),
557 hljs
.C_BLOCK_COMMENT_MODE
566 hljs
.registerLanguage('sas', hljsGrammar
);