Skip to content

[FEATURE] Add numeric separators support #318

@Starexify

Description

@Starexify

So in haxe, we can use numeric separators like this:

var largeHex = 0xFF_00;
trace(largeHex);

var bigInt = 1_000_000;
trace(bigInt);

It would return:

 ERROR  Error while parsing script assets/scripts/WorstCParser.hxc#7: EUnexpected
Unexpected error: Unexpected token "_00", is there invalid syntax on this line?
 ERROR  Error while parsing script assets/scripts/WorstCParser.hxc#7: EUnexpected
Unexpected error: Unexpected token "_000_000", is there invalid syntax on this line?

But the output in a haxe environment (hxcpp, try haxe) would be this and ignore the _ from numerals:

65280
1000000

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