From 29e1d9640ffd730582de5f36ec74b0b7c14740b9 Mon Sep 17 00:00:00 2001 From: unsigned00 <84944863+unsigned00@users.noreply.github.com> Date: Sun, 5 May 2024 01:31:55 +0800 Subject: [PATCH] Fix space bug after del Fix space bug after del --- src/PikaParser.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/PikaParser.c b/src/PikaParser.c index d6bac503b..271668f26 100644 --- a/src/PikaParser.c +++ b/src/PikaParser.c @@ -2351,13 +2351,10 @@ AST* parser_line2Ast(Parser* self, char* sLine) { AST_setNodeAttr(oAst, "global", sGlobalList); goto __block_matched; } - if (strIsStartWith(sLineStart, "del ") || - strIsStartWith(sLineStart, "del(")) { + if (strIsStartWith(sLineStart, "del")) { sStmt = ""; - char* sDelDir = NULL; - if (sLineStart[3] == '(') { - sDelDir = strsCut(&buffs, sLineStart, '(', ')'); - } else { + char* sDelDir = strsCut(&buffs, sLineStart, '(', ')'); + if (!sDelDir){ sDelDir = sLineStart + sizeof("del ") - 1; } sDelDir = Cursor_getCleanStmt(&buffs, sDelDir);