Skip to content
Snippets Groups Projects
Commit 1e186e75 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[sas mode] Remove buggy comment matching

Closes #4664
parent 8b1e6a52
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
//Definitions
// comment -- text withing * ; or /* */
// comment -- text within * ; or /* */
// keyword -- SAS language variable
// variable -- macro variables starts with '&' or variable formats
// variable-2 -- DATA Step, proc, or macro names
......@@ -116,28 +116,15 @@
return "comment";
}
if (ch == "*" && stream.column() == stream.indentation()) {
stream.skipToEnd()
return "comment"
}
// DoubleOperator match
var doubleOperator = ch + stream.peek();
// Match all line comments.
var myString = stream.string;
var myRegexp = /(?:^\s*|[;]\s*)(\*.*?);/ig;
var match = myRegexp.exec(myString);
if (match !== null) {
if (match.index === 0 && (stream.column() !== (match.index + match[0].length - 1))) {
stream.backUp(stream.column());
stream.skipTo(';');
stream.next();
return 'comment';
} else if (match.index + 1 < stream.column() && stream.column() < match.index + match[0].length - 1) {
// the ';' triggers the match so move one past it to start
// the comment block that is why match.index+1
stream.backUp(stream.column() - match.index - 1);
stream.skipTo(';');
stream.next();
return 'comment';
}
} else if ((ch === '"' || ch === "'") && !state.continueString) {
if ((ch === '"' || ch === "'") && !state.continueString) {
state.continueString = ch
return "string"
} else if (state.continueString) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment