summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-03-18 17:32:53 +0100
committerJon Bratseth <bratseth@gmail.com>2021-03-18 17:32:53 +0100
commitbcd73cb92c9ab6df5001386cebfc3cb2d0247db8 (patch)
treeca9489030cc5003631b330fb5969422909179cae /container-search
parent949e8235ead29dfa13d9aca8b36ef625a4fe396b (diff)
Allow dash in ident as it is legal in source names
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g42
-rw-r--r--container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java6
2 files changed, 7 insertions, 1 deletions
diff --git a/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4 b/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4
index d680ea1b91e..497465c1582 100644
--- a/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4
+++ b/container-search/src/main/antlr4/com/yahoo/search/yql/yqlplus.g4
@@ -131,7 +131,7 @@ options {
* LEXER RULES
*------------------------------------------------------------------*/
-ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|':')*
+ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|':'|'-')*
;
LONG_INT : '-'?'0'..'9'+ ('L'|'l')
diff --git a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
index 3f0000367e7..aa2f24107ae 100644
--- a/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/yql/YqlParserTestCase.java
@@ -681,6 +681,12 @@ public class YqlParserTestCase {
}
@Test
+ public void testSourcesWithDash() {
+ assertSources("select foo from source-a where price <= 500;",
+ Arrays.asList("source-a"));
+ }
+
+ @Test
public void testWildCardSources() {
assertSources("select foo from sources * where price <= 500;",
Collections.<String>emptyList());