It's currently not possible to use unicode/emoji characters within an expression without the lexer being unhappy. At the moment non-ASCII characters only work within string literals.
I propose we add the ability for these characters to be used as variable names. This would be useful for non-English and joke applications.
Expected:
const OpenExpression = require('openexpression');
console.log(OpenExpression.evaluate('📈 * 3', {
'📈': 3
})); // => 9
Actual:
Unexpected character at index 0:
It's currently not possible to use unicode/emoji characters within an expression without the lexer being unhappy. At the moment non-ASCII characters only work within string literals.
I propose we add the ability for these characters to be used as variable names. This would be useful for non-English and joke applications.
Expected:
Actual: