Skip to content

Commit 4f1c7aa

Browse files
authored
Merge pull request #20 from anboralabs/operators
Operators
2 parents 08064c2 + fd4c88f commit 4f1c7aa

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ grammarKit {
1212
}
1313

1414
group 'co.anbora.labs'
15-
version '1.1.3-SNAPSHOT'
15+
version '1.1.4-SNAPSHOT'
1616

1717
repositories {
1818
mavenCentral()
@@ -51,7 +51,7 @@ sourceSets.main.java.srcDirs 'src/main/gen'
5151

5252
// See https://github.com/JetBrains/gradle-intellij-plugin/
5353
intellij {
54-
version = '2020.2.2'
54+
version = 'IU-2020.2.2'
5555
}
5656

5757
buildPlugin {
@@ -65,6 +65,12 @@ publishPlugin {
6565
patchPluginXml {
6666
changeNotes """
6767
<ul>
68+
<li><b>1.1.4</b> <em>(2020-11-19)</em> - Added operators support</li>
69+
<ul>
70+
<li>Added operation with numbers support: +, -, *, / </li>
71+
<li>Added operation with strings support: +, * </li>
72+
</ul>
73+
</li>
6874
<li><b>1.1.3</b> <em>(2020-11-19)</em> - comments issue</li>
6975
<ul>
7076
<li>Fixed false positive with comments in match body statement</li>

src/main/grammar/FirebaseRules.bnf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,15 @@ Expression ::= BooleanStatement
9393

9494
ArrayLiteralStatement ::= LB (ParameterStatement|ArrayLiteralStatement) RB
9595

96-
LiteralStatement ::= (number|string)
96+
LiteralStatement ::= (NumberLiteralStatement|StringLiteralStatement)
97+
98+
NumberLiteralStatement ::= number (NumberOperator number)*
99+
100+
StringLiteralStatement ::= string (StringOperator string)*
101+
102+
StringOperator ::= (PLUS_OP|MULT_OP)
103+
104+
NumberOperator ::= (PLUS_OP|MINUS_OP|MULT_OP|SLASH)
97105

98106
NullStatement ::= NULL_KEYWORD
99107

src/main/grammar/FirebaseRules.flex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ PATH_BUILT_IN=[$][(][a-zA-Z_\-0-9]+[a-zA-Z_\.\-0-9]*[)]
7777
">" { return GT; }
7878
">=" { return GE; }
7979

80+
"+" { return PLUS_OP; }
81+
"-" { return MINUS_OP; }
82+
"*" { return MULT_OP; }
83+
8084
"(" { return LP; }
8185
")" { return RP; }
8286
"[" { return LB; }

0 commit comments

Comments
 (0)