Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 02:50:05 +01:00
Catch small edge-case in parser
Dieser Commit ist enthalten in:
Ursprung
ae71c2a51b
Commit
777b132a04
@ -63,7 +63,7 @@ fragment EXP_CHAR : [eE] ;
|
|||||||
fragment DECIMAL : '.' DIGIT+ ( EXP_CHAR SIGN? DIGIT+ )? ;
|
fragment DECIMAL : '.' DIGIT+ ( EXP_CHAR SIGN? DIGIT+ )? ;
|
||||||
|
|
||||||
// All numbers are treated the same. No int/dec divide.
|
// All numbers are treated the same. No int/dec divide.
|
||||||
NUMBER : SIGN? ( DIGIT+ DECIMAL? | DECIMAL ) ;
|
NUMBER : ( DIGIT+ DECIMAL? | DECIMAL ) ;
|
||||||
|
|
||||||
ID : [A-Za-z] [0-9A-Za-z_]* ;
|
ID : [A-Za-z] [0-9A-Za-z_]* ;
|
||||||
|
|
||||||
|
@ -74,6 +74,11 @@ public class ExpressionTest {
|
|||||||
assertEquals(8, compile("foo+bar", "foo", "bar").evaluate(5D, 3D), 0);
|
assertEquals(8, compile("foo+bar", "foo", "bar").evaluate(5D, 3D), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testTightTokenization() {
|
||||||
|
assertEquals(4, simpleEval("3+1"), 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testErrors() {
|
public void testErrors() {
|
||||||
// test lexer errors
|
// test lexer errors
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren