Dev #127

Merged
altavir merged 214 commits from dev into master 2020-08-11 08:33:21 +03:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 45087f8b2d - Show all commits

View File

@ -2,9 +2,10 @@ grammar ArithmeticsEvaluator;
fragment DIGIT: '0'..'9';
fragment LETTER: 'a'..'z';
fragment CAPITAL_LETTER: 'A'..'Z'
fragment UNDERSCORE: '_';
ID: (LETTER | UNDERSCORE) (LETTER | UNDERSCORE | DIGIT)*;
ID: (LETTER | UNDERSCORE | CAPITAL_LETTER) (LETTER | UNDERSCORE | DIGIT | CAPITAL_LETTER)*;
NUM: (DIGIT | '.')+ ([eE] MINUS? DIGIT+)?;
MUL: '*';
DIV: '/';

View File

@ -19,7 +19,7 @@ import scientifik.kmath.operations.SpaceOperations
*/
object ArithmeticsEvaluator : Grammar<MST>() {
private val num: Token by token("[\\d.]+(?:[eE]-?\\d+)?".toRegex())
private val id: Token by token("[a-z_][\\da-z_]*".toRegex())
private val id: Token by token("[a-z_A-Z][\\da-z_A-Z]*".toRegex())
private val lpar: Token by token("\\(".toRegex())
private val rpar: Token by token("\\)".toRegex())
private val comma: Token by token(",".toRegex())