提交 6ba5a956 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Optimize parsing of two-char operators in Parser.getSpecialType()

上级 7c73b37a
...@@ -4154,40 +4154,39 @@ public class Parser { ...@@ -4154,40 +4154,39 @@ public class Parser {
break; break;
} }
} else if (s.length() == 2) { } else if (s.length() == 2) {
char c1 = s.charAt(1);
switch (c0) { switch (c0) {
case ':': case ':':
if ("::".equals(s)) { if (c1 == ':' || c1 == '=') {
return KEYWORD;
} else if (":=".equals(s)) {
return KEYWORD; return KEYWORD;
} }
break; break;
case '>': case '>':
if (">=".equals(s)) { if (c1 == '=') {
return BIGGER_EQUAL; return BIGGER_EQUAL;
} }
break; break;
case '<': case '<':
if ("<=".equals(s)) { if (c1 == '=') {
return SMALLER_EQUAL; return SMALLER_EQUAL;
} else if ("<>".equals(s)) { } else if (c1 == '>') {
return NOT_EQUAL; return NOT_EQUAL;
} }
break; break;
case '!': case '!':
if ("!=".equals(s)) { if (c1 == '=') {
return NOT_EQUAL; return NOT_EQUAL;
} else if ("!~".equals(s)) { } else if (c1 == '~') {
return KEYWORD; return KEYWORD;
} }
break; break;
case '|': case '|':
if ("||".equals(s)) { if (c1 == '|') {
return STRING_CONCAT; return STRING_CONCAT;
} }
break; break;
case '&': case '&':
if ("&&".equals(s)) { if (c1 == '&') {
return SPATIAL_INTERSECTS; return SPATIAL_INTERSECTS;
} }
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论