mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
Changing the ampersand/pipe ordering, or otherwise complex formulas using them don't work. At the moment with the previous code, 1 > 2 || 3 < 4 is being parsed as 1 > (2 || 3) < 4 instead of (1 > 2) || (3 < 4). (#4516)
This commit is contained in:
1 parent
1ceca0b6ed
commit
06dd5c15c9
6 files changed
+226
-196
No files matched your search
@@ -180,4 +180,4 @@ identifier
|
||||
|
||||
|
||||
atn:
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 85, 96, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 55, 10, 3, 12, 3, 14, 3, 58, 11, 3, 5, 3, 60, 10, 3, 3, 3, 3, 3, 5, 3, 64, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 2, 3, 4, 8, 2, 4, 6, 8, 10, 12, 2, 11, 3, 2, 6, 7, 4, 2, 16, 16, 75, 75, 4, 2, 63, 63, 69, 69, 4, 2, 32, 32, 66, 66, 4, 2, 43, 44, 54, 55, 4, 2, 39, 39, 41, 41, 3, 2, 3, 5, 3, 2, 27, 28, 3, 2, 29, 30, 2, 108, 2, 14, 3, 2, 2, 2, 4, 63, 3, 2, 2, 2, 6, 87, 3, 2, 2, 2, 8, 89, 3, 2, 2, 2, 10, 91, 3, 2, 2, 2, 12, 93, 3, 2, 2, 2, 14, 15, 5, 4, 3, 2, 15, 16, 7, 2, 2, 3, 16, 3, 3, 2, 2, 2, 17, 18, 8, 3, 1, 2, 18, 64, 7, 27, 2, 2, 19, 64, 7, 28, 2, 2, 20, 64, 7, 24, 2, 2, 21, 64, 7, 23, 2, 2, 22, 64, 9, 2, 2, 2, 23, 24, 5, 6, 4, 2, 24, 25, 5, 4, 3, 14, 25, 64, 3, 2, 2, 2, 26, 27, 7, 17, 2, 2, 27, 28, 5, 4, 3, 2, 28, 29, 7, 18, 2, 2, 29, 64, 3, 2, 2, 2, 30, 31, 7, 8, 2, 2, 31, 32, 7, 17, 2, 2, 32, 33, 5, 10, 6, 2, 33, 34, 7, 18, 2, 2, 34, 64, 3, 2, 2, 2, 35, 36, 7, 9, 2, 2, 36, 37, 7, 17, 2, 2, 37, 38, 7, 24, 2, 2, 38, 64, 7, 18, 2, 2, 39, 40, 7, 10, 2, 2, 40, 41, 7, 17, 2, 2, 41, 42, 5, 10, 6, 2, 42, 44, 7, 11, 2, 2, 43, 45, 7, 5, 2, 2, 44, 43, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 46, 3, 2, 2, 2, 46, 47, 5, 10, 6, 2, 47, 48, 7, 18, 2, 2, 48, 64, 3, 2, 2, 2, 49, 50, 5, 8, 5, 2, 50, 59, 7, 17, 2, 2, 51, 56, 5, 4, 3, 2, 52, 53, 7, 11, 2, 2, 53, 55, 5, 4, 3, 2, 54, 52, 3, 2, 2, 2, 55, 58, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 51, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 62, 7, 18, 2, 2, 62, 64, 3, 2, 2, 2, 63, 17, 3, 2, 2, 2, 63, 19, 3, 2, 2, 2, 63, 20, 3, 2, 2, 2, 63, 21, 3, 2, 2, 2, 63, 22, 3, 2, 2, 2, 63, 23, 3, 2, 2, 2, 63, 26, 3, 2, 2, 2, 63, 30, 3, 2, 2, 2, 63, 35, 3, 2, 2, 2, 63, 39, 3, 2, 2, 2, 63, 49, 3, 2, 2, 2, 64, 84, 3, 2, 2, 2, 65, 66, 12, 11, 2, 2, 66, 67, 9, 3, 2, 2, 67, 83, 5, 4, 3, 12, 68, 69, 12, 10, 2, 2, 69, 70, 9, 4, 2, 2, 70, 83, 5, 4, 3, 11, 71, 72, 12, 9, 2, 2, 72, 73, 9, 5, 2, 2, 73, 83, 5, 4, 3, 10, 74, 75, 12, 8, 2, 2, 75, 76, 9, 6, 2, 2, 76, 83, 5, 4, 3, 9, 77, 78, 12, 7, 2, 2, 78, 79, 9, 7, 2, 2, 79, 83, 5, 4, 3, 8, 80, 81, 12, 13, 2, 2, 81, 83, 5, 6, 4, 2, 82, 65, 3, 2, 2, 2, 82, 68, 3, 2, 2, 2, 82, 71, 3, 2, 2, 2, 82, 74, 3, 2, 2, 2, 82, 77, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 88, 9, 8, 2, 2, 88, 7, 3, 2, 2, 2, 89, 90, 5, 12, 7, 2, 90, 9, 3, 2, 2, 2, 91, 92, 9, 9, 2, 2, 92, 11, 3, 2, 2, 2, 93, 94, 9, 10, 2, 2, 94, 13, 3, 2, 2, 2, 8, 44, 56, 59, 63, 82, 84]
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 85, 99, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 55, 10, 3, 12, 3, 14, 3, 58, 11, 3, 5, 3, 60, 10, 3, 3, 3, 3, 3, 5, 3, 64, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 86, 10, 3, 12, 3, 14, 3, 89, 11, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 2, 3, 4, 8, 2, 4, 6, 8, 10, 12, 2, 10, 3, 2, 6, 7, 4, 2, 16, 16, 75, 75, 4, 2, 63, 63, 69, 69, 4, 2, 43, 44, 54, 55, 4, 2, 39, 39, 41, 41, 3, 2, 3, 5, 3, 2, 27, 28, 3, 2, 29, 30, 2, 112, 2, 14, 3, 2, 2, 2, 4, 63, 3, 2, 2, 2, 6, 90, 3, 2, 2, 2, 8, 92, 3, 2, 2, 2, 10, 94, 3, 2, 2, 2, 12, 96, 3, 2, 2, 2, 14, 15, 5, 4, 3, 2, 15, 16, 7, 2, 2, 3, 16, 3, 3, 2, 2, 2, 17, 18, 8, 3, 1, 2, 18, 64, 7, 27, 2, 2, 19, 64, 7, 28, 2, 2, 20, 64, 7, 24, 2, 2, 21, 64, 7, 23, 2, 2, 22, 64, 9, 2, 2, 2, 23, 24, 5, 6, 4, 2, 24, 25, 5, 4, 3, 15, 25, 64, 3, 2, 2, 2, 26, 27, 7, 17, 2, 2, 27, 28, 5, 4, 3, 2, 28, 29, 7, 18, 2, 2, 29, 64, 3, 2, 2, 2, 30, 31, 7, 8, 2, 2, 31, 32, 7, 17, 2, 2, 32, 33, 5, 10, 6, 2, 33, 34, 7, 18, 2, 2, 34, 64, 3, 2, 2, 2, 35, 36, 7, 9, 2, 2, 36, 37, 7, 17, 2, 2, 37, 38, 7, 24, 2, 2, 38, 64, 7, 18, 2, 2, 39, 40, 7, 10, 2, 2, 40, 41, 7, 17, 2, 2, 41, 42, 5, 10, 6, 2, 42, 44, 7, 11, 2, 2, 43, 45, 7, 5, 2, 2, 44, 43, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 46, 3, 2, 2, 2, 46, 47, 5, 10, 6, 2, 47, 48, 7, 18, 2, 2, 48, 64, 3, 2, 2, 2, 49, 50, 5, 8, 5, 2, 50, 59, 7, 17, 2, 2, 51, 56, 5, 4, 3, 2, 52, 53, 7, 11, 2, 2, 53, 55, 5, 4, 3, 2, 54, 52, 3, 2, 2, 2, 55, 58, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 51, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 62, 7, 18, 2, 2, 62, 64, 3, 2, 2, 2, 63, 17, 3, 2, 2, 2, 63, 19, 3, 2, 2, 2, 63, 20, 3, 2, 2, 2, 63, 21, 3, 2, 2, 2, 63, 22, 3, 2, 2, 2, 63, 23, 3, 2, 2, 2, 63, 26, 3, 2, 2, 2, 63, 30, 3, 2, 2, 2, 63, 35, 3, 2, 2, 2, 63, 39, 3, 2, 2, 2, 63, 49, 3, 2, 2, 2, 64, 87, 3, 2, 2, 2, 65, 66, 12, 12, 2, 2, 66, 67, 9, 3, 2, 2, 67, 86, 5, 4, 3, 13, 68, 69, 12, 11, 2, 2, 69, 70, 9, 4, 2, 2, 70, 86, 5, 4, 3, 12, 71, 72, 12, 10, 2, 2, 72, 73, 9, 5, 2, 2, 73, 86, 5, 4, 3, 11, 74, 75, 12, 9, 2, 2, 75, 76, 9, 6, 2, 2, 76, 86, 5, 4, 3, 10, 77, 78, 12, 8, 2, 2, 78, 79, 7, 32, 2, 2, 79, 86, 5, 4, 3, 9, 80, 81, 12, 7, 2, 2, 81, 82, 7, 66, 2, 2, 82, 86, 5, 4, 3, 8, 83, 84, 12, 14, 2, 2, 84, 86, 5, 6, 4, 2, 85, 65, 3, 2, 2, 2, 85, 68, 3, 2, 2, 2, 85, 71, 3, 2, 2, 2, 85, 74, 3, 2, 2, 2, 85, 77, 3, 2, 2, 2, 85, 80, 3, 2, 2, 2, 85, 83, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 90, 91, 9, 7, 2, 2, 91, 7, 3, 2, 2, 2, 92, 93, 5, 12, 7, 2, 93, 9, 3, 2, 2, 2, 94, 95, 9, 8, 2, 2, 95, 11, 3, 2, 2, 2, 96, 97, 9, 9, 2, 2, 97, 13, 3, 2, 2, 2, 8, 44, 56, 59, 63, 85, 87]
|
||||
@@ -12,39 +12,39 @@ else:
|
||||
def serializedATN():
|
||||
with StringIO() as buf:
|
||||
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3U")
|
||||
buf.write("`\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\3\2")
|
||||
buf.write("c\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\3\2")
|
||||
buf.write("\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
|
||||
buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
|
||||
buf.write("\3\3\3\3\5\3-\n\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\7\3")
|
||||
buf.write("\67\n\3\f\3\16\3:\13\3\5\3<\n\3\3\3\3\3\5\3@\n\3\3\3\3")
|
||||
buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
|
||||
buf.write("\3\3\3\3\7\3S\n\3\f\3\16\3V\13\3\3\4\3\4\3\5\3\5\3\6\3")
|
||||
buf.write("\6\3\7\3\7\3\7\2\3\4\b\2\4\6\b\n\f\2\13\3\2\6\7\4\2\20")
|
||||
buf.write("\20KK\4\2??EE\4\2 BB\4\2+,\66\67\4\2\'\'))\3\2\3\5\3")
|
||||
buf.write("\2\33\34\3\2\35\36\2l\2\16\3\2\2\2\4?\3\2\2\2\6W\3\2\2")
|
||||
buf.write("\2\bY\3\2\2\2\n[\3\2\2\2\f]\3\2\2\2\16\17\5\4\3\2\17\20")
|
||||
buf.write("\7\2\2\3\20\3\3\2\2\2\21\22\b\3\1\2\22@\7\33\2\2\23@\7")
|
||||
buf.write("\34\2\2\24@\7\30\2\2\25@\7\27\2\2\26@\t\2\2\2\27\30\5")
|
||||
buf.write("\6\4\2\30\31\5\4\3\16\31@\3\2\2\2\32\33\7\21\2\2\33\34")
|
||||
buf.write("\5\4\3\2\34\35\7\22\2\2\35@\3\2\2\2\36\37\7\b\2\2\37 ")
|
||||
buf.write("\7\21\2\2 !\5\n\6\2!\"\7\22\2\2\"@\3\2\2\2#$\7\t\2\2$")
|
||||
buf.write("%\7\21\2\2%&\7\30\2\2&@\7\22\2\2\'(\7\n\2\2()\7\21\2\2")
|
||||
buf.write(")*\5\n\6\2*,\7\13\2\2+-\7\5\2\2,+\3\2\2\2,-\3\2\2\2-.")
|
||||
buf.write("\3\2\2\2./\5\n\6\2/\60\7\22\2\2\60@\3\2\2\2\61\62\5\b")
|
||||
buf.write("\5\2\62;\7\21\2\2\638\5\4\3\2\64\65\7\13\2\2\65\67\5\4")
|
||||
buf.write("\3\2\66\64\3\2\2\2\67:\3\2\2\28\66\3\2\2\289\3\2\2\29")
|
||||
buf.write("<\3\2\2\2:8\3\2\2\2;\63\3\2\2\2;<\3\2\2\2<=\3\2\2\2=>")
|
||||
buf.write("\7\22\2\2>@\3\2\2\2?\21\3\2\2\2?\23\3\2\2\2?\24\3\2\2")
|
||||
buf.write("\3\3\3\3\3\3\3\3\3\3\7\3V\n\3\f\3\16\3Y\13\3\3\4\3\4\3")
|
||||
buf.write("\5\3\5\3\6\3\6\3\7\3\7\3\7\2\3\4\b\2\4\6\b\n\f\2\n\3\2")
|
||||
buf.write("\6\7\4\2\20\20KK\4\2??EE\4\2+,\66\67\4\2\'\'))\3\2\3\5")
|
||||
buf.write("\3\2\33\34\3\2\35\36\2p\2\16\3\2\2\2\4?\3\2\2\2\6Z\3\2")
|
||||
buf.write("\2\2\b\\\3\2\2\2\n^\3\2\2\2\f`\3\2\2\2\16\17\5\4\3\2\17")
|
||||
buf.write("\20\7\2\2\3\20\3\3\2\2\2\21\22\b\3\1\2\22@\7\33\2\2\23")
|
||||
buf.write("@\7\34\2\2\24@\7\30\2\2\25@\7\27\2\2\26@\t\2\2\2\27\30")
|
||||
buf.write("\5\6\4\2\30\31\5\4\3\17\31@\3\2\2\2\32\33\7\21\2\2\33")
|
||||
buf.write("\34\5\4\3\2\34\35\7\22\2\2\35@\3\2\2\2\36\37\7\b\2\2\37")
|
||||
buf.write(" \7\21\2\2 !\5\n\6\2!\"\7\22\2\2\"@\3\2\2\2#$\7\t\2\2")
|
||||
buf.write("$%\7\21\2\2%&\7\30\2\2&@\7\22\2\2\'(\7\n\2\2()\7\21\2")
|
||||
buf.write("\2)*\5\n\6\2*,\7\13\2\2+-\7\5\2\2,+\3\2\2\2,-\3\2\2\2")
|
||||
buf.write("-.\3\2\2\2./\5\n\6\2/\60\7\22\2\2\60@\3\2\2\2\61\62\5")
|
||||
buf.write("\b\5\2\62;\7\21\2\2\638\5\4\3\2\64\65\7\13\2\2\65\67\5")
|
||||
buf.write("\4\3\2\66\64\3\2\2\2\67:\3\2\2\28\66\3\2\2\289\3\2\2\2")
|
||||
buf.write("9<\3\2\2\2:8\3\2\2\2;\63\3\2\2\2;<\3\2\2\2<=\3\2\2\2=")
|
||||
buf.write(">\7\22\2\2>@\3\2\2\2?\21\3\2\2\2?\23\3\2\2\2?\24\3\2\2")
|
||||
buf.write("\2?\25\3\2\2\2?\26\3\2\2\2?\27\3\2\2\2?\32\3\2\2\2?\36")
|
||||
buf.write("\3\2\2\2?#\3\2\2\2?\'\3\2\2\2?\61\3\2\2\2@T\3\2\2\2AB")
|
||||
buf.write("\f\13\2\2BC\t\3\2\2CS\5\4\3\fDE\f\n\2\2EF\t\4\2\2FS\5")
|
||||
buf.write("\4\3\13GH\f\t\2\2HI\t\5\2\2IS\5\4\3\nJK\f\b\2\2KL\t\6")
|
||||
buf.write("\2\2LS\5\4\3\tMN\f\7\2\2NO\t\7\2\2OS\5\4\3\bPQ\f\r\2\2")
|
||||
buf.write("QS\5\6\4\2RA\3\2\2\2RD\3\2\2\2RG\3\2\2\2RJ\3\2\2\2RM\3")
|
||||
buf.write("\2\2\2RP\3\2\2\2SV\3\2\2\2TR\3\2\2\2TU\3\2\2\2U\5\3\2")
|
||||
buf.write("\2\2VT\3\2\2\2WX\t\b\2\2X\7\3\2\2\2YZ\5\f\7\2Z\t\3\2\2")
|
||||
buf.write("\2[\\\t\t\2\2\\\13\3\2\2\2]^\t\n\2\2^\r\3\2\2\2\b,8;?")
|
||||
buf.write("RT")
|
||||
buf.write("\3\2\2\2?#\3\2\2\2?\'\3\2\2\2?\61\3\2\2\2@W\3\2\2\2AB")
|
||||
buf.write("\f\f\2\2BC\t\3\2\2CV\5\4\3\rDE\f\13\2\2EF\t\4\2\2FV\5")
|
||||
buf.write("\4\3\fGH\f\n\2\2HI\t\5\2\2IV\5\4\3\13JK\f\t\2\2KL\t\6")
|
||||
buf.write("\2\2LV\5\4\3\nMN\f\b\2\2NO\7 \2\2OV\5\4\3\tPQ\f\7\2\2")
|
||||
buf.write("QR\7B\2\2RV\5\4\3\bST\f\16\2\2TV\5\6\4\2UA\3\2\2\2UD\3")
|
||||
buf.write("\2\2\2UG\3\2\2\2UJ\3\2\2\2UM\3\2\2\2UP\3\2\2\2US\3\2\2")
|
||||
buf.write("\2VY\3\2\2\2WU\3\2\2\2WX\3\2\2\2X\5\3\2\2\2YW\3\2\2\2")
|
||||
buf.write("Z[\t\7\2\2[\7\3\2\2\2\\]\5\f\7\2]\t\3\2\2\2^_\t\b\2\2")
|
||||
buf.write("_\13\3\2\2\2`a\t\t\2\2a\r\3\2\2\2\b,8;?UW")
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
@@ -609,10 +609,6 @@ class BaserowFormula ( Parser ):
|
||||
return self.getToken(BaserowFormula.PLUS, 0)
|
||||
def MINUS(self):
|
||||
return self.getToken(BaserowFormula.MINUS, 0)
|
||||
def AMP_AMP(self):
|
||||
return self.getToken(BaserowFormula.AMP_AMP, 0)
|
||||
def PIPE_PIPE(self):
|
||||
return self.getToken(BaserowFormula.PIPE_PIPE, 0)
|
||||
def GT(self):
|
||||
return self.getToken(BaserowFormula.GT, 0)
|
||||
def LT(self):
|
||||
@@ -625,6 +621,10 @@ class BaserowFormula ( Parser ):
|
||||
return self.getToken(BaserowFormula.EQUAL, 0)
|
||||
def BANG_EQUAL(self):
|
||||
return self.getToken(BaserowFormula.BANG_EQUAL, 0)
|
||||
def AMP_AMP(self):
|
||||
return self.getToken(BaserowFormula.AMP_AMP, 0)
|
||||
def PIPE_PIPE(self):
|
||||
return self.getToken(BaserowFormula.PIPE_PIPE, 0)
|
||||
|
||||
def enterRule(self, listener:ParseTreeListener):
|
||||
if hasattr( listener, "enterBinaryOp" ):
|
||||
@@ -703,7 +703,7 @@ class BaserowFormula ( Parser ):
|
||||
self.state = 21
|
||||
self.ws_or_comment()
|
||||
self.state = 22
|
||||
self.expr(12)
|
||||
self.expr(13)
|
||||
pass
|
||||
elif token in [BaserowFormula.OPEN_PAREN]:
|
||||
localctx = BaserowFormula.BracketsContext(self, localctx)
|
||||
@@ -802,7 +802,7 @@ class BaserowFormula ( Parser ):
|
||||
raise NoViableAltException(self)
|
||||
|
||||
self._ctx.stop = self._input.LT(-1)
|
||||
self.state = 82
|
||||
self.state = 85
|
||||
self._errHandler.sync(self)
|
||||
_alt = self._interp.adaptivePredict(self._input,5,self._ctx)
|
||||
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
|
||||
@@ -810,16 +810,16 @@ class BaserowFormula ( Parser ):
|
||||
if self._parseListeners is not None:
|
||||
self.triggerExitRuleEvent()
|
||||
_prevctx = localctx
|
||||
self.state = 80
|
||||
self.state = 83
|
||||
self._errHandler.sync(self)
|
||||
la_ = self._interp.adaptivePredict(self._input,4,self._ctx)
|
||||
if la_ == 1:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 63
|
||||
if not self.precpred(self._ctx, 9):
|
||||
if not self.precpred(self._ctx, 10):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
|
||||
self.state = 64
|
||||
localctx.op = self._input.LT(1)
|
||||
_la = self._input.LA(1)
|
||||
@@ -829,16 +829,16 @@ class BaserowFormula ( Parser ):
|
||||
self._errHandler.reportMatch(self)
|
||||
self.consume()
|
||||
self.state = 65
|
||||
self.expr(10)
|
||||
self.expr(11)
|
||||
pass
|
||||
|
||||
elif la_ == 2:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 66
|
||||
if not self.precpred(self._ctx, 8):
|
||||
if not self.precpred(self._ctx, 9):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
|
||||
self.state = 67
|
||||
localctx.op = self._input.LT(1)
|
||||
_la = self._input.LA(1)
|
||||
@@ -848,55 +848,36 @@ class BaserowFormula ( Parser ):
|
||||
self._errHandler.reportMatch(self)
|
||||
self.consume()
|
||||
self.state = 68
|
||||
self.expr(9)
|
||||
self.expr(10)
|
||||
pass
|
||||
|
||||
elif la_ == 3:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 69
|
||||
if not self.precpred(self._ctx, 7):
|
||||
if not self.precpred(self._ctx, 8):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
|
||||
self.state = 70
|
||||
localctx.op = self._input.LT(1)
|
||||
_la = self._input.LA(1)
|
||||
if not(_la==BaserowFormula.AMP_AMP or _la==BaserowFormula.PIPE_PIPE):
|
||||
localctx.op = self._errHandler.recoverInline(self)
|
||||
else:
|
||||
self._errHandler.reportMatch(self)
|
||||
self.consume()
|
||||
self.state = 71
|
||||
self.expr(8)
|
||||
pass
|
||||
|
||||
elif la_ == 4:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 72
|
||||
if not self.precpred(self._ctx, 6):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
|
||||
self.state = 73
|
||||
localctx.op = self._input.LT(1)
|
||||
_la = self._input.LA(1)
|
||||
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BaserowFormula.GT) | (1 << BaserowFormula.GTE) | (1 << BaserowFormula.LT) | (1 << BaserowFormula.LTE))) != 0)):
|
||||
localctx.op = self._errHandler.recoverInline(self)
|
||||
else:
|
||||
self._errHandler.reportMatch(self)
|
||||
self.consume()
|
||||
self.state = 74
|
||||
self.expr(7)
|
||||
self.state = 71
|
||||
self.expr(9)
|
||||
pass
|
||||
|
||||
elif la_ == 5:
|
||||
elif la_ == 4:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 75
|
||||
if not self.precpred(self._ctx, 5):
|
||||
self.state = 72
|
||||
if not self.precpred(self._ctx, 7):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
|
||||
self.state = 76
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
|
||||
self.state = 73
|
||||
localctx.op = self._input.LT(1)
|
||||
_la = self._input.LA(1)
|
||||
if not(_la==BaserowFormula.BANG_EQUAL or _la==BaserowFormula.EQUAL):
|
||||
@@ -904,23 +885,49 @@ class BaserowFormula ( Parser ):
|
||||
else:
|
||||
self._errHandler.reportMatch(self)
|
||||
self.consume()
|
||||
self.state = 74
|
||||
self.expr(8)
|
||||
pass
|
||||
|
||||
elif la_ == 5:
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 75
|
||||
if not self.precpred(self._ctx, 6):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
|
||||
self.state = 76
|
||||
localctx.op = self.match(BaserowFormula.AMP_AMP)
|
||||
self.state = 77
|
||||
self.expr(6)
|
||||
self.expr(7)
|
||||
pass
|
||||
|
||||
elif la_ == 6:
|
||||
localctx = BaserowFormula.RightWhitespaceOrCommentsContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
localctx = BaserowFormula.BinaryOpContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 78
|
||||
if not self.precpred(self._ctx, 11):
|
||||
if not self.precpred(self._ctx, 5):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
|
||||
self.state = 79
|
||||
localctx.op = self.match(BaserowFormula.PIPE_PIPE)
|
||||
self.state = 80
|
||||
self.expr(6)
|
||||
pass
|
||||
|
||||
elif la_ == 7:
|
||||
localctx = BaserowFormula.RightWhitespaceOrCommentsContext(self, BaserowFormula.ExprContext(self, _parentctx, _parentState))
|
||||
self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
|
||||
self.state = 81
|
||||
if not self.precpred(self._ctx, 12):
|
||||
from antlr4.error.Errors import FailedPredicateException
|
||||
raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
|
||||
self.state = 82
|
||||
self.ws_or_comment()
|
||||
pass
|
||||
|
||||
|
||||
self.state = 84
|
||||
self.state = 87
|
||||
self._errHandler.sync(self)
|
||||
_alt = self._interp.adaptivePredict(self._input,5,self._ctx)
|
||||
|
||||
@@ -975,7 +982,7 @@ class BaserowFormula ( Parser ):
|
||||
self._la = 0 # Token type
|
||||
try:
|
||||
self.enterOuterAlt(localctx, 1)
|
||||
self.state = 85
|
||||
self.state = 88
|
||||
_la = self._input.LA(1)
|
||||
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << BaserowFormula.BLOCK_COMMENT) | (1 << BaserowFormula.LINE_COMMENT) | (1 << BaserowFormula.WHITESPACE))) != 0)):
|
||||
self._errHandler.recoverInline(self)
|
||||
@@ -1027,7 +1034,7 @@ class BaserowFormula ( Parser ):
|
||||
self.enterRule(localctx, 6, self.RULE_func_name)
|
||||
try:
|
||||
self.enterOuterAlt(localctx, 1)
|
||||
self.state = 87
|
||||
self.state = 90
|
||||
self.identifier()
|
||||
except RecognitionException as re:
|
||||
localctx.exception = re
|
||||
@@ -1077,7 +1084,7 @@ class BaserowFormula ( Parser ):
|
||||
self._la = 0 # Token type
|
||||
try:
|
||||
self.enterOuterAlt(localctx, 1)
|
||||
self.state = 89
|
||||
self.state = 92
|
||||
_la = self._input.LA(1)
|
||||
if not(_la==BaserowFormula.SINGLEQ_STRING_LITERAL or _la==BaserowFormula.DOUBLEQ_STRING_LITERAL):
|
||||
self._errHandler.recoverInline(self)
|
||||
@@ -1132,7 +1139,7 @@ class BaserowFormula ( Parser ):
|
||||
self._la = 0 # Token type
|
||||
try:
|
||||
self.enterOuterAlt(localctx, 1)
|
||||
self.state = 91
|
||||
self.state = 94
|
||||
_la = self._input.LA(1)
|
||||
if not(_la==BaserowFormula.IDENTIFIER or _la==BaserowFormula.IDENTIFIER_UNICODE):
|
||||
self._errHandler.recoverInline(self)
|
||||
@@ -1161,27 +1168,31 @@ class BaserowFormula ( Parser ):
|
||||
|
||||
def expr_sempred(self, localctx:ExprContext, predIndex:int):
|
||||
if predIndex == 0:
|
||||
return self.precpred(self._ctx, 9)
|
||||
return self.precpred(self._ctx, 10)
|
||||
|
||||
|
||||
if predIndex == 1:
|
||||
return self.precpred(self._ctx, 8)
|
||||
return self.precpred(self._ctx, 9)
|
||||
|
||||
|
||||
if predIndex == 2:
|
||||
return self.precpred(self._ctx, 7)
|
||||
return self.precpred(self._ctx, 8)
|
||||
|
||||
|
||||
if predIndex == 3:
|
||||
return self.precpred(self._ctx, 6)
|
||||
return self.precpred(self._ctx, 7)
|
||||
|
||||
|
||||
if predIndex == 4:
|
||||
return self.precpred(self._ctx, 5)
|
||||
return self.precpred(self._ctx, 6)
|
||||
|
||||
|
||||
if predIndex == 5:
|
||||
return self.precpred(self._ctx, 11)
|
||||
return self.precpred(self._ctx, 5)
|
||||
|
||||
|
||||
if predIndex == 6:
|
||||
return self.precpred(self._ctx, 12)
|
||||
|
||||
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"type": "bug",
|
||||
"message": "Resolved a bug in the Baserow formula parser which prevented the OR operator (`||`) from being applied correctly.",
|
||||
"issue_origin": "github",
|
||||
"issue_number": null,
|
||||
"domain": "core",
|
||||
"bullet_points": [],
|
||||
"created_at": "2025-12-30"
|
||||
}
|
||||
@@ -39,9 +39,10 @@ expr
|
||||
| OPEN_PAREN expr CLOSE_PAREN # Brackets
|
||||
| expr op=(SLASH | STAR) expr # BinaryOp
|
||||
| expr op=(PLUS | MINUS) expr # BinaryOp
|
||||
| expr op=(AMP_AMP | PIPE_PIPE) expr # BinaryOp
|
||||
| expr op=(GT | LT | GTE | LTE) expr # BinaryOp
|
||||
| expr op=(EQUAL | BANG_EQUAL) expr # BinaryOp
|
||||
| expr op=AMP_AMP expr # BinaryOp
|
||||
| expr op=PIPE_PIPE expr # BinaryOp
|
||||
| FIELD OPEN_PAREN field_reference CLOSE_PAREN # FieldReference
|
||||
// FIELDBYID has been deprecated and should not be used, it is only included here
|
||||
// for backwards compatability.
|
||||
|
||||
@@ -180,4 +180,4 @@ identifier
|
||||
|
||||
|
||||
atn:
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 85, 96, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 55, 10, 3, 12, 3, 14, 3, 58, 11, 3, 5, 3, 60, 10, 3, 3, 3, 3, 3, 5, 3, 64, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 83, 10, 3, 12, 3, 14, 3, 86, 11, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 2, 3, 4, 8, 2, 4, 6, 8, 10, 12, 2, 11, 3, 2, 6, 7, 4, 2, 16, 16, 75, 75, 4, 2, 63, 63, 69, 69, 4, 2, 32, 32, 66, 66, 4, 2, 43, 44, 54, 55, 4, 2, 39, 39, 41, 41, 3, 2, 3, 5, 3, 2, 27, 28, 3, 2, 29, 30, 2, 108, 2, 14, 3, 2, 2, 2, 4, 63, 3, 2, 2, 2, 6, 87, 3, 2, 2, 2, 8, 89, 3, 2, 2, 2, 10, 91, 3, 2, 2, 2, 12, 93, 3, 2, 2, 2, 14, 15, 5, 4, 3, 2, 15, 16, 7, 2, 2, 3, 16, 3, 3, 2, 2, 2, 17, 18, 8, 3, 1, 2, 18, 64, 7, 27, 2, 2, 19, 64, 7, 28, 2, 2, 20, 64, 7, 24, 2, 2, 21, 64, 7, 23, 2, 2, 22, 64, 9, 2, 2, 2, 23, 24, 5, 6, 4, 2, 24, 25, 5, 4, 3, 14, 25, 64, 3, 2, 2, 2, 26, 27, 7, 17, 2, 2, 27, 28, 5, 4, 3, 2, 28, 29, 7, 18, 2, 2, 29, 64, 3, 2, 2, 2, 30, 31, 7, 8, 2, 2, 31, 32, 7, 17, 2, 2, 32, 33, 5, 10, 6, 2, 33, 34, 7, 18, 2, 2, 34, 64, 3, 2, 2, 2, 35, 36, 7, 9, 2, 2, 36, 37, 7, 17, 2, 2, 37, 38, 7, 24, 2, 2, 38, 64, 7, 18, 2, 2, 39, 40, 7, 10, 2, 2, 40, 41, 7, 17, 2, 2, 41, 42, 5, 10, 6, 2, 42, 44, 7, 11, 2, 2, 43, 45, 7, 5, 2, 2, 44, 43, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 46, 3, 2, 2, 2, 46, 47, 5, 10, 6, 2, 47, 48, 7, 18, 2, 2, 48, 64, 3, 2, 2, 2, 49, 50, 5, 8, 5, 2, 50, 59, 7, 17, 2, 2, 51, 56, 5, 4, 3, 2, 52, 53, 7, 11, 2, 2, 53, 55, 5, 4, 3, 2, 54, 52, 3, 2, 2, 2, 55, 58, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 51, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 62, 7, 18, 2, 2, 62, 64, 3, 2, 2, 2, 63, 17, 3, 2, 2, 2, 63, 19, 3, 2, 2, 2, 63, 20, 3, 2, 2, 2, 63, 21, 3, 2, 2, 2, 63, 22, 3, 2, 2, 2, 63, 23, 3, 2, 2, 2, 63, 26, 3, 2, 2, 2, 63, 30, 3, 2, 2, 2, 63, 35, 3, 2, 2, 2, 63, 39, 3, 2, 2, 2, 63, 49, 3, 2, 2, 2, 64, 84, 3, 2, 2, 2, 65, 66, 12, 11, 2, 2, 66, 67, 9, 3, 2, 2, 67, 83, 5, 4, 3, 12, 68, 69, 12, 10, 2, 2, 69, 70, 9, 4, 2, 2, 70, 83, 5, 4, 3, 11, 71, 72, 12, 9, 2, 2, 72, 73, 9, 5, 2, 2, 73, 83, 5, 4, 3, 10, 74, 75, 12, 8, 2, 2, 75, 76, 9, 6, 2, 2, 76, 83, 5, 4, 3, 9, 77, 78, 12, 7, 2, 2, 78, 79, 9, 7, 2, 2, 79, 83, 5, 4, 3, 8, 80, 81, 12, 13, 2, 2, 81, 83, 5, 6, 4, 2, 82, 65, 3, 2, 2, 2, 82, 68, 3, 2, 2, 2, 82, 71, 3, 2, 2, 2, 82, 74, 3, 2, 2, 2, 82, 77, 3, 2, 2, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 5, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 87, 88, 9, 8, 2, 2, 88, 7, 3, 2, 2, 2, 89, 90, 5, 12, 7, 2, 90, 9, 3, 2, 2, 2, 91, 92, 9, 9, 2, 2, 92, 11, 3, 2, 2, 2, 93, 94, 9, 10, 2, 2, 94, 13, 3, 2, 2, 2, 8, 44, 56, 59, 63, 82, 84]
|
||||
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 85, 99, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 55, 10, 3, 12, 3, 14, 3, 58, 11, 3, 5, 3, 60, 10, 3, 3, 3, 3, 3, 5, 3, 64, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 86, 10, 3, 12, 3, 14, 3, 89, 11, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 2, 3, 4, 8, 2, 4, 6, 8, 10, 12, 2, 10, 3, 2, 6, 7, 4, 2, 16, 16, 75, 75, 4, 2, 63, 63, 69, 69, 4, 2, 43, 44, 54, 55, 4, 2, 39, 39, 41, 41, 3, 2, 3, 5, 3, 2, 27, 28, 3, 2, 29, 30, 2, 112, 2, 14, 3, 2, 2, 2, 4, 63, 3, 2, 2, 2, 6, 90, 3, 2, 2, 2, 8, 92, 3, 2, 2, 2, 10, 94, 3, 2, 2, 2, 12, 96, 3, 2, 2, 2, 14, 15, 5, 4, 3, 2, 15, 16, 7, 2, 2, 3, 16, 3, 3, 2, 2, 2, 17, 18, 8, 3, 1, 2, 18, 64, 7, 27, 2, 2, 19, 64, 7, 28, 2, 2, 20, 64, 7, 24, 2, 2, 21, 64, 7, 23, 2, 2, 22, 64, 9, 2, 2, 2, 23, 24, 5, 6, 4, 2, 24, 25, 5, 4, 3, 15, 25, 64, 3, 2, 2, 2, 26, 27, 7, 17, 2, 2, 27, 28, 5, 4, 3, 2, 28, 29, 7, 18, 2, 2, 29, 64, 3, 2, 2, 2, 30, 31, 7, 8, 2, 2, 31, 32, 7, 17, 2, 2, 32, 33, 5, 10, 6, 2, 33, 34, 7, 18, 2, 2, 34, 64, 3, 2, 2, 2, 35, 36, 7, 9, 2, 2, 36, 37, 7, 17, 2, 2, 37, 38, 7, 24, 2, 2, 38, 64, 7, 18, 2, 2, 39, 40, 7, 10, 2, 2, 40, 41, 7, 17, 2, 2, 41, 42, 5, 10, 6, 2, 42, 44, 7, 11, 2, 2, 43, 45, 7, 5, 2, 2, 44, 43, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 46, 3, 2, 2, 2, 46, 47, 5, 10, 6, 2, 47, 48, 7, 18, 2, 2, 48, 64, 3, 2, 2, 2, 49, 50, 5, 8, 5, 2, 50, 59, 7, 17, 2, 2, 51, 56, 5, 4, 3, 2, 52, 53, 7, 11, 2, 2, 53, 55, 5, 4, 3, 2, 54, 52, 3, 2, 2, 2, 55, 58, 3, 2, 2, 2, 56, 54, 3, 2, 2, 2, 56, 57, 3, 2, 2, 2, 57, 60, 3, 2, 2, 2, 58, 56, 3, 2, 2, 2, 59, 51, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 62, 7, 18, 2, 2, 62, 64, 3, 2, 2, 2, 63, 17, 3, 2, 2, 2, 63, 19, 3, 2, 2, 2, 63, 20, 3, 2, 2, 2, 63, 21, 3, 2, 2, 2, 63, 22, 3, 2, 2, 2, 63, 23, 3, 2, 2, 2, 63, 26, 3, 2, 2, 2, 63, 30, 3, 2, 2, 2, 63, 35, 3, 2, 2, 2, 63, 39, 3, 2, 2, 2, 63, 49, 3, 2, 2, 2, 64, 87, 3, 2, 2, 2, 65, 66, 12, 12, 2, 2, 66, 67, 9, 3, 2, 2, 67, 86, 5, 4, 3, 13, 68, 69, 12, 11, 2, 2, 69, 70, 9, 4, 2, 2, 70, 86, 5, 4, 3, 12, 71, 72, 12, 10, 2, 2, 72, 73, 9, 5, 2, 2, 73, 86, 5, 4, 3, 11, 74, 75, 12, 9, 2, 2, 75, 76, 9, 6, 2, 2, 76, 86, 5, 4, 3, 10, 77, 78, 12, 8, 2, 2, 78, 79, 7, 32, 2, 2, 79, 86, 5, 4, 3, 9, 80, 81, 12, 7, 2, 2, 81, 82, 7, 66, 2, 2, 82, 86, 5, 4, 3, 8, 83, 84, 12, 14, 2, 2, 84, 86, 5, 6, 4, 2, 85, 65, 3, 2, 2, 2, 85, 68, 3, 2, 2, 2, 85, 71, 3, 2, 2, 2, 85, 74, 3, 2, 2, 2, 85, 77, 3, 2, 2, 2, 85, 80, 3, 2, 2, 2, 85, 83, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 90, 91, 9, 7, 2, 2, 91, 7, 3, 2, 2, 2, 92, 93, 5, 12, 7, 2, 93, 9, 3, 2, 2, 2, 94, 95, 9, 8, 2, 2, 95, 11, 3, 2, 2, 2, 96, 97, 9, 9, 2, 2, 97, 13, 3, 2, 2, 2, 8, 44, 56, 59, 63, 85, 87]
|
||||
@@ -6,7 +6,7 @@ import BaserowFormulaVisitor from './BaserowFormulaVisitor.js';
|
||||
|
||||
|
||||
const serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786",
|
||||
"\u5964\u0003U`\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004\u0004\t",
|
||||
"\u5964\u0003Uc\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004\u0004\t",
|
||||
"\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t\u0007\u0003",
|
||||
"\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
|
||||
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
|
||||
@@ -19,53 +19,55 @@ const serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786",
|
||||
"\u0005\u0003@\n\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
|
||||
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
|
||||
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
|
||||
"\u0003\u0003\u0007\u0003S\n\u0003\f\u0003\u000e\u0003V\u000b\u0003\u0003",
|
||||
"\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003\u0006\u0003\u0006\u0003",
|
||||
"\u0007\u0003\u0007\u0003\u0007\u0002\u0003\u0004\b\u0002\u0004\u0006",
|
||||
"\b\n\f\u0002\u000b\u0003\u0002\u0006\u0007\u0004\u0002\u0010\u0010K",
|
||||
"K\u0004\u0002??EE\u0004\u0002 BB\u0004\u0002+,67\u0004\u0002\'\'))",
|
||||
"\u0003\u0002\u0003\u0005\u0003\u0002\u001b\u001c\u0003\u0002\u001d\u001e",
|
||||
"\u0002l\u0002\u000e\u0003\u0002\u0002\u0002\u0004?\u0003\u0002\u0002",
|
||||
"\u0002\u0006W\u0003\u0002\u0002\u0002\bY\u0003\u0002\u0002\u0002\n[",
|
||||
"\u0003\u0002\u0002\u0002\f]\u0003\u0002\u0002\u0002\u000e\u000f\u0005",
|
||||
"\u0004\u0003\u0002\u000f\u0010\u0007\u0002\u0002\u0003\u0010\u0003\u0003",
|
||||
"\u0002\u0002\u0002\u0011\u0012\b\u0003\u0001\u0002\u0012@\u0007\u001b",
|
||||
"\u0002\u0002\u0013@\u0007\u001c\u0002\u0002\u0014@\u0007\u0018\u0002",
|
||||
"\u0002\u0015@\u0007\u0017\u0002\u0002\u0016@\t\u0002\u0002\u0002\u0017",
|
||||
"\u0018\u0005\u0006\u0004\u0002\u0018\u0019\u0005\u0004\u0003\u000e\u0019",
|
||||
"@\u0003\u0002\u0002\u0002\u001a\u001b\u0007\u0011\u0002\u0002\u001b",
|
||||
"\u001c\u0005\u0004\u0003\u0002\u001c\u001d\u0007\u0012\u0002\u0002\u001d",
|
||||
"@\u0003\u0002\u0002\u0002\u001e\u001f\u0007\b\u0002\u0002\u001f \u0007",
|
||||
"\u0011\u0002\u0002 !\u0005\n\u0006\u0002!\"\u0007\u0012\u0002\u0002",
|
||||
"\"@\u0003\u0002\u0002\u0002#$\u0007\t\u0002\u0002$%\u0007\u0011\u0002",
|
||||
"\u0002%&\u0007\u0018\u0002\u0002&@\u0007\u0012\u0002\u0002\'(\u0007",
|
||||
"\n\u0002\u0002()\u0007\u0011\u0002\u0002)*\u0005\n\u0006\u0002*,\u0007",
|
||||
"\u000b\u0002\u0002+-\u0007\u0005\u0002\u0002,+\u0003\u0002\u0002\u0002",
|
||||
",-\u0003\u0002\u0002\u0002-.\u0003\u0002\u0002\u0002./\u0005\n\u0006",
|
||||
"\u0002/0\u0007\u0012\u0002\u00020@\u0003\u0002\u0002\u000212\u0005\b",
|
||||
"\u0005\u00022;\u0007\u0011\u0002\u000238\u0005\u0004\u0003\u000245\u0007",
|
||||
"\u000b\u0002\u000257\u0005\u0004\u0003\u000264\u0003\u0002\u0002\u0002",
|
||||
"7:\u0003\u0002\u0002\u000286\u0003\u0002\u0002\u000289\u0003\u0002\u0002",
|
||||
"\u00029<\u0003\u0002\u0002\u0002:8\u0003\u0002\u0002\u0002;3\u0003\u0002",
|
||||
"\u0002\u0002;<\u0003\u0002\u0002\u0002<=\u0003\u0002\u0002\u0002=>\u0007",
|
||||
"\u0012\u0002\u0002>@\u0003\u0002\u0002\u0002?\u0011\u0003\u0002\u0002",
|
||||
"\u0002?\u0013\u0003\u0002\u0002\u0002?\u0014\u0003\u0002\u0002\u0002",
|
||||
"?\u0015\u0003\u0002\u0002\u0002?\u0016\u0003\u0002\u0002\u0002?\u0017",
|
||||
"\u0003\u0002\u0002\u0002?\u001a\u0003\u0002\u0002\u0002?\u001e\u0003",
|
||||
"\u0002\u0002\u0002?#\u0003\u0002\u0002\u0002?\'\u0003\u0002\u0002\u0002",
|
||||
"?1\u0003\u0002\u0002\u0002@T\u0003\u0002\u0002\u0002AB\f\u000b\u0002",
|
||||
"\u0002BC\t\u0003\u0002\u0002CS\u0005\u0004\u0003\fDE\f\n\u0002\u0002",
|
||||
"EF\t\u0004\u0002\u0002FS\u0005\u0004\u0003\u000bGH\f\t\u0002\u0002H",
|
||||
"I\t\u0005\u0002\u0002IS\u0005\u0004\u0003\nJK\f\b\u0002\u0002KL\t\u0006",
|
||||
"\u0002\u0002LS\u0005\u0004\u0003\tMN\f\u0007\u0002\u0002NO\t\u0007\u0002",
|
||||
"\u0002OS\u0005\u0004\u0003\bPQ\f\r\u0002\u0002QS\u0005\u0006\u0004\u0002",
|
||||
"RA\u0003\u0002\u0002\u0002RD\u0003\u0002\u0002\u0002RG\u0003\u0002\u0002",
|
||||
"\u0002RJ\u0003\u0002\u0002\u0002RM\u0003\u0002\u0002\u0002RP\u0003\u0002",
|
||||
"\u0002\u0002SV\u0003\u0002\u0002\u0002TR\u0003\u0002\u0002\u0002TU\u0003",
|
||||
"\u0002\u0002\u0002U\u0005\u0003\u0002\u0002\u0002VT\u0003\u0002\u0002",
|
||||
"\u0002WX\t\b\u0002\u0002X\u0007\u0003\u0002\u0002\u0002YZ\u0005\f\u0007",
|
||||
"\u0002Z\t\u0003\u0002\u0002\u0002[\\\t\t\u0002\u0002\\\u000b\u0003\u0002",
|
||||
"\u0002\u0002]^\t\n\u0002\u0002^\r\u0003\u0002\u0002\u0002\b,8;?RT"].join("");
|
||||
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0007\u0003V\n\u0003",
|
||||
"\f\u0003\u000e\u0003Y\u000b\u0003\u0003\u0004\u0003\u0004\u0003\u0005",
|
||||
"\u0003\u0005\u0003\u0006\u0003\u0006\u0003\u0007\u0003\u0007\u0003\u0007",
|
||||
"\u0002\u0003\u0004\b\u0002\u0004\u0006\b\n\f\u0002\n\u0003\u0002\u0006",
|
||||
"\u0007\u0004\u0002\u0010\u0010KK\u0004\u0002??EE\u0004\u0002+,67\u0004",
|
||||
"\u0002\'\'))\u0003\u0002\u0003\u0005\u0003\u0002\u001b\u001c\u0003\u0002",
|
||||
"\u001d\u001e\u0002p\u0002\u000e\u0003\u0002\u0002\u0002\u0004?\u0003",
|
||||
"\u0002\u0002\u0002\u0006Z\u0003\u0002\u0002\u0002\b\\\u0003\u0002\u0002",
|
||||
"\u0002\n^\u0003\u0002\u0002\u0002\f`\u0003\u0002\u0002\u0002\u000e\u000f",
|
||||
"\u0005\u0004\u0003\u0002\u000f\u0010\u0007\u0002\u0002\u0003\u0010\u0003",
|
||||
"\u0003\u0002\u0002\u0002\u0011\u0012\b\u0003\u0001\u0002\u0012@\u0007",
|
||||
"\u001b\u0002\u0002\u0013@\u0007\u001c\u0002\u0002\u0014@\u0007\u0018",
|
||||
"\u0002\u0002\u0015@\u0007\u0017\u0002\u0002\u0016@\t\u0002\u0002\u0002",
|
||||
"\u0017\u0018\u0005\u0006\u0004\u0002\u0018\u0019\u0005\u0004\u0003\u000f",
|
||||
"\u0019@\u0003\u0002\u0002\u0002\u001a\u001b\u0007\u0011\u0002\u0002",
|
||||
"\u001b\u001c\u0005\u0004\u0003\u0002\u001c\u001d\u0007\u0012\u0002\u0002",
|
||||
"\u001d@\u0003\u0002\u0002\u0002\u001e\u001f\u0007\b\u0002\u0002\u001f",
|
||||
" \u0007\u0011\u0002\u0002 !\u0005\n\u0006\u0002!\"\u0007\u0012\u0002",
|
||||
"\u0002\"@\u0003\u0002\u0002\u0002#$\u0007\t\u0002\u0002$%\u0007\u0011",
|
||||
"\u0002\u0002%&\u0007\u0018\u0002\u0002&@\u0007\u0012\u0002\u0002\'(",
|
||||
"\u0007\n\u0002\u0002()\u0007\u0011\u0002\u0002)*\u0005\n\u0006\u0002",
|
||||
"*,\u0007\u000b\u0002\u0002+-\u0007\u0005\u0002\u0002,+\u0003\u0002\u0002",
|
||||
"\u0002,-\u0003\u0002\u0002\u0002-.\u0003\u0002\u0002\u0002./\u0005\n",
|
||||
"\u0006\u0002/0\u0007\u0012\u0002\u00020@\u0003\u0002\u0002\u000212\u0005",
|
||||
"\b\u0005\u00022;\u0007\u0011\u0002\u000238\u0005\u0004\u0003\u00024",
|
||||
"5\u0007\u000b\u0002\u000257\u0005\u0004\u0003\u000264\u0003\u0002\u0002",
|
||||
"\u00027:\u0003\u0002\u0002\u000286\u0003\u0002\u0002\u000289\u0003\u0002",
|
||||
"\u0002\u00029<\u0003\u0002\u0002\u0002:8\u0003\u0002\u0002\u0002;3\u0003",
|
||||
"\u0002\u0002\u0002;<\u0003\u0002\u0002\u0002<=\u0003\u0002\u0002\u0002",
|
||||
"=>\u0007\u0012\u0002\u0002>@\u0003\u0002\u0002\u0002?\u0011\u0003\u0002",
|
||||
"\u0002\u0002?\u0013\u0003\u0002\u0002\u0002?\u0014\u0003\u0002\u0002",
|
||||
"\u0002?\u0015\u0003\u0002\u0002\u0002?\u0016\u0003\u0002\u0002\u0002",
|
||||
"?\u0017\u0003\u0002\u0002\u0002?\u001a\u0003\u0002\u0002\u0002?\u001e",
|
||||
"\u0003\u0002\u0002\u0002?#\u0003\u0002\u0002\u0002?\'\u0003\u0002\u0002",
|
||||
"\u0002?1\u0003\u0002\u0002\u0002@W\u0003\u0002\u0002\u0002AB\f\f\u0002",
|
||||
"\u0002BC\t\u0003\u0002\u0002CV\u0005\u0004\u0003\rDE\f\u000b\u0002\u0002",
|
||||
"EF\t\u0004\u0002\u0002FV\u0005\u0004\u0003\fGH\f\n\u0002\u0002HI\t\u0005",
|
||||
"\u0002\u0002IV\u0005\u0004\u0003\u000bJK\f\t\u0002\u0002KL\t\u0006\u0002",
|
||||
"\u0002LV\u0005\u0004\u0003\nMN\f\b\u0002\u0002NO\u0007 \u0002\u0002",
|
||||
"OV\u0005\u0004\u0003\tPQ\f\u0007\u0002\u0002QR\u0007B\u0002\u0002RV",
|
||||
"\u0005\u0004\u0003\bST\f\u000e\u0002\u0002TV\u0005\u0006\u0004\u0002",
|
||||
"UA\u0003\u0002\u0002\u0002UD\u0003\u0002\u0002\u0002UG\u0003\u0002\u0002",
|
||||
"\u0002UJ\u0003\u0002\u0002\u0002UM\u0003\u0002\u0002\u0002UP\u0003\u0002",
|
||||
"\u0002\u0002US\u0003\u0002\u0002\u0002VY\u0003\u0002\u0002\u0002WU\u0003",
|
||||
"\u0002\u0002\u0002WX\u0003\u0002\u0002\u0002X\u0005\u0003\u0002\u0002",
|
||||
"\u0002YW\u0003\u0002\u0002\u0002Z[\t\u0007\u0002\u0002[\u0007\u0003",
|
||||
"\u0002\u0002\u0002\\]\u0005\f\u0007\u0002]\t\u0003\u0002\u0002\u0002",
|
||||
"^_\t\b\u0002\u0002_\u000b\u0003\u0002\u0002\u0002`a\t\t\u0002\u0002",
|
||||
"a\r\u0003\u0002\u0002\u0002\b,8;?UW"].join("");
|
||||
|
||||
|
||||
const atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
|
||||
@@ -138,17 +140,19 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
expr_sempred(localctx, predIndex) {
|
||||
switch(predIndex) {
|
||||
case 0:
|
||||
return this.precpred(this._ctx, 9);
|
||||
return this.precpred(this._ctx, 10);
|
||||
case 1:
|
||||
return this.precpred(this._ctx, 8);
|
||||
return this.precpred(this._ctx, 9);
|
||||
case 2:
|
||||
return this.precpred(this._ctx, 7);
|
||||
return this.precpred(this._ctx, 8);
|
||||
case 3:
|
||||
return this.precpred(this._ctx, 6);
|
||||
return this.precpred(this._ctx, 7);
|
||||
case 4:
|
||||
return this.precpred(this._ctx, 5);
|
||||
return this.precpred(this._ctx, 6);
|
||||
case 5:
|
||||
return this.precpred(this._ctx, 11);
|
||||
return this.precpred(this._ctx, 5);
|
||||
case 6:
|
||||
return this.precpred(this._ctx, 12);
|
||||
default:
|
||||
throw "No predicate with index:" + predIndex;
|
||||
}
|
||||
@@ -250,7 +254,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this.state = 21;
|
||||
this.ws_or_comment();
|
||||
this.state = 22;
|
||||
this.expr(12);
|
||||
this.expr(13);
|
||||
break;
|
||||
case BaserowFormula.OPEN_PAREN:
|
||||
localctx = new BracketsContext(this, localctx);
|
||||
@@ -350,7 +354,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
throw new antlr4.error.NoViableAltException(this);
|
||||
}
|
||||
this._ctx.stop = this._input.LT(-1);
|
||||
this.state = 82;
|
||||
this.state = 85;
|
||||
this._errHandler.sync(this);
|
||||
let _alt = this._interp.adaptivePredict(this._input,5,this._ctx)
|
||||
while(_alt!=2 && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
|
||||
@@ -359,7 +363,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this.triggerExitRuleEvent();
|
||||
}
|
||||
_prevctx = localctx;
|
||||
this.state = 80;
|
||||
this.state = 83;
|
||||
this._errHandler.sync(this);
|
||||
var la_ = this._interp.adaptivePredict(this._input,4,this._ctx);
|
||||
switch(la_) {
|
||||
@@ -367,8 +371,8 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 63;
|
||||
if (!( this.precpred(this._ctx, 9))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 9)");
|
||||
if (!( this.precpred(this._ctx, 10))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 10)");
|
||||
}
|
||||
this.state = 64;
|
||||
localctx.op = this._input.LT(1);
|
||||
@@ -381,15 +385,15 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this.consume();
|
||||
}
|
||||
this.state = 65;
|
||||
this.expr(10);
|
||||
this.expr(11);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 66;
|
||||
if (!( this.precpred(this._ctx, 8))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 8)");
|
||||
if (!( this.precpred(this._ctx, 9))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 9)");
|
||||
}
|
||||
this.state = 67;
|
||||
localctx.op = this._input.LT(1);
|
||||
@@ -402,40 +406,19 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this.consume();
|
||||
}
|
||||
this.state = 68;
|
||||
this.expr(9);
|
||||
this.expr(10);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 69;
|
||||
if (!( this.precpred(this._ctx, 7))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 7)");
|
||||
if (!( this.precpred(this._ctx, 8))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 8)");
|
||||
}
|
||||
this.state = 70;
|
||||
localctx.op = this._input.LT(1);
|
||||
_la = this._input.LA(1);
|
||||
if(!(_la===BaserowFormula.AMP_AMP || _la===BaserowFormula.PIPE_PIPE)) {
|
||||
localctx.op = this._errHandler.recoverInline(this);
|
||||
}
|
||||
else {
|
||||
this._errHandler.reportMatch(this);
|
||||
this.consume();
|
||||
}
|
||||
this.state = 71;
|
||||
this.expr(8);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 72;
|
||||
if (!( this.precpred(this._ctx, 6))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 6)");
|
||||
}
|
||||
this.state = 73;
|
||||
localctx.op = this._input.LT(1);
|
||||
_la = this._input.LA(1);
|
||||
if(!(((((_la - 41)) & ~0x1f) == 0 && ((1 << (_la - 41)) & ((1 << (BaserowFormula.GT - 41)) | (1 << (BaserowFormula.GTE - 41)) | (1 << (BaserowFormula.LT - 41)) | (1 << (BaserowFormula.LTE - 41)))) !== 0))) {
|
||||
localctx.op = this._errHandler.recoverInline(this);
|
||||
}
|
||||
@@ -443,18 +426,18 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this._errHandler.reportMatch(this);
|
||||
this.consume();
|
||||
}
|
||||
this.state = 74;
|
||||
this.expr(7);
|
||||
this.state = 71;
|
||||
this.expr(9);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 4:
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 75;
|
||||
if (!( this.precpred(this._ctx, 5))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 5)");
|
||||
this.state = 72;
|
||||
if (!( this.precpred(this._ctx, 7))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 7)");
|
||||
}
|
||||
this.state = 76;
|
||||
this.state = 73;
|
||||
localctx.op = this._input.LT(1);
|
||||
_la = this._input.LA(1);
|
||||
if(!(_la===BaserowFormula.BANG_EQUAL || _la===BaserowFormula.EQUAL)) {
|
||||
@@ -464,24 +447,50 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this._errHandler.reportMatch(this);
|
||||
this.consume();
|
||||
}
|
||||
this.state = 74;
|
||||
this.expr(8);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 75;
|
||||
if (!( this.precpred(this._ctx, 6))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 6)");
|
||||
}
|
||||
this.state = 76;
|
||||
localctx.op = this.match(BaserowFormula.AMP_AMP);
|
||||
this.state = 77;
|
||||
this.expr(6);
|
||||
this.expr(7);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
localctx = new RightWhitespaceOrCommentsContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
localctx = new BinaryOpContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 78;
|
||||
if (!( this.precpred(this._ctx, 11))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 11)");
|
||||
if (!( this.precpred(this._ctx, 5))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 5)");
|
||||
}
|
||||
this.state = 79;
|
||||
localctx.op = this.match(BaserowFormula.PIPE_PIPE);
|
||||
this.state = 80;
|
||||
this.expr(6);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
localctx = new RightWhitespaceOrCommentsContext(this, new ExprContext(this, _parentctx, _parentState));
|
||||
this.pushNewRecursionContext(localctx, _startState, BaserowFormula.RULE_expr);
|
||||
this.state = 81;
|
||||
if (!( this.precpred(this._ctx, 12))) {
|
||||
throw new antlr4.error.FailedPredicateException(this, "this.precpred(this._ctx, 12)");
|
||||
}
|
||||
this.state = 82;
|
||||
this.ws_or_comment();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
this.state = 84;
|
||||
this.state = 87;
|
||||
this._errHandler.sync(this);
|
||||
_alt = this._interp.adaptivePredict(this._input,5,this._ctx);
|
||||
}
|
||||
@@ -508,7 +517,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
var _la = 0; // Token type
|
||||
try {
|
||||
this.enterOuterAlt(localctx, 1);
|
||||
this.state = 85;
|
||||
this.state = 88;
|
||||
_la = this._input.LA(1);
|
||||
if(!((((_la) & ~0x1f) == 0 && ((1 << _la) & ((1 << BaserowFormula.BLOCK_COMMENT) | (1 << BaserowFormula.LINE_COMMENT) | (1 << BaserowFormula.WHITESPACE))) !== 0))) {
|
||||
this._errHandler.recoverInline(this);
|
||||
@@ -538,7 +547,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
this.enterRule(localctx, 6, BaserowFormula.RULE_func_name);
|
||||
try {
|
||||
this.enterOuterAlt(localctx, 1);
|
||||
this.state = 87;
|
||||
this.state = 90;
|
||||
this.identifier();
|
||||
} catch (re) {
|
||||
if(re instanceof antlr4.error.RecognitionException) {
|
||||
@@ -562,7 +571,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
var _la = 0; // Token type
|
||||
try {
|
||||
this.enterOuterAlt(localctx, 1);
|
||||
this.state = 89;
|
||||
this.state = 92;
|
||||
_la = this._input.LA(1);
|
||||
if(!(_la===BaserowFormula.SINGLEQ_STRING_LITERAL || _la===BaserowFormula.DOUBLEQ_STRING_LITERAL)) {
|
||||
this._errHandler.recoverInline(this);
|
||||
@@ -593,7 +602,7 @@ export default class BaserowFormula extends antlr4.Parser {
|
||||
var _la = 0; // Token type
|
||||
try {
|
||||
this.enterOuterAlt(localctx, 1);
|
||||
this.state = 91;
|
||||
this.state = 94;
|
||||
_la = this._input.LA(1);
|
||||
if(!(_la===BaserowFormula.IDENTIFIER || _la===BaserowFormula.IDENTIFIER_UNICODE)) {
|
||||
this._errHandler.recoverInline(this);
|
||||
@@ -1318,14 +1327,6 @@ class BinaryOpContext extends ExprContext {
|
||||
return this.getToken(BaserowFormula.MINUS, 0);
|
||||
};
|
||||
|
||||
AMP_AMP() {
|
||||
return this.getToken(BaserowFormula.AMP_AMP, 0);
|
||||
};
|
||||
|
||||
PIPE_PIPE() {
|
||||
return this.getToken(BaserowFormula.PIPE_PIPE, 0);
|
||||
};
|
||||
|
||||
GT() {
|
||||
return this.getToken(BaserowFormula.GT, 0);
|
||||
};
|
||||
@@ -1350,6 +1351,14 @@ class BinaryOpContext extends ExprContext {
|
||||
return this.getToken(BaserowFormula.BANG_EQUAL, 0);
|
||||
};
|
||||
|
||||
AMP_AMP() {
|
||||
return this.getToken(BaserowFormula.AMP_AMP, 0);
|
||||
};
|
||||
|
||||
PIPE_PIPE() {
|
||||
return this.getToken(BaserowFormula.PIPE_PIPE, 0);
|
||||
};
|
||||
|
||||
enterRule(listener) {
|
||||
if(listener instanceof BaserowFormulaListener ) {
|
||||
listener.enterBinaryOp(this);
|
||||
|
||||
Reference in new issue
Block a user