|
@@ -87,13 +87,13 @@ export function createrCharAtFun () {
|
|
throw ProcessorErrorFactory.invalid_string_index(idx.get().toNumber(), str.get(),
|
|
throw ProcessorErrorFactory.invalid_string_index(idx.get().toNumber(), str.get(),
|
|
this.function_call_stack.pop());
|
|
this.function_call_stack.pop());
|
|
}
|
|
}
|
|
- const temp = new StoreValue(Types.STRING, str.get().charAt(idx.get().toNumber()));
|
|
|
|
|
|
+ const temp = new StoreValue(Types.CHAR, str.get().charAt(idx.get().toNumber()));
|
|
sto.insertStore("$", temp);
|
|
sto.insertStore("$", temp);
|
|
sto.mode = Modes.RETURN;
|
|
sto.mode = Modes.RETURN;
|
|
return sto;
|
|
return sto;
|
|
}
|
|
}
|
|
const block = new Commands.CommandBlock([], [new Commands.SysCall(charAtFun)]);
|
|
const block = new Commands.CommandBlock([], [new Commands.SysCall(charAtFun)]);
|
|
- const func = new Commands.Function('$charAt', Types.STRING,
|
|
|
|
|
|
+ const func = new Commands.Function('$charAt', Types.CHAR,
|
|
[new Commands.FormalParameter(Types.STRING, 'str', false),
|
|
[new Commands.FormalParameter(Types.STRING, 'str', false),
|
|
new Commands.FormalParameter(Types.INTEGER, 'index', false)],
|
|
new Commands.FormalParameter(Types.INTEGER, 'index', false)],
|
|
block);
|
|
block);
|