mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
fix incorrect order of translation
This commit is contained in:
@@ -55,7 +55,9 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i
|
|||||||
isLine = 1
|
isLine = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if isBrackets(code) {
|
if isBoolean(code) {
|
||||||
|
return parseBoolean(code)
|
||||||
|
} else if isBrackets(code) {
|
||||||
resp, worked, err, i = parseBrackets(code, index, codelines)
|
resp, worked, err, i = parseBrackets(code, index, codelines)
|
||||||
if worked {
|
if worked {
|
||||||
return resp, worked, err, i
|
return resp, worked, err, i
|
||||||
@@ -74,6 +76,35 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i
|
|||||||
if worked {
|
if worked {
|
||||||
return resp, worked, err, i
|
return resp, worked, err, i
|
||||||
}
|
}
|
||||||
|
} else if isNumber(code) {
|
||||||
|
return parseNumber(code)
|
||||||
|
} else if isNegative(code) {
|
||||||
|
return parseNegative(code, index, codelines)
|
||||||
|
} else if isString(code) {
|
||||||
|
return parseString(code)
|
||||||
|
} else if issquareroot(code) {
|
||||||
|
return parseSquareroot(code, index, codelines)
|
||||||
|
} else if isFactorial(code) {
|
||||||
|
return parseFactorial(code, index, codelines)
|
||||||
|
} else if isCall(code) {
|
||||||
|
resp, worked, err, i = parseCall(code, index, codelines)
|
||||||
|
if worked {
|
||||||
|
return resp, worked, err, i
|
||||||
|
}
|
||||||
|
} else if isVariable(code) {
|
||||||
|
return parseVariable(code)
|
||||||
|
} else if isArray(code) {
|
||||||
|
resp, worked, err, i = parseArray(code, index, codelines)
|
||||||
|
if worked {
|
||||||
|
return resp, worked, err, i
|
||||||
|
}
|
||||||
|
} else if isMapGet(code) {
|
||||||
|
return mapGetParse(code, index, codelines)
|
||||||
|
} else if isIndexGet(code) {
|
||||||
|
resp, worked, err, i = indexGetParse(code, index, codelines)
|
||||||
|
if worked {
|
||||||
|
return resp, worked, err, i
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
operation, worked, err, step := parseOperations(code, index, codelines)
|
operation, worked, err, step := parseOperations(code, index, codelines)
|
||||||
@@ -83,41 +114,6 @@ func translateVal(code UNPARSEcode, index int, codelines []UNPARSEcode, isLine i
|
|||||||
return nil, worked, err, step
|
return nil, worked, err, step
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isNumber(code) {
|
|
||||||
return parseNumber(code)
|
|
||||||
} else if isNegative(code) {
|
|
||||||
return parseNegative(code, index, codelines)
|
|
||||||
} else if isFactorial(code) {
|
|
||||||
return parseFactorial(code, index, codelines)
|
|
||||||
} else if isCall(code) {
|
|
||||||
resp, worked, err, i = parseCall(code, index, codelines)
|
|
||||||
if worked {
|
|
||||||
return resp, worked, err, i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if isBoolean(code) {
|
|
||||||
return parseBoolean(code)
|
|
||||||
} else if isVariable(code) {
|
|
||||||
return parseVariable(code)
|
|
||||||
} else if isArray(code) {
|
|
||||||
resp, worked, err, i = parseArray(code, index, codelines)
|
|
||||||
if worked {
|
|
||||||
return resp, worked, err, i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if isMapGet(code) {
|
|
||||||
return mapGetParse(code, index, codelines)
|
|
||||||
} else if isIndexGet(code) {
|
|
||||||
resp, worked, err, i = indexGetParse(code, index, codelines)
|
|
||||||
if worked {
|
|
||||||
return resp, worked, err, i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if isString(code) {
|
|
||||||
return parseString(code)
|
|
||||||
} else if issquareroot(code) {
|
|
||||||
return parseSquareroot(code, index, codelines)
|
|
||||||
}
|
|
||||||
return resp, worked, err, i
|
return resp, worked, err, i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
tests/welcomemessage.ar
Normal file
11
tests/welcomemessage.ar
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
term.log(" ____ ")
|
||||||
|
term.log(" /\\ |___ \\ ")
|
||||||
|
term.log(" / \\ _ __ __ _ ___ _ __ __ ____) |")
|
||||||
|
term.log(" / /\\ \\ | '__/ _` |/ _ \\| '_ \\ \\ \\ / /__ < ")
|
||||||
|
term.log(" / ____ \\| | | (_| | (_) | | | | \\ V /___) |")
|
||||||
|
term.log(" /_/ \\_\\_| \\__, |\\___/|_| |_| \\_/|____/ ")
|
||||||
|
term.log(" __/ | ")
|
||||||
|
term.log(" |___/ ")
|
||||||
|
term.log("----------------------------------------------")
|
||||||
|
term.log("Welcome to ARGON for WASM!")
|
||||||
|
term.log("write code above and click run to see it work like magic!")
|
||||||
Reference in New Issue
Block a user