blob: 9a452cbb79aa652d1f89c9d20594292e361d3a95 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
object tokens extends Enumeration {
type Token = Value;
val BAD = Value("<bad>");
val IDENT = Value("ident");
val NAME = Value("name");
}
object test extends Object with Application {
import tokens._;
val reserved = new scala.collection.mutable.HashMap[String, Token]();
if (true) {
reserved.get("a") match {
case None => IDENT
case Some(tk) => tk
}
}
else
BAD
}
|