Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Groovy and Lua code within PROC GROOVY and PROC LUA #2091

Merged
merged 23 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b218f63
Minor improvements to SAS language support
Oct 4, 2019
9ae6921
Minor fixes
Oct 7, 2019
40dc5a9
Add support for proc groovy and proc lua
Oct 16, 2019
74dab84
Catch up to latest in upstream/master
Oct 16, 2019
fbc6943
Catch up to latest in upstream/master
Oct 16, 2019
5bf688e
Merge branch 'proc-lua-groovy-add' of https://github.com/cedporter/pr…
Oct 16, 2019
1571e61
Added @mAAdhaTTah and @RunDevelopment to credits and footer
Golmote Oct 5, 2019
11f3299
TypeScript: Added missing keyword `undefined` (#2088)
Oct 13, 2019
fa09cd4
AQL: Disallow unclosed multiline comments again (#2089)
Simran-B Oct 15, 2019
6e80471
JavaScript: Added Optional Chaining and Nullish Coalescing (#2084)
RunDevelopment Oct 16, 2019
87178f2
Added support for FTL (#2080)
RunDevelopment Oct 16, 2019
cd42b5c
Minor improvements for C-like and Clojure (#2064)
RunDevelopment Oct 16, 2019
ffd1886
Added support for ANTLR4 (#2063)
RunDevelopment Oct 16, 2019
87ff89a
Added support for etlua (#2050)
RunDevelopment Oct 16, 2019
b08bc92
Added SQF language (#2079)
RunDevelopment Oct 16, 2019
a145ecb
Inlined some unnecessary rest properties (#2082)
RunDevelopment Oct 16, 2019
b4239cf
Added test for unused capturing groups (#1996)
RunDevelopment Oct 16, 2019
5e8d7e3
Refactor lua and groovy and update tests to match
Oct 17, 2019
d2ed97c
Merge branch 'proc-lua-groovy-add' of https://github.com/cedporter/pr…
Oct 17, 2019
65d14e1
Remove unnecessary capturing groups
Oct 17, 2019
2e6798c
Preliminary move to make groovy, lua, and sql peerDependencies
Oct 22, 2019
8ba6f97
Fix bug in proc-lua
Oct 22, 2019
49591f1
Update components.json
cedporter Oct 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@
},
"sas": {
"title": "SAS",
"require": "sql",
"peerDependencies": ["groovy","lua","sql"],
cedporter marked this conversation as resolved.
Show resolved Hide resolved
"owner": "Golmote"
},
"sass": {
Expand Down
46 changes: 45 additions & 1 deletion components/prism-sas.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
alias: 'keyword'
};

var submitStatement = {
pattern: /(^|\s)(?:submit(?:\s+(?:load|parseonly|norun))?|endsubmit)\b/i,
lookbehind: true,
alias: 'keyword'
};

Prism.languages.sas = {
'datalines': {
pattern: /^(\s*)(?:(?:data)?lines|cards);[\s\S]+?^\s*;/im,
Expand Down Expand Up @@ -86,6 +92,44 @@
}
},

'proc-groovy': {
pattern: /(^proc\s+groovy(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,
lookbehind: true,
inside: {
'groovy': {
pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g, stringPattern), 'im'),
lookbehind: true,
alias: 'language-groovy',
inside: Prism.languages.groovy
},
'submit-statement': submitStatement,
'global-statements': globalStatements,
'number': number,
'numeric-constant': numericConstant,
'punctuation': punctuation,
'string': string
}
},

'proc-lua': {
pattern: /(^proc\s+lua(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,
lookbehind: true,
inside: {
'lua': {
pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g, stringPattern), 'im'),
lookbehind: true,
alias: 'language-lua',
inside: Prism.languages.lua
},
'submit-statement': submitStatement,
'global-statements': globalStatements,
'number': number,
'numeric-constant': numericConstant,
'punctuation': punctuation,
'string': string
}
},

'proc-args': {
pattern: RegExp(/(^proc\s+\w+\s+)(?!\s)(?:[^;"']|<str>)+;/.source.replace(/<str>/g, stringPattern), 'im'),
lookbehind: true,
Expand Down Expand Up @@ -167,7 +211,7 @@
'string': string,
'step': step,
'keyword': {
pattern: /((?:^|\s)=?)(?:action|after|analysis|and|array|barchart|barwidth|begingraph|by|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|data(?=\=)|define|document|do\s+over|do|dol|drop|dul|end|entryTitle|else|endcomp|fill(?:attrs)?|filename|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|legendlabel|length|libname|merge|midpoints|name|noobs|nowd|ods|options|or|out(?:put)?|overlay|plot|ranexp|rannor|rbreak|retain|set|session|sessref|statgraph|sum|summarize|table|temp|then\s+do|then|title\d?|to|var|where|xaxisopts|yaxisopts|y2axisopts)\b/i,
pattern: /((?:^|\s)=?)(?:action|after|analysis|and|array|barchart|barwidth|begingraph|by|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|data(?=\=)|define|document|do\s+over|do|dol|drop|dul|end|entryTitle|else|endcomp|eval(?:uate)?|exec(?:ute)?|fill(?:attrs)?|filename|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|legendlabel|length|libname|merge|midpoints|name|noobs|nowd|ods|options|or|out(?:put)?|overlay|plot|ranexp|rannor|rbreak|retain|set|session|sessref|statgraph|sum|summarize|table|temp|then\s+do|then|title\d?|to|var|where|xaxisopts|yaxisopts|y2axisopts)\b/i,
lookbehind: true,
},
// In SAS Studio syntax highlighting, these operators are styled like keywords
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.

1 change: 0 additions & 1 deletion plugins/autoloader/prism-autoloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
],
"reason": "clike",
"ruby": "clike",
"sas": "sql",
"sass": "css",
"scss": "css",
"scala": "java",
Expand Down
2 changes: 1 addition & 1 deletion plugins/autoloader/prism-autoloader.min.js

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