This commit is contained in:
Shunsuke Shibayama 2023-02-17 21:27:37 +09:00
parent 677ced0fcd
commit 9a131ecc53
2 changed files with 9 additions and 8 deletions

View file

@ -96,7 +96,8 @@ impl DummyStdin {
if self.current_line >= self.lines.len() {
stdout.write_all("\n".as_bytes()).unwrap();
stdout.flush().unwrap();
return "".to_string();
// workaround: https://github.com/erg-lang/erg/issues/399
return "exit()".to_string();
}
let mut line = self.lines[self.current_line].clone();
self.current_line += 1;

View file

@ -77,12 +77,7 @@ impl Context {
Public,
Some(FUNC_CONJUGATE),
);
float.register_py_builtin(
FUNC_HEX,
fn0_met(Float, Str),
Some(FUNC_HEX),
24,
);
float.register_py_builtin(FUNC_HEX, fn0_met(Float, Str), Some(FUNC_HEX), 24);
float.register_py_builtin(
FUNC_IS_INTEGER,
fn0_met(Float, Bool),
@ -560,7 +555,12 @@ impl Context {
Public,
Some(FUNC_COUNT),
);
str_.register_py_builtin(FUNC_CAPITALIZE, fn0_met(Str, Str), Some(FUNC_CAPITALIZE), 13);
str_.register_py_builtin(
FUNC_CAPITALIZE,
fn0_met(Str, Str),
Some(FUNC_CAPITALIZE),
13,
);
str_.register_builtin_erg_impl(FUNC_CONTAINS, fn1_met(Str, Str, Bool), Immutable, Public);
let str_getitem_t = fn1_kw_met(Str, kw(KW_IDX, Nat), Str);
str_.register_builtin_erg_impl(FUNDAMENTAL_GETITEM, str_getitem_t, Immutable, Public);