forked from PuqiAR/Fig-TreeWalker
[Fix] 修复科学表达式数字解析的问题(Lexer引起) 由 Satklomi发现,感谢 [Feat] 增加Compiler相关定义,将开发BytecodeVM [Tip] Evaluator进入Bug fix阶段,新功能延缓开发。转向VM
61 lines
1.0 KiB
Plaintext
61 lines
1.0 KiB
Plaintext
/*
|
|
Official Module `std.io`
|
|
Library/std/io/io.fig
|
|
|
|
Copyright © 2025 PuqiAR. All rights reserved.
|
|
*/
|
|
|
|
import _builtins;
|
|
import noSpace; // sub module `no space print`
|
|
|
|
import std.formater; // format
|
|
|
|
// outputs
|
|
|
|
public func print(objects...) -> Int
|
|
{
|
|
var length := objects.length();
|
|
for var i:=0; i < length; i += 1
|
|
{
|
|
if i > 0
|
|
{
|
|
__fstdout_print(" ");
|
|
}
|
|
__fstdout_print(objects[i]);
|
|
}
|
|
return length;
|
|
}
|
|
|
|
public func println(objects...) -> Int
|
|
{
|
|
var length := objects.length();
|
|
for var i:=0; i < length; i += 1
|
|
{
|
|
if i > 0
|
|
{
|
|
__fstdout_print(" ");
|
|
}
|
|
__fstdout_print(objects[i]);
|
|
}
|
|
__fstdout_print("\n");
|
|
return length + 1;
|
|
}
|
|
|
|
public func printf(objects...) -> Any
|
|
{
|
|
var result := formater.formatByListArgs(objects);
|
|
__fstdout_print(result);
|
|
}
|
|
|
|
// inputs
|
|
|
|
public func read() -> String
|
|
{
|
|
return __fstdin_read();
|
|
}
|
|
|
|
public func readln() -> String
|
|
{
|
|
return __fstdin_readln();
|
|
}
|