summaryrefslogtreecommitdiff
path: root/test/files/run/lisp.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/lisp.scala')
-rw-r--r--test/files/run/lisp.scala14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/files/run/lisp.scala b/test/files/run/lisp.scala
index 34c4e7c7cc..cb26972e2d 100644
--- a/test/files/run/lisp.scala
+++ b/test/files/run/lisp.scala
@@ -15,14 +15,12 @@ class LispTokenizer(s: String) extends Iterator[String] {
}
def next: String =
if (hasNext) {
- val start = i;
- var ch = s.charAt(i); i = i + 1;
- if (ch == '(') "("
- else if (ch == ')') ")"
- else {
- while (i < s.length() && !isDelimiter(s.charAt(i))){ i = i + 1 }
- s.substring(start, i)
- }
+ val start = i
+ if (isDelimiter(s charAt i)) i = i + 1
+ else
+ do i = i + 1
+ while (!isDelimiter(s charAt i))
+ s.substring(start, i)
} else error("premature end of string")
}