Skip to content

[FEATURE] Support for single-expression (braceless) functions #319

@Starexify

Description

@Starexify

In haxe, we can do this to have only a single expression from a function, without needing to encapsulate it within braces {} :

public static function get_y() return 1; // <-- errors here in polymod

static function main() {
  trace(get_y());
}

And in a haxe environment it would return:

1

But in polymod, we get this:

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

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