File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 3737esc_chars ['" \?\\ abfnrtv ]
3838esc_seq \\ {esc_chars }
3939term_ch \w
40- tag_val_ch [^ ,.<>{} \[\]\\\"\? ':;!@#$%^&*() \- +=~ \/ | ]| \\ .
40+ tag_val_base_ch [^ ,.<>{} \[\]\\\"\? ':;!@#$%^&*() \- +=~ \/ | ]| \\ .
41+ tag_val_ch {tag_val_base_ch }+ (:+ {tag_val_base_ch }* )*
4142astrsk_ch \*
4243
4344
Original file line number Diff line number Diff line change @@ -153,6 +153,14 @@ TEST_F(SearchParserTest, Scanner) {
153153 NEXT_EQ (TOK_TAG_VAL, string, " blue]1#-" );
154154 NEXT_TOK (TOK_RCURLBR);
155155
156+ // Colon in tag value (unescaped)
157+ SetInput (" @t:{Tag:value}" );
158+ NEXT_EQ (TOK_FIELD, string, " @t" );
159+ NEXT_TOK (TOK_COLON);
160+ NEXT_TOK (TOK_LCURLBR);
161+ NEXT_EQ (TOK_TAG_VAL, string, " Tag:value" );
162+ NEXT_TOK (TOK_RCURLBR);
163+
156164 // Prefix simple
157165 SetInput (" pre*" );
158166 NEXT_EQ (TOK_PREFIX, string, " pre" );
@@ -232,6 +240,11 @@ TEST_F(SearchParserTest, Parse) {
232240
233241 EXPECT_EQ (0 , Parse (" @name:{escape\\ -err*}" ));
234242
243+ // Colon in tag value
244+ EXPECT_EQ (0 , Parse (" @t:{Tag:value}" ));
245+ EXPECT_EQ (0 , Parse (" @t:{Tag:*}" ));
246+ EXPECT_EQ (0 , Parse (" @category:{Product:Electronics}" ));
247+
235248 EXPECT_EQ (1 , Parse (" -(foo " ));
236249 EXPECT_EQ (1 , Parse (" foo:bar " ));
237250 EXPECT_EQ (1 , Parse (" @foo:@bar " ));
You can’t perform that action at this time.
0 commit comments