~ distinguish EmptyGraphPattern
authorEric Prud'hommeaux <bertails@w3.org>
Mon, 28 Dec 2009 15:44:54 -0500
changeset 78 45c3f93b63ec
parent 77 ee8c227fab8d
child 79 f093e64b186f
~ distinguish EmptyGraphPattern
src/main/scala/SPARQL.scala
--- a/src/main/scala/SPARQL.scala	Mon Dec 28 15:35:47 2009 -0500
+++ b/src/main/scala/SPARQL.scala	Mon Dec 28 15:44:54 2009 -0500
@@ -99,8 +99,8 @@
 	  case _ => EmptyGraphPattern()
 	}
 	gpntORf_tbOPT.foldLeft(init)((gp, lentry) => lentry match {
-//	  case ~(TableFilter(null, expr), None) => TableFilter(gp, expr)
-	  case ~(TableFilter(null, expr), Some(TriplesBlock(List()))) => TableFilter(gp, expr)
+	  case ~(TableFilter(null, expr), None) => TableFilter(gp, expr)
+//	  case ~(TableFilter(null, expr), Some(TriplesBlock(List()))) => TableFilter(gp, expr)
 	  case x => error("found " + x)
 	})
 	// (tbOPT, gpntORf_tbOPT) match {
@@ -126,7 +126,7 @@
   )
 
   def triplesblock:Parser[TriplesBlock] =
-    repsep(triplepattern, ".") ^^ { case pats => TriplesBlock(pats) }
+    rep1sep(triplepattern, ".") ^^ { case pats => TriplesBlock(pats) }
 
   def triplepattern:Parser[TriplePattern] =
     subject ~ predicate ~ objectt ^^ { case s~p~o => TriplePattern(s, p, o) }