Skip to content

Commit 54d786e

Browse files
author
梶塚太智
authored
Merge pull request #14 from rensatopc/main
add println
2 parents 14959cc + ad7cba1 commit 54d786e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,21 @@ impl Executor {
711711
print!("{a}");
712712
}
713713
}
714+
715+
// Standard output with new line
716+
"println" => {
717+
let a = self.pop_stack().get_string();
718+
719+
let a = a.replace("\\n", "\n");
720+
let a = a.replace("\\t", "\t");
721+
let a = a.replace("\\r", "\r");
722+
723+
if let Mode::Debug = self.mode {
724+
println!("[Output]: {a}");
725+
} else {
726+
println!("{a}");
727+
}
728+
}
714729

715730
// Get command-line arguments
716731
"args-cmd" => self.stack.push(Type::List(

0 commit comments

Comments
 (0)