mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-13 08:04:03 +09:00
basic: = to return its RH
This commit is contained in:
@@ -316,9 +316,9 @@ bStatus.builtin = {
|
|||||||
var sigil = parseSigil(args[0].troValue);
|
var sigil = parseSigil(args[0].troValue);
|
||||||
var rh = resolve(args[1]);
|
var rh = resolve(args[1]);
|
||||||
if (rh === undefined) throw lang.refError(lnum, args[1].troValue);
|
if (rh === undefined) throw lang.refError(lnum, args[1].troValue);
|
||||||
var type = sigil.sgType || JStoBASICtype(rh)
|
var type = sigil.sgType || JStoBASICtype(rh);
|
||||||
|
|
||||||
bStatus.vars[sigil.sgName] = new BasicVar(rh, type);
|
bStatus.vars[sigil.sgName] = new BasicVar(rh, type);
|
||||||
|
return rh;
|
||||||
},
|
},
|
||||||
"==" : function(lnum, args) {
|
"==" : function(lnum, args) {
|
||||||
return twoArg(lnum, args, function(lh, rh) { return lh == rh; });
|
return twoArg(lnum, args, function(lh, rh) { return lh == rh; });
|
||||||
@@ -1323,7 +1323,7 @@ let JStoBASICtype = function(object) {
|
|||||||
else if (!isNaN(object)) return "number";
|
else if (!isNaN(object)) return "number";
|
||||||
else if (typeof object === "string" || object instanceof String) return "string";
|
else if (typeof object === "string" || object instanceof String) return "string";
|
||||||
else if (object === undefined) return "null";
|
else if (object === undefined) return "null";
|
||||||
else throw "BasicIntpError: un-translatable object with typeof "+(typeof object)+"\n"+object;
|
else throw "BasicIntpError: un-translatable object with typeof "+(typeof object)+"\n"+object+"\n"+Object.entries(object);
|
||||||
}
|
}
|
||||||
let SyntaxTreeReturnObj = function(type, value, nextLine) {
|
let SyntaxTreeReturnObj = function(type, value, nextLine) {
|
||||||
this.troType = type;
|
this.troType = type;
|
||||||
|
|||||||
Reference in New Issue
Block a user