diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-18 21:55:59 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2007-07-18 21:55:59 +0000 |
commit | 7c574439453b88d328d975845c2e55499b56bf14 (patch) | |
tree | 21a743a0c1b77fb64cb54df2d193f60b95bc3696 /docs/examples/parsing/lambda/test | |
parent | bf32e7d4a87b2e0ae000d1fac27ab42a6c57222d (diff) | |
download | scala-7c574439453b88d328d975845c2e55499b56bf14.tar.gz scala-7c574439453b88d328d975845c2e55499b56bf14.tar.bz2 scala-7c574439453b88d328d975845c2e55499b56bf14.zip |
added another example using the combinator pars...
added another example using the combinator parsers, courtesy of Miles
Sabin (slightly simplified/adapted to new combinators)
Diffstat (limited to 'docs/examples/parsing/lambda/test')
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-01.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-02.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-03.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-04.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-05.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-06.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-07.kwi | 1 | ||||
-rwxr-xr-x | docs/examples/parsing/lambda/test/test-08.kwi | 1 |
8 files changed, 8 insertions, 0 deletions
diff --git a/docs/examples/parsing/lambda/test/test-01.kwi b/docs/examples/parsing/lambda/test/test-01.kwi new file mode 100755 index 0000000000..9833d10673 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-01.kwi @@ -0,0 +1 @@ +let x = 23 in (\y z -> x+y+z) 1 2 diff --git a/docs/examples/parsing/lambda/test/test-02.kwi b/docs/examples/parsing/lambda/test/test-02.kwi new file mode 100755 index 0000000000..11198c6fc9 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-02.kwi @@ -0,0 +1 @@ +let f = (\x y -> x*y) in f 2 3 diff --git a/docs/examples/parsing/lambda/test/test-03.kwi b/docs/examples/parsing/lambda/test/test-03.kwi new file mode 100755 index 0000000000..d4515d7297 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-03.kwi @@ -0,0 +1 @@ +let f = (\x y -> x*y) in f (f 1 2) 3 diff --git a/docs/examples/parsing/lambda/test/test-04.kwi b/docs/examples/parsing/lambda/test/test-04.kwi new file mode 100755 index 0000000000..e54c45457a --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-04.kwi @@ -0,0 +1 @@ +let fact = \x -> if x == 0 then 1 else x*(fact (x-1)) in unit diff --git a/docs/examples/parsing/lambda/test/test-05.kwi b/docs/examples/parsing/lambda/test/test-05.kwi new file mode 100755 index 0000000000..0b95d67846 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-05.kwi @@ -0,0 +1 @@ +let fact = \x -> if x == 0 then 1 else x*(fact (x-1)) in fact 6 diff --git a/docs/examples/parsing/lambda/test/test-06.kwi b/docs/examples/parsing/lambda/test/test-06.kwi new file mode 100755 index 0000000000..47723dc998 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-06.kwi @@ -0,0 +1 @@ +2*3+4*5 == 26 diff --git a/docs/examples/parsing/lambda/test/test-07.kwi b/docs/examples/parsing/lambda/test/test-07.kwi new file mode 100755 index 0000000000..14fba0d66a --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-07.kwi @@ -0,0 +1 @@ +let fix = \f -> f(fix f) in unit diff --git a/docs/examples/parsing/lambda/test/test-08.kwi b/docs/examples/parsing/lambda/test/test-08.kwi new file mode 100755 index 0000000000..7166d154f0 --- /dev/null +++ b/docs/examples/parsing/lambda/test/test-08.kwi @@ -0,0 +1 @@ +let fix = (\f -> f(fix f)) in (fix (\g n -> if n == 0 then 1 else n*(g(n-1)))) 5 |