From 8a4215c2ac5afe83865bd9c94d1bc82b637bb36b Mon Sep 17 00:00:00 2001 From: zaborek Date: Fri, 1 Mar 2019 14:48:44 -0600 Subject: [PATCH 1/4] Added keywords: libname set output options --- components/prism-sas.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/prism-sas.min.js b/components/prism-sas.min.js index 0ad62f2c51..b6ea705c9a 100644 --- a/components/prism-sas.min.js +++ b/components/prism-sas.min.js @@ -1 +1 @@ -Prism.languages.sas={datalines:{pattern:/^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,alias:"string",inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:dt?|t)\b/i,alias:"number"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},keyword:/\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i,number:/\b(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/}; \ No newline at end of file +Prism.languages.sas={datalines:{pattern:/^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,alias:"string",inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:dt?|t)\b/i,alias:"number"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},keyword:/\b(?:data|else|format|if|input|proc\s\w+|quit|run|then|libname|set|output|options)\b/i,number:/\b(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/}; From caeec3675a4ee38f2d7a59a236bd071428ed1c9e Mon Sep 17 00:00:00 2001 From: wippysnib Date: Fri, 1 Mar 2019 15:27:37 -0600 Subject: [PATCH 2/4] Update keyword_feature.test --- tests/languages/sas/keyword_feature.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/languages/sas/keyword_feature.test b/tests/languages/sas/keyword_feature.test index 697a4120ec..042747c433 100644 --- a/tests/languages/sas/keyword_feature.test +++ b/tests/languages/sas/keyword_feature.test @@ -1,13 +1,15 @@ data else format if input proc run then +libname set output options ---------------------------------------------------- [ ["keyword", "data"], ["keyword", "else"], ["keyword", "format"], ["keyword", "if"], - ["keyword", "input"], ["keyword", "proc run"], ["keyword", "then"] + ["keyword", "input"], ["keyword", "proc run"], ["keyword", "then"], ["keyword", "libname], + ["keyword", "set"], ["keyword", "output"], ["keyword", "options"] ] ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. From f4be374db81d78cdb08b9db9226430d37eb0fafc Mon Sep 17 00:00:00 2001 From: wippysnib Date: Fri, 1 Mar 2019 15:29:44 -0600 Subject: [PATCH 3/4] Update prism-sas.js --- components/prism-sas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/prism-sas.js b/components/prism-sas.js index cbaa034eec..607995c820 100644 --- a/components/prism-sas.js +++ b/components/prism-sas.js @@ -26,7 +26,7 @@ Prism.languages.sas = { pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/, greedy: true }, - 'keyword': /\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i, + 'keyword': /\b(?:data|else|format|if|input|proc\s\w+|quit|run|then|libname|set|output|options)\b/i, // Decimal (1.2e23), hexadecimal (0c1x) 'number': /\b(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, 'operator': /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i, From 5d86b58935c1dbed3df1a6ada2b005ead20d0dca Mon Sep 17 00:00:00 2001 From: wippysnib Date: Fri, 1 Mar 2019 23:02:35 -0600 Subject: [PATCH 4/4] included forgotten quote after libname --- tests/languages/sas/keyword_feature.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/sas/keyword_feature.test b/tests/languages/sas/keyword_feature.test index 042747c433..90f86929aa 100644 --- a/tests/languages/sas/keyword_feature.test +++ b/tests/languages/sas/keyword_feature.test @@ -6,7 +6,7 @@ libname set output options [ ["keyword", "data"], ["keyword", "else"], ["keyword", "format"], ["keyword", "if"], - ["keyword", "input"], ["keyword", "proc run"], ["keyword", "then"], ["keyword", "libname], + ["keyword", "input"], ["keyword", "proc run"], ["keyword", "then"], ["keyword", "libname"], ["keyword", "set"], ["keyword", "output"], ["keyword", "options"] ]