diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-09 21:15:13 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-09 21:15:13 +0000 |
commit | ec233d3dbf784e62fdcf27b159689acd94bdaaab (patch) | |
tree | 78a2b05ff02a34836239b6c97c3cbe3a8139ab72 /test/files/run/byname.scala | |
parent | 3bbe3c70a3dcd32ce2f2b19c192c76871472d095 (diff) | |
download | scala-ec233d3dbf784e62fdcf27b159689acd94bdaaab.tar.gz scala-ec233d3dbf784e62fdcf27b159689acd94bdaaab.tar.bz2 scala-ec233d3dbf784e62fdcf27b159689acd94bdaaab.zip |
I found myself unable to make the necessary par...
I found myself unable to make the necessary parser improvements for the
pattern matcher without breaking it down better. This patch represents a
lot of work. Too many booleans were being threaded in an arbitrary way
through parse productions, resulting in an abundance of expressions like
annotations(true, false)
path(false, true)
Also there was too much duplication of code, and unnecessary use of
mutable state. So here are the main points:
* much less code duplication
* many listbuffers as arguments eliminated in favor of good old
fashioned call a method and use the result
* several booleans eliminated in favor of grouping methods by calling
context, so the booleans emerge automatically
* misc bug fixes, such as the fact that most operators which start
with a letter have been getting the highest precedence instead of
the lowest. (I can say most because it's definitely true by the
numbers: nobody has reported it because a-zA-Z do the right thing,
it's _, $, and the entirety of the Unicode letters which were wrong)
* sporadically introduced/improved documentation
* misc better error messages, like:
scala> import scala.{ _, String => Bob }
// before
<console>:1: error: '}' expected but ',' found.
import scala.{ _, String => Bob }
// after
<console>:1: error: Wildcard import must be in last position
import scala.{ _, String => Bob }
^
Anticipating the performance objection, I measured it and the difference
is immeasurable. And the usual finish: I can't imagine anyone being
interested in or willing to review this, but am all ears if there are
counterexamples. Meanwhile, no review.
Diffstat (limited to 'test/files/run/byname.scala')
0 files changed, 0 insertions, 0 deletions