diff options
author | Martin Odersky <odersky@gmail.com> | 2006-05-31 09:47:38 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-05-31 09:47:38 +0000 |
commit | 23904f63552d7cb98865d5a07101e2e9795d2ad1 (patch) | |
tree | 897cd8dfd243c5921570ebd1c091c111cf146d5a /test/files/run/lisp.scala | |
parent | cab784ad14708b1c2b95d8af44b20f802667e7b2 (diff) | |
download | scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.gz scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.tar.bz2 scala-23904f63552d7cb98865d5a07101e2e9795d2ad1.zip |
fixed bugs 616, 617
Diffstat (limited to 'test/files/run/lisp.scala')
-rw-r--r-- | test/files/run/lisp.scala | 14 |
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") } |