mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-23 04:15: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() {
|
void setup_built_in_functions() {
|
||||||
initialize(
|
initialize(
|
||||||
"pp",
|
"puts",
|
||||||
Value(Value::FunctionValue {
|
Value(Value::FunctionValue {
|
||||||
{ {"arg", true} },
|
{ {"arg", true} },
|
||||||
[](std::shared_ptr<Environment> env) {
|
[](std::shared_ptr<Environment> env) {
|
||||||
|
@ -12,6 +12,6 @@ make_func = fn (mut x) {
|
|||||||
|
|
||||||
f = make_func(10)
|
f = make_func(10)
|
||||||
|
|
||||||
pp("1: { f() }")
|
puts("1: { f() }")
|
||||||
pp("2: { f() }")
|
puts("2: { f() }")
|
||||||
pp("3: { f() }")
|
puts("3: { f() }")
|
||||||
|
@ -12,6 +12,6 @@ fib = fn (x) {
|
|||||||
|
|
||||||
mut i = 0
|
mut i = 0
|
||||||
while i < 30 {
|
while i < 30 {
|
||||||
pp("{i}: {fib(i)}")
|
puts("{i}: {fib(i)}")
|
||||||
i = i + 1
|
i = i + 1
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
mut i = 1
|
mut i = 1
|
||||||
while i < 24 {
|
while i < 24 {
|
||||||
if i % 15 == 0 {
|
if i % 15 == 0 {
|
||||||
pp('FizzBuzz')
|
puts('FizzBuzz')
|
||||||
} else if i % 5 == 0 {
|
} else if i % 5 == 0 {
|
||||||
pp('Buzz')
|
puts('Buzz')
|
||||||
} else if i % 3 == 0 {
|
} else if i % 3 == 0 {
|
||||||
pp('Fizz')
|
puts('Fizz')
|
||||||
} else {
|
} else {
|
||||||
pp(i)
|
puts(i)
|
||||||
}
|
}
|
||||||
i = i + 1
|
i = i + 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user