From edb4d40ffa746c6e05a1d4ccbbffa1c3714abbd5 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sat, 25 Sep 2021 00:34:55 -0300 Subject: [PATCH] Fixes var=function assignment without parameters (recursion). As reported at https://www.qb64.org/forum/index.php?topic=704.msg5775#msg5775 --- source/qb64.bas | 2 +- source/subs_functions/subs_functions.bas | 40 +++++++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/source/qb64.bas b/source/qb64.bas index 0fa77c539..c671c53d6 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -18590,7 +18590,7 @@ FUNCTION findid& (n2$) hashretry: z = HashFindCont(unrequired, i) ELSE - z = HashFindRev(n$, 1, unrequired, i) + z = HashFind(n$, 1, unrequired, i) END IF findidinternal = z IF z = 0 THEN GOTO noid diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 66f7ad97f..b01d3c2fd 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1771,16 +1771,6 @@ id.arg = MKL$(STRINGTYPE - ISPOINTER) id.hr_syntax = "CHAIN moduleName$" regid -clearid -id.n = "Shell" -id.subfunc = 2 -id.callname = "sub_shell" -id.args = 1 -id.arg = MKL$(STRINGTYPE - ISPOINTER) -id.specialformat = "[?]" -'id.secondargcantbe = "_HIDE" -id.hr_syntax = "SHELL [_DONTWAIT] [_HIDE] commandToRun$" -regid clearid id.n = "Shell" @@ -1804,6 +1794,17 @@ id.secondargmustbe = "_DontWait" id.hr_syntax = "SHELL [_DONTWAIT] [_HIDE] commandToRun$" regid +clearid +id.n = "Shell" +id.subfunc = 2 +id.callname = "sub_shell" +id.args = 1 +id.arg = MKL$(STRINGTYPE - ISPOINTER) +id.specialformat = "[?]" +'id.secondargcantbe = "_HIDE" +id.hr_syntax = "SHELL [_DONTWAIT] [_HIDE] commandToRun$" +regid + clearid id.n = "Shell" id.subfunc = 1 @@ -2503,15 +2504,6 @@ id.secondargmustbe = "(" id.hr_syntax = "PUT [STEP](column, row), Array([index])[,] [_CLIP] [{PSET|PRESET|AND|OR|XOR}]][, omitcolor]" regid -clearid -id.n = "Open" -id.subfunc = 2 -id.callname = "sub_open_gwbasic" -id.args = 4 -id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "?,[#]?,?[,?]" -id.hr_syntax = "OPEN modeLetter$, [#]fileNumber&, fileName$[, recordLength]" -regid clearid id.n = "Open" id.subfunc = 2 @@ -2522,6 +2514,16 @@ id.specialformat = "?[{For Random|For Binary|For Input|For Output|For Append}][{ id.hr_syntax = "OPEN fileName$ [FOR mode] [ACCESS|LOCK|SHARED [{READ|WRITE}] AS [#]fileNumber& [LEN = recordLength]" regid +clearid +id.n = "Open" +id.subfunc = 2 +id.callname = "sub_open_gwbasic" +id.args = 4 +id.arg = MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(STRINGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) +id.specialformat = "?,[#]?,?[,?]" +id.hr_syntax = "OPEN modeLetter$, [#]fileNumber&, fileName$[, recordLength]" +regid + clearid id.n = "Val" id.subfunc = 1