[tracker/subqueries-for-master] SPARQL: Support bracketted expressions as select expressions



commit 160de312c15bee90b4018d4b7ec5eb36f53beed2
Author: Jürg Billeter <j bitron ch>
Date:   Tue Dec 8 11:53:52 2009 +0100

    SPARQL: Support bracketted expressions as select expressions

 src/libtracker-data/tracker-sparql-query.vala |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index abd6ffd..2ce1566 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -555,9 +555,31 @@ public class Tracker.SparqlQuery : Object {
 		return stmt.execute ();
 	}
 
+	void skip_bracketted_expression () throws SparqlError {
+		expect (SparqlTokenType.OPEN_PARENS);
+		while (true) {
+			switch (current ()) {
+			case SparqlTokenType.OPEN_PARENS:
+				// skip nested bracketted expression
+				skip_bracketted_expression ();
+				continue;
+			case SparqlTokenType.CLOSE_PARENS:
+				break;
+			default:
+				next ();
+				continue;
+			}
+			break;
+		}
+		expect (SparqlTokenType.CLOSE_PARENS);
+	}
+
 	void skip_select_variables () throws SparqlError {
 		while (true) {
 			switch (current ()) {
+			case SparqlTokenType.OPEN_PARENS:
+				skip_bracketted_expression ();
+				continue;
 			case SparqlTokenType.FROM:
 			case SparqlTokenType.WHERE:
 			case SparqlTokenType.OPEN_BRACE:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]