mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Renamed 'pp' to 'puts'.
This commit is contained in:
parent
ff6231bcbe
commit
8039e65143
@ -260,7 +260,7 @@ struct Environment
|
||||
|
||||
void setup_built_in_functions() {
|
||||
initialize(
|
||||
"pp",
|
||||
"puts",
|
||||
Value(Value::FunctionValue {
|
||||
{ {"arg", true} },
|
||||
[](std::shared_ptr<Environment> env) {
|
||||
|
@ -12,6 +12,6 @@ make_func = fn (mut x) {
|
||||
|
||||
f = make_func(10)
|
||||
|
||||
pp("1: { f() }")
|
||||
pp("2: { f() }")
|
||||
pp("3: { f() }")
|
||||
puts("1: { f() }")
|
||||
puts("2: { f() }")
|
||||
puts("3: { f() }")
|
||||
|
@ -12,6 +12,6 @@ fib = fn (x) {
|
||||
|
||||
mut i = 0
|
||||
while i < 30 {
|
||||
pp("{i}: {fib(i)}")
|
||||
puts("{i}: {fib(i)}")
|
||||
i = i + 1
|
||||
}
|
||||
|
@ -5,13 +5,13 @@
|
||||
mut i = 1
|
||||
while i < 24 {
|
||||
if i % 15 == 0 {
|
||||
pp('FizzBuzz')
|
||||
puts('FizzBuzz')
|
||||
} else if i % 5 == 0 {
|
||||
pp('Buzz')
|
||||
puts('Buzz')
|
||||
} else if i % 3 == 0 {
|
||||
pp('Fizz')
|
||||
puts('Fizz')
|
||||
} else {
|
||||
pp(i)
|
||||
puts(i)
|
||||
}
|
||||
i = i + 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user