-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 missing keywords for SAS. #922
Add missing keywords for SAS. #922
Conversation
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.
Hi @chucknelson Thanks for your contribution. First of all I have never used SAS, so please correct me if I am wrong on the language specific details. As I understand it, the 'function': {
pattern: /(\bproc\s+)\w+\b/i,
lookbehind: true
},
'keyword': /\b(?:data|else|format|if|input|proc|quit|run|then)\b/i, |
Hi @zeitgeist87,
Functions are also a concept in SAS, but more of what you expect, passing parameters within parentheses (e.g., This was just a little "warm up" contribution, but the eventual goal I want to hit is to get SAS support much more complete in Prism, eventually trying to mimic what users are familiar with in the Base SAS editor when it comes to syntax highlighting, as seen below: Any thoughts on how we can work towards that goal? Thanks! |
I see. In that case ignore my previous comments.
That would be great. I am happy to help if you have any questions concerning the implementation. Unfortunately I know next to nothing about SAS. The regex |
The single space was intentional due to how I'm going to push a new commit with the regex change for I also have an issue open on how to do language-specific styling for included languages like SAS (#923), in an effort to get to that Base SAS editor styling I mentioned. If you have any input on that I'd really appreciate it! Thanks! |
There is currently no support for themes that are only used for specific languages. To get the colors you want, you have to create your own theme. The language definition can only define the tokens. The themes set the colors. However the 'semantically-correct-token-name': {
pattern: /something/,
// use the same color as 'number'
alias: 'number'
} If your theme looks good with SAS it'll probably look good with other languages too. Then you can submit it to https://github.com/PrismJS/prism-themes |
Great, thanks so much! I'll do what I can to help build out some of the SAS support :) |
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.