Outer_Lex.is_ignored;
authorwenzelm
Mon, 11 Jan 2010 18:23:06 +0100
changeset 34311 f0a6f02ad705
parent 34310 a3d66403f9c9
child 34312 265075989f01
Outer_Lex.is_ignored;
src/Pure/Isar/outer_lex.scala
src/Pure/Isar/outer_parse.scala
src/Pure/Thy/thy_syntax.scala
--- a/src/Pure/Isar/outer_lex.scala	Mon Jan 11 10:55:43 2010 +0100
+++ b/src/Pure/Isar/outer_lex.scala	Mon Jan 11 18:23:06 2010 +0100
@@ -48,7 +48,7 @@
     def is_text: Boolean = is_xname || kind == Token_Kind.VERBATIM
     def is_space: Boolean = kind == Token_Kind.SPACE
     def is_comment: Boolean = kind == Token_Kind.COMMENT
-    def is_proper: Boolean = !(is_space || is_comment)
+    def is_ignored: Boolean = is_space || is_comment
     def is_unparsed: Boolean = kind == Token_Kind.UNPARSED
 
     def content: String =
--- a/src/Pure/Isar/outer_parse.scala	Mon Jan 11 10:55:43 2010 +0100
+++ b/src/Pure/Isar/outer_parse.scala	Mon Jan 11 18:23:06 2010 +0100
@@ -20,7 +20,7 @@
     def filter_proper = true
 
     private def proper(in: Input): Input =
-      if (in.atEnd || in.first.is_proper || !filter_proper) in
+      if (in.atEnd || !in.first.is_ignored || !filter_proper) in
       else proper(in.rest)
 
     def token(s: String, pred: Elem => Boolean): Parser[Elem] = new Parser[Elem]
--- a/src/Pure/Thy/thy_syntax.scala	Mon Jan 11 10:55:43 2010 +0100
+++ b/src/Pure/Thy/thy_syntax.scala	Mon Jan 11 18:23:06 2010 +0100
@@ -15,7 +15,7 @@
 
     val command_span: Parser[Span] =
     {
-      val whitespace = token("white space", tok => tok.is_space || tok.is_comment)
+      val whitespace = token("white space", _.is_ignored)
       val command = token("command keyword", _.is_command)
       val body = not(rep(whitespace) ~ (command | eof)) ~> not_eof
       command ~ rep(body) ^^ { case x ~ ys => x :: ys } | rep1(whitespace) | rep1(body)