Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
K Kernel
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • RiscOS
  • Sources
  • Kernel
  • Merge requests
  • !49

Merged
Created Jan 25, 2021 by Timothy E Baldwin@tbaldwinDeveloper

Fix OS_EvaluateExpression and GSTrans of quoted macro variable

  • Overview 1
  • Commits 2
  • Changes 2

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).

  1. RiscOS/Sources/FileSys/FileSwitch@ee39744a and SideDiff v2.44 ↩

Edited Feb 10, 2021 by ROOL
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: Kernel-Fix-Expressions