Fix OS_EvaluateExpression and GSTrans of quoted macro variable
Fix GSTrans of quoted macro variable
*BASIC
*SetMacro Macro Test
SYS "OS_GSTrans", """<Macro>""", &10000, &100
Would result in an erroneous "String not recognised" error as the end of macro variable was reached before closing quote. Fix by reordering the checks.
Fix OS_EvaluateExpression
OS_EvaluateExpression is documented as applying GSTrans to any strings within the expression, but did instead GSTrans the entire expression.
This would result in a sequence such as: 1
*Set Alias$@RunType_FD1 "Basic -quit ""%0"" %*1"
*If "<Alias$@RunType_FD1>"="" Then Set Alias$@RunType_FD1 @RunType_FFB %*0
raising a "Unknown operand" error as the quote in the variable were interpreted as expression syntax. See https://www.riscosopen.org/forum/forums/5/topics/16127
Unfortunately skipping the inital GSTrans breaks common code such as:
If "<StrED_cfg$Dir>" = "" AND <Ctrl$Pressed> = 0 Then ...
If "<Zap$OSVsn>" <> "" Then SetEval ZapFonts$OSVsn <Zap$OSVsn>
Fix by applying a GSTrans transformation over unquoted parts of the expression, then applying GSTrans over the quoted strings.
Relation the FileSwitch changes
This should fix the problem exposed by RiscOS/Sources/FileSys/FileSwitch!9 (merged), which RiscOS/Sources/FileSys/FileSwitch!10 (merged) worked around but broke many BASIC programs requiring it to be reverted by RiscOS/Sources/FileSys/FileSwitch!11 (merged).
-
RiscOS/Sources/FileSys/FileSwitch@ee39744a and SideDiff v2.44
↩