Skip to content

Unicode/Emoji literals #1

@R4wizard

Description

@R4wizard

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions