Skip to content

Commit 1101693

Browse files
authored
fix: formatting fedsql code lost issue (#1205)
1 parent 7d5389f commit 1101693

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

server/src/sas/CodeZoneManager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,6 @@ export class CodeZoneManager {
11471147
} else {
11481148
return CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG;
11491149
}
1150-
} else if (["FEDSQL"].includes(this._procName)) {
1151-
return CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG;
11521150
} else if (this._isCall(zone)) {
11531151
type = CodeZoneManager.ZONE_TYPE.RESTRICTED;
11541152
} else if (zone.type === CodeZoneManager.ZONE_TYPE.STMT_NAME) {

server/src/sas/Lexer.ts

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ export interface Token {
8181

8282
enum EmbeddedLangState {
8383
NONE,
84-
PROC_SQL_DEF,
85-
PROC_SQL_CODE,
8684
PROC_PYTHON_DEF,
8785
PROC_PYTHON_SUBMIT_OR_INTERACTIVE,
8886
PROC_PYTHON_CODE,
@@ -291,9 +289,7 @@ export class Lexer {
291289
this.context.lastNoncommentToken?.type === "text" &&
292290
this.context.lastNoncommentToken.text === "PROC"
293291
) {
294-
if (token.type === "text" && token.text === "FEDSQL") {
295-
this.context.embeddedLangState = EmbeddedLangState.PROC_SQL_DEF;
296-
} else if (token.type === "text" && token.text === "PYTHON") {
292+
if (token.type === "text" && token.text === "PYTHON") {
297293
this.context.embeddedLangState = EmbeddedLangState.PROC_PYTHON_DEF;
298294
} else if (token.type === "text" && token.text === "LUA") {
299295
this.context.embeddedLangState = EmbeddedLangState.PROC_LUA_DEF;
@@ -467,40 +463,6 @@ export class Lexer {
467463
token = this._foundEmbeddedCodeToken(this.curr);
468464
break SWITCH;
469465
}
470-
case EmbeddedLangState.PROC_SQL_DEF: {
471-
token = this._readToken();
472-
if (!token) {
473-
break SWITCH;
474-
}
475-
if (token.type === "sep" && token.text === ";") {
476-
this.context.embeddedLangState = EmbeddedLangState.PROC_SQL_CODE;
477-
}
478-
break SWITCH;
479-
}
480-
case EmbeddedLangState.PROC_SQL_CODE: {
481-
const endReg =
482-
/\b((quit)(\s+|\/\*.*?\*\/)*;|(data|proc|%macro)\b[^'";]*;)(\s+|\/\*.*?\*\/)*$/i;
483-
for (
484-
let line = this.curr.line;
485-
line < this.model.getLineCount();
486-
line++
487-
) {
488-
const lineContent = this._readEmbeddedCodeLine(this.curr, line);
489-
if (lineContent.trimStart().startsWith("%put")) {
490-
continue;
491-
}
492-
const match = endReg.exec(lineContent);
493-
if (match) {
494-
token = this._foundEmbeddedCodeToken(this.curr, {
495-
line: line,
496-
column: match.index,
497-
});
498-
break SWITCH;
499-
}
500-
}
501-
token = this._foundEmbeddedCodeToken(this.curr);
502-
break SWITCH;
503-
}
504466
}
505467
if (token) {
506468
if (Lexer.isComment[token.type] === undefined) {

0 commit comments

Comments
 (0)