diff options
author | buraq <buraq@epfl.ch> | 2004-08-19 17:29:21 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2004-08-19 17:29:21 +0000 |
commit | d2bb97849985f367f5e5101222d20c7f5a06d61c (patch) | |
tree | 66c750a14bf6490e7eb6a3305dedd472c6ece30b /sources | |
parent | 9b178df043a2eeb447bb33d338cdaac8c7a0d33f (diff) | |
download | scala-d2bb97849985f367f5e5101222d20c7f5a06d61c.tar.gz scala-d2bb97849985f367f5e5101222d20c7f5a06d61c.tar.bz2 scala-d2bb97849985f367f5e5101222d20c7f5a06d61c.zip |
print an error, instead of dying with fatal error
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/xml/parsing/ConstructingParser.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sources/scala/xml/parsing/ConstructingParser.scala b/sources/scala/xml/parsing/ConstructingParser.scala index 9e142483a0..04bcba3c9d 100644 --- a/sources/scala/xml/parsing/ConstructingParser.scala +++ b/sources/scala/xml/parsing/ConstructingParser.scala @@ -5,11 +5,19 @@ object ConstructingParser { fromSource(new ConstructingHandler(), inp); def fromSource(theHandle: ConstructingHandler, inp: scala.io.Source): ConstructingParser = { + + val p = new ConstructingParser() { val input = inp; override val handle = theHandle; def nextch = { ch = input.next; pos = input.pos; } override val preserveWS = true; + + /** report a syntax error */ + def reportSyntaxError(str: String): Unit = { + Console.println(inp.descr+":"+scala.io.Position.toString(pos)+":"+str); + } + }; p.nextch; p @@ -22,9 +30,6 @@ abstract class ConstructingParser extends MarkupParser[Node] { val handle = new ConstructingHandler(); - /** report a syntax error */ - def reportSyntaxError(str: String): Unit = throw FatalError(str); - /** this method assign the next character to ch and advances in input */ def nextch: Unit; |