From fff40a315e9c49d1417f3607430f3162a99eae24 Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Sun, 31 Jan 2021 14:45:58 -0300 Subject: [PATCH] Extra touches to CamelCase (NOT, AND, etc). --- source/qb64.bas | 15 ++++++++------- source/subs_functions/subs_functions.bas | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/qb64.bas b/source/qb64.bas index 97e079ccc..b181cff0e 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -8317,7 +8317,7 @@ DO previousElement$ = d$ d$ = "" NEXT - appendtype$ = UCASE$(appendtype$) 'capitalise default types (udt override this later if necessary) + appendtype$ = SCase2$(appendtype$) 'capitalise default types (udt override this later if necessary) typ$ = RTRIM$(typ$) dimnext2: @@ -18177,6 +18177,7 @@ END FUNCTION + FUNCTION fixoperationorder$ (savea$) a$ = savea$ IF Debug THEN PRINT #9, "fixoperationorder:in:" + a$ @@ -18423,8 +18424,8 @@ FUNCTION fixoperationorder$ (savea$) IF b = 0 THEN IF UCASE$(a2$) = "NOT" THEN IF i = n THEN Give_Error "Expected NOT ...": EXIT FUNCTION - IF i = 1 THEN a$ = SCase$("Not") + sp + "{" + sp + getelements$(a$, 2, n) + sp + "}": n = n + 2: GOTO lco_bracketting_done - a$ = getelements$(a$, 1, i - 1) + sp + "{" + sp + SCase$("Not") + sp + "{" + sp + getelements$(a$, i + 1, n) + sp + "}" + sp + "}" + IF i = 1 THEN a$ = "NOT" + sp + "{" + sp + getelements$(a$, 2, n) + sp + "}": n = n + 2: GOTO lco_bracketting_done + a$ = getelements$(a$, 1, i - 1) + sp + "{" + sp + "NOT" + sp + "{" + sp + getelements$(a$, i + 1, n) + sp + "}" + sp + "}" n = n + 4 GOTO NOT_recheck END IF 'not @@ -18618,8 +18619,8 @@ FUNCTION fixoperationorder$ (savea$) IF isoperator(f2$) THEN lastt = 3: lastti = i IF LEN(f2$) > 1 THEN - IF f2$ <> UCASE$(f2$) THEN - f2$ = UCASE$(f2$) + IF f2$ <> SCase2$(f2$) THEN + f2$ = SCase2$(f2$) removeelements a$, i, i, 0 insertelements a$, i - 1, f2$ END IF @@ -18629,7 +18630,6 @@ FUNCTION fixoperationorder$ (savea$) GOTO classdone END IF - IF alphanumeric(c) THEN lastt = 4: lastti = i @@ -18977,13 +18977,13 @@ FUNCTION fixoperationorder$ (savea$) f$ = f$ + sp classdone_special: NEXT + IF LEN(f$) THEN f$ = LEFT$(f$, LEN(f$) - 1) 'remove trailing 'sp' IF Debug THEN PRINT #9, "fixoperationorder:identification:" + a$, n IF Debug THEN PRINT #9, "fixoperationorder:identification(layout):" + f$, n - '----------------I. Pass (){}bracketed items (if any) to fixoperationorder & build return---------------- 'note: items seperated by commas are done seperately @@ -20404,6 +20404,7 @@ FUNCTION operatorusage (operator$, typ AS LONG, info$, lhs AS LONG, rhs AS LONG, IF operator$ = ">=" THEN info$ = ">=": operatorusage = 3: EXIT FUNCTION lhs = 1: rhs = 1: result = 1 + operator$ = UCASE$(operator$) IF operator$ = "MOD" THEN info$ = "%": operatorusage = 1: EXIT FUNCTION IF operator$ = "\" THEN info$ = "/ ": operatorusage = 1: EXIT FUNCTION IF operator$ = "IMP" THEN info$ = "|": operatorusage = 4: EXIT FUNCTION diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 148d96dd6..d528e0a31 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -2466,7 +2466,7 @@ id.ret = LONGTYPE - ISPOINTER regid clearid -id.n = "CLS" +id.n = "Cls" id.subfunc = 2 id.callname = "sub_cls" id.args = 2