Skip to content

Commit

Permalink
Added new SAS keywords (#1784)
Browse files Browse the repository at this point in the history
This adds the SAS keywords libname, set, output, and options to the language definition.
  • Loading branch information
zaborek authored and RunDevelopment committed Mar 2, 2019
1 parent 06627f6 commit 3b396ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/prism-sas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-sas.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions tests/languages/sas/keyword_feature.test
Original file line number Diff line number Diff line change
@@ -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.
Checks for all keywords.

0 comments on commit 3b396ef

Please sign in to comment.