Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions passed by --macro should be parsed in macro context with -D macro #4543

Open
Atry opened this issue Sep 13, 2015 · 3 comments
Open
Milestone

Comments

@Atry
Copy link
Contributor

Atry commented Sep 13, 2015

class ExprMacro {
    public static function traceExpr(expr:haxe.macro.Expr):Void {
        trace(expr);
    }
}
$ haxe --macro "ExprMacro.traceExpr(macro 1)"
--macro:1: character 0 : { min : Int, max : Int, file : String } should be haxe.macro.Position
--macro:1: character 0 : Parameter should be a constant
@Atry Atry changed the title --macro should be parsed in macro context Expressions passed by --macro should be parsed in macro context with -D macro Sep 13, 2015
@Simn
Copy link
Member

Simn commented Nov 20, 2015

That would cause a lot of issues with macro-in-macro could. I think we even specifically made it so that --macro and --interp would not be interpreted in macro context for this reason.

@ncannasse: Do you remember anything about this?

@ncannasse
Copy link
Member

I don"t think that"s the issue there, "macro" expr is handled directly in parser I think so it comes down to type_constant or something like this

@Simn
Copy link
Member

Simn commented Nov 20, 2015

Oh I see, I completely misunderstood this issue because it mentioned -D macro.

@Simn Simn modified the milestone: 3.4 Feb 23, 2016
@Simn Simn modified the milestones: 3.4, 4.0 Jan 9, 2017
@Simn Simn modified the milestones: Release 4.0, Bugs Apr 17, 2018
@Simn Simn modified the milestones: Bugs, Later Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants