Skip to content

Commit 7dbb666

Browse files
committed
Support lower case for some operators
Signed-off-by: Kunlin Yu <yukunlin@syriusrobotics.com>
1 parent 2f242bc commit 7dbb666

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/cql2_lexer.l

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ID [:_a-zA-Z][:_a-zA-Z.0-9]*
1717
CHAR_LIT \'[!"#$%&()*+,-.:;<=>?@a-zA-Z[\\\]^_`0-9 \t\r\n]*\'
1818
%%
1919

20-
"div" { print("OP", yytext); return Cql2ParserBase::token::DIVINT; }
20+
DIV|div { print("OP", yytext); return Cql2ParserBase::token::DIVINT; }
2121

2222
{DIGIT}+ {
2323
print("DIGIT_INT", yytext);
@@ -48,27 +48,27 @@ CHAR_LIT \'[!"#$%&()*+,-.:;<=>?@a-zA-Z[\\\]^_`0-9 \t\r\n]*\'
4848
return Cql2ParserBase::token::FALSE;
4949
}
5050

51-
"AND" {
51+
AND|and {
5252
print("BOOL_OP", yytext);
5353
return Cql2ParserBase::token::AND;
5454
}
5555

56-
"OR" {
56+
OR|or {
5757
print("BOOL_OP", yytext);
5858
return Cql2ParserBase::token::OR;
5959
}
6060

61-
"NOT" {
61+
NOT|not {
6262
print("BOOL_OP", yytext);
6363
return Cql2ParserBase::token::NOT;
6464
}
6565

66-
"CASEI" {
66+
CASEI|casei {
6767
print("", yytext);
6868
return Cql2ParserBase::token::CASEI;
6969
}
7070

71-
"ACCENTI" {
71+
ACCENTI|accenti {
7272
print("", yytext);
7373
return Cql2ParserBase::token::ACCENTI;
7474
}
@@ -144,7 +144,7 @@ BBOX"("[0-9. +\-,\n]+")" {
144144
return Cql2ParserBase::token::BBOX_TEXT;
145145
}
146146

147-
IN {
147+
IN|in {
148148
print("IN_OP", yytext);
149149
return Cql2ParserBase::token::IN;
150150
}
@@ -163,7 +163,7 @@ IN {
163163
return Cql2ParserBase::token::IS_NOT_NULL;
164164
}
165165

166-
"LIKE" {
166+
LIKE|like {
167167
print("LIKE_OP", yytext);
168168
return Cql2ParserBase::token::LIKE;
169169
}
@@ -172,7 +172,7 @@ IN {
172172
return Cql2ParserBase::token::NOT_LIKE;
173173
}
174174

175-
"BETWEEN" {
175+
BETWEEN|between {
176176
print("LIKE_OP", yytext);
177177
return Cql2ParserBase::token::BETWEEN;
178178
}
File renamed without changes.

test/test_parse.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ TEST_F(ParseExampleTest, clause6_02b) {EXPECT_TRUE(Parse(case_name_)); }
135135
TEST_F(ParseExampleTest, clause6_02c) {EXPECT_TRUE(Parse(case_name_)); }
136136
TEST_F(ParseExampleTest, clause6_03) {EXPECT_TRUE(Parse(case_name_)); }
137137
TEST_F(ParseExampleTest, clause7_01) {EXPECT_TRUE(Parse(case_name_)); }
138+
TEST_F(ParseExampleTest, clause7_02) {EXPECT_TRUE(Parse(case_name_)); }
138139
TEST_F(ParseExampleTest, clause7_03a) {EXPECT_TRUE(Parse(case_name_)); }
139140
TEST_F(ParseExampleTest, clause7_03b) {EXPECT_TRUE(Parse(case_name_)); }
140141
TEST_F(ParseExampleTest, clause7_07) {EXPECT_TRUE(Parse(case_name_)); }

0 commit comments

Comments
 (0)