Redo main cycle

This commit is contained in:
romych committed 2026-03-22 14:27:14 +03:00
1 parent c1616dfbd6
commit a74841b048
11 files changed
+434 -139

No files matched your search

+3 -1
View File
@@ -34,7 +34,7 @@ var orMatch = regexp.MustCompile(`\s+OR\s+`)
// var xorMatch = regexp.MustCompile(`\s+XOR\s+`)
var hexHMatch = regexp.MustCompile(`[[:xdigit:]]+H`)
var eqMatch = regexp.MustCompile(`[^=><]=[^=]`)
var eqMatch = regexp.MustCompile(`[^=><!]=[^=]`)
func patchExpression(expr string) string {
ex := strings.ToUpper(expr)
@@ -58,6 +58,8 @@ func patchExpression(expr string) string {
break
}
}
ex = strings.ReplaceAll(ex, "NOT", "!")
ex = strings.ReplaceAll(ex, "<>", "!=")
return ex
}
+2 -1
View File
@@ -5,13 +5,14 @@ import (
"testing"
)
const expr1 = "PC=00100h && SP>=256"
const expr1 = "PC=00100h and (NOT(B > 10)) and a != 5"
const expr2 = "PC=00115h"
const expr3 = "SP>=1332"
var ctx = map[string]interface{}{
"PC": 0x100,
"A": 0x55,
"B": 5,
"SP": 0x200,
}