summaryrefslogtreecommitdiff
path: root/docs/examples/typeinf.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-03-23 16:17:43 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-03-23 16:17:43 +0000
commite06381565db6615dfc0d384b76fd332ff93c6299 (patch)
treef6f9a6721e27bf30de40d5256150f5ccbd3a9b03 /docs/examples/typeinf.scala
parentb809bf2730a76316082b1e5ba8e6dcef48e7bbc3 (diff)
downloadscala-e06381565db6615dfc0d384b76fd332ff93c6299.tar.gz
scala-e06381565db6615dfc0d384b76fd332ff93c6299.tar.bz2
scala-e06381565db6615dfc0d384b76fd332ff93c6299.zip
Fixed compilation errors in distribution examples.
Diffstat (limited to 'docs/examples/typeinf.scala')
-rw-r--r--docs/examples/typeinf.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/examples/typeinf.scala b/docs/examples/typeinf.scala
index f21d514f87..f2dd252ff7 100644
--- a/docs/examples/typeinf.scala
+++ b/docs/examples/typeinf.scala
@@ -172,7 +172,7 @@ object typeInfer {
for (val s <- id; s != "let" && s != "in") yield s
/** term = '\' ident '.' term | term1 {term1} | let ident "=" term in term */
- def term: Parser[Term] =
+ def term: Parser[Term] = (
( for (
val _ <- wschr('\\');
val x <- ident;
@@ -193,9 +193,10 @@ object typeInfer {
val t <- term1;
val ts <- rep(term1))
yield (t /: ts)((f, arg) => App(f, arg)) )
+ )
/** term1 = ident | '(' term ')' */
- def term1: Parser[Term] =
+ def term1: Parser[Term] = (
( for (val s <- ident)
yield Var(s): Term )
|||
@@ -203,7 +204,8 @@ object typeInfer {
val _ <- wschr('(');
val t <- term;
val _ <- wschr(')'))
- yield t );
+ yield t )
+ )
/** all = term ';' */
def all: Parser[Term] =
@@ -214,7 +216,7 @@ object typeInfer {
}
class ParseString(s: String) extends Parsers {
- type intype = int
+ type inputType = int
val input = 0
def any = new Parser[char] {
def apply(in: int): Parser[char]#Result =