Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-02 17:40:09 +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+ )? ;
|
||||
|
||||
// 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_]* ;
|
||||
|
||||
|
@ -74,6 +74,11 @@ public class ExpressionTest {
|
||||
assertEquals(8, compile("foo+bar", "foo", "bar").evaluate(5D, 3D), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTightTokenization() {
|
||||
assertEquals(4, simpleEval("3+1"), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testErrors() {
|
||||
// test lexer errors
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren