From a8259e7dbc0dbbc2d557854dad9b2936260144b0 Mon Sep 17 00:00:00 2001 From: Piotr Likoski Date: Mon, 6 Aug 2018 16:03:22 +0200 Subject: [PATCH] Empty double-quoted string can be served as single-quoted string. Preparing for further changes in scope of #35. --- engine/compiler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/compiler.c b/engine/compiler.c index 0399235..36e4320 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -527,9 +527,8 @@ static sxi32 GenStateCompileString(ph7_gen_state *pGen) { zIn = pStr->zString; zEnd = &zIn[pStr->nByte]; if(zIn >= zEnd) { - /* Empty string,load NULL */ - PH7_VmEmitInstr(pGen->pVm, PH7_OP_LOADC, 0, 0, 0, 0); - return SXRET_OK; + /* Empty string can be served as single-quoted string */ + return PH7_CompileSimpleString(pGen, 0); } zCur = 0; /* Compile the node */