From 5c237fbe57510e40806e24bb3bbc3cd21b3c324b Mon Sep 17 00:00:00 2001 From: Michael Bolz Date: Tue, 7 Oct 2014 15:43:04 +0200 Subject: [PATCH] [OLINGO-434] Added optional WSP between MINUS and property --- .../antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 | 2 +- .../apache/olingo/server/core/uri/antlr/TestUriParserImpl.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 index 404c04fc5..1ff58394f 100644 --- a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 +++ b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 @@ -191,7 +191,7 @@ contextFragment : REST; // the context fragment is only required on the clie commonExpr : OPEN commonExpr CLOSE #altPharenthesis | vE1=commonExpr (WSP HAS WSP) vE2=commonExpr #altHas | methodCallExpr #altMethod - | ( unary WSP ) commonExpr #altUnary + | ( unary WSP? ) commonExpr #altUnary | anyExpr #altAny | allExpr #altAll | memberExpr #altMember diff --git a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java index 30e1b0da4..1dce3df88 100644 --- a/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java +++ b/lib/server-test/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java @@ -570,6 +570,7 @@ public class TestUriParserImpl { public void testUnary() throws UriParserException { testFilter.runESabc("not a").isCompr(">"); testFilter.runESabc("- a eq a").isCompr("<<- > eq >"); + testFilter.runESabc("-a eq a").isCompr("<<- > eq >"); } @Test