fix number addition bug

This commit is contained in:
William Bell committed 2022-05-27 11:29:33 +00:00
1 parent 242b40f570
commit 97476abfed
3 files changed
+4 -15

No files matched your search

+1 -1
View File
@@ -1 +1 @@
const x = 10+18;
184+103
+2 -13
View File
@@ -14,19 +14,7 @@ func init() {
}
func run(lines []interface{}) {
fmt.Println(runprocess(opperator{
t: 11,
x: opperator{
t: 11, x: opperator{
t: 11,
x: 1e100,
y: 5,
}, y: " "},
y: variable{
variable: "HW",
line: 10,
},
}))
fmt.Println(runprocess(lines[0]))
}
func runprocess(codeseg interface{}) interface{} {
@@ -38,6 +26,7 @@ func runprocess(codeseg interface{}) interface{} {
if myvar.EXISTS != nil {
return myvar.VAL
}
log.Fatal("undecared variable on line " + fmt.Sprint(codeseg.(variable).line))
}
return codeseg
}
+1 -1
View File
@@ -178,7 +178,7 @@ var translateprocess = func(codeseg code) (interface{}, bool) {
if !worked {
continue
}
val2, worked := processfunc(code{code: split[0], line: codeseg.line})
val2, worked := processfunc(code{code: split[1], line: codeseg.line})
if !worked {
continue
}