From 85ef5179bcbfa30d7ea3326a5d55ca740b3efa4c Mon Sep 17 00:00:00 2001 From: Chuck Nelson Date: Wed, 30 Mar 2016 10:25:36 -0400 Subject: [PATCH 1/2] Add missing keywords for SAS. Two changes: (1) PROC keyword now also includes its associated name (e.g., PROC TABULATE, PROC SQL). (2) QUIT now included, as it is used to close/complete various procedures. --- components/prism-sas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/prism-sas.js b/components/prism-sas.js index ffee46bf45..2a0863f7ba 100644 --- a/components/prism-sas.js +++ b/components/prism-sas.js @@ -23,9 +23,9 @@ Prism.languages.sas = { alias: 'number' }, 'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/, - 'keyword': /\b(?:data|else|format|if|input|proc|run|then)\b/i, + 'keyword': /\b(?:data|else|format|if|input|proc\s\S+|quit|run|then)\b/i, // Decimal (1.2e23), hexadecimal (0c1x) 'number': /(?:\B-|\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 +}; From 1b905b9eadfda5985e40d696c3263d3fc10a3e00 Mon Sep 17 00:00:00 2001 From: Chuck Nelson Date: Thu, 31 Mar 2016 11:24:29 -0400 Subject: [PATCH 2/2] Update PROC step/keyword regex to be more restrictive. --- 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 2a0863f7ba..1e50e361d3 100644 --- a/components/prism-sas.js +++ b/components/prism-sas.js @@ -23,7 +23,7 @@ Prism.languages.sas = { alias: 'number' }, 'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/, - 'keyword': /\b(?:data|else|format|if|input|proc\s\S+|quit|run|then)\b/i, + 'keyword': /\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i, // Decimal (1.2e23), hexadecimal (0c1x) 'number': /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, 'operator': /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,