From 41dc7225084c735f0306e0ebb1a9da0fbd9886ff Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Mon, 18 Feb 2008 21:22:08 +0000 Subject: Generalizes the allowed inputs to the interpret... Generalizes the allowed inputs to the interpreter to be any combination of phrases that can be placed inside a template. Instead of having one "request" object try to understand the entire combination of phrases, the code now uses multiple "member handlers" for each request, one member handler for each phrase. --- test/files/run/interpreter.check | 22 ++++++++++++++++++++-- test/files/run/interpreter.scala | 8 ++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'test/files/run') diff --git a/test/files/run/interpreter.check b/test/files/run/interpreter.check index 7623eb2fbc..1bb6c28486 100644 --- a/test/files/run/interpreter.check +++ b/test/files/run/interpreter.check @@ -27,6 +27,11 @@ scala> :5: error: type mismatch; scala> defined trait PointlessTrait +scala> x: Int = 2 +y: Int = 3 + +scala> hello + scala> scala> scala> defined class Foo @@ -151,7 +156,7 @@ scala> :1: error: identifier expected but integer literal found. scala> scala> scala> -scala> | | | | res2: scala.xml.Elem = +scala> | | | | res3: scala.xml.Elem = @@ -161,7 +166,7 @@ scala> | | | | scala> scala> scala> -scala> | | | res3: java.lang.String = +scala> | | | res4: java.lang.String = hello there @@ -177,3 +182,16 @@ scala> x: Int = 1 scala> scala> +scala> defined class Exp +defined class Fact +defined class Term + +scala> | | :15: warning: match is not exhaustive! +missing combination Term + + def f(e: Exp) = e match { // non-exhaustive warning here + ^ +f: (Exp)Int + +scala> +scala> diff --git a/test/files/run/interpreter.scala b/test/files/run/interpreter.scala index 5ad9953857..b239b253cf 100644 --- a/test/files/run/interpreter.scala +++ b/test/files/run/interpreter.scala @@ -19,6 +19,8 @@ type anotherint = Int val four: anotherint = 4 val bogus: anotherint = "hello" trait PointlessTrait +val (x,y) = (2,3) +println("hello") // implicit conversions case class Foo(n: int) @@ -111,6 +113,12 @@ there def `match` = 1 val x = `match` +// multiple classes defined on one line +sealed class Exp; class Fact extends Exp; class Term extends Exp +def f(e: Exp) = e match {{ // non-exhaustive warning here + case _:Fact => 3 +}} + .text /** A writer that skips the first line of text. The first -- cgit v1.2.3