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

Syntax highlighting for SAS #787

Closed
endo64 opened this issue Apr 23, 2024 · 7 comments
Closed

Syntax highlighting for SAS #787

endo64 opened this issue Apr 23, 2024 · 7 comments

Comments

@endo64
Copy link

endo64 commented Apr 23, 2024

Any chance to integrate SAS lexer?
https://github.com/StatTag/scintilla/blob/master/lexers/LexSAS.cxx

@zufuliu
Copy link
Owner

zufuliu commented Apr 25, 2024

Needs help to figure file extensions and keywords (and corresponding links) for SAS. Also here are questions for the lexer:

  1. the lexer treat // ... ; as comment but I can't find it in the document.
  2. the lexer use braces to fold code, however from samples in the document, Python like indentation seems is better.
  3. needs document for quoting rules, e.g. escape characters, variable highlighting inside quotes, whether string is multiple-line or not.

@adayim
Copy link

adayim commented May 4, 2024

I am not sure if pygments lexer here would help. There's another syntax rule can be found here

  1. the lexer treat // ... ; as comment but I can't find it in the document.

Yes, it is a comment. The comments rule is described here

  1. the lexer use braces to fold code, however from samples in the document, Python like indentation seems is better.

I think the Python like indentation is better.

  1. needs document for quoting rules, e.g. escape characters, variable highlighting inside quotes, whether string is multiple-line or not.

I don't think you need to think about variable highlighting inside a quote.

@zufuliu
Copy link
Owner

zufuliu commented May 4, 2024

Yes, it is a comment. The comments rule is described here

But it only says:
Syntax
*message;
or
/*message*/

No mention of C/C++ style //.

@adayim
Copy link

adayim commented May 5, 2024

Yes, you are right, // is not a comment. Sorry for the confusion. The comments need to start with /* or * and ends with ;. Comments can end with */ only if starts with /*.

@endo64
Copy link
Author

endo64 commented May 5, 2024

No, SAS doesn't support C style comments, supported formats are as below:

/********************
this is a comment block, cannot be nested,
can be multiline 
*********************/

*this is a line comment, should start with asterisk and end with a semicolon, cannot be multiline, cannot have a semicolon in between;

%* this is supported only in macros, between %macro and %mend

myvar = 42; *this is also supported, because it's a separate statement;

I saw the last one in an unofficial document, but I'm not sure if it is still supported, I'll test and let you know.

@zufuliu zufuliu added this to the v4.24.07 milestone May 6, 2024
zufuliu added a commit that referenced this issue Jun 30, 2024
@zufuliu
Copy link
Owner

zufuliu commented Jun 30, 2024

4f20795 added a simple lexer for SAS Viya 2024.06, please test latest builds from https://github.com/zufuliu/notepad4/actions

@zufuliu zufuliu closed this as completed Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants