mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-19 02:55:49 +00:00
18 lines
335 B
Python
18 lines
335 B
Python
# Check that a parser can pass the advanced syntax
|
|
# 高度な文法をチェックする
|
|
|
|
# multiple patterns definition
|
|
fib 0 = 0
|
|
fib 1 = 1
|
|
fib(n: Nat): Nat = fib(n-1) + fib(n-2)
|
|
|
|
# keyword arguments
|
|
t = if True:
|
|
then := 1
|
|
else := 2
|
|
assert t == 1
|
|
|
|
# import
|
|
math = import "math"
|
|
# {*} = "math" # use all
|
|
{pi;} = import "math"
|