notepad4
notepad4 copied to clipboard
Syntax highlighting for SAS
Any chance to integrate SAS lexer? https://github.com/StatTag/scintilla/blob/master/lexers/LexSAS.cxx
https://documentation.sas.com/doc/en/lrcon/9.4/part-1.htm https://documentation.sas.com/api/docsets/lrcon/9.4/content/lrcon.pdf
Needs help to figure file extensions and keywords (and corresponding links) for SAS. Also here are questions for the lexer:
- the lexer treat
// ... ;
as comment but I can't find it in the document. - the lexer use braces to fold code, however from samples in the document, Python like indentation seems is better.
- needs document for quoting rules, e.g. escape characters, variable highlighting inside quotes, whether string is multiple-line or not.
I am not sure if pygments
lexer here would help. There's another syntax rule can be found here
- 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
- 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.
- 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.
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 //
.
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 /*
.
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.
4f20795099b37acdf01515f276702de81af5dc13 added a simple lexer for SAS Viya 2024.06, please test latest builds from https://github.com/zufuliu/notepad4/actions