Merge pull request #340 from unsigned00/patch-1

Fix space bug after del
This commit is contained in:
Lyon 2024-05-05 02:29:06 +08:00 committed by GitHub
commit 7e1b47bf04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2351,13 +2351,10 @@ AST* parser_line2Ast(Parser* self, char* sLine) {
AST_setNodeAttr(oAst, "global", sGlobalList); AST_setNodeAttr(oAst, "global", sGlobalList);
goto __block_matched; goto __block_matched;
} }
if (strIsStartWith(sLineStart, "del ") || if (strIsStartWith(sLineStart, "del")) {
strIsStartWith(sLineStart, "del(")) {
sStmt = ""; sStmt = "";
char* sDelDir = NULL; char* sDelDir = strsCut(&buffs, sLineStart, '(', ')');
if (sLineStart[3] == '(') { if (!sDelDir){
sDelDir = strsCut(&buffs, sLineStart, '(', ')');
} else {
sDelDir = sLineStart + sizeof("del ") - 1; sDelDir = sLineStart + sizeof("del ") - 1;
} }
sDelDir = Cursor_getCleanStmt(&buffs, sDelDir); sDelDir = Cursor_getCleanStmt(&buffs, sDelDir);