SomeRanDev / reflaxe

Haxe framework for creating compilation targets using macros
MIT License
93 stars 4 forks source link

Problem to generate files at it is. #10

Closed vega0 closed 1 year ago

vega0 commented 1 year ago

By default reflaxe creates separately objects into multiple files. It is possible to get information about imports and packages? It is possible to create file metadata info to assembly anything from one file into one file. ?

vega0 commented 1 year ago

interface makes me work in frame of class and enum generators. Can it in frame of file ? with import and package directives.

vega0 commented 1 year ago

is it possible to determine the type of "if" definition as normal and ternary.

SomeRanDev commented 1 year ago

Reflaxe does have the ability to output files manually if you'd prefer that! In my Reflaxe/C++ project, I return null for the compileClass/Enum functions so they don't generate anything automatically.

Instead, I store the output in an array. Using the BaseCompiler.onCompileEnd function, I can then output everything manually using the BaseCompiler.appendToExtraFile(filename: String, output: String).

In Reflaxe/C++ specifically, I use BaseCompiler.addCompileEndCallback at the end of generating the class to do this, but you don't have to.

vega0 commented 1 year ago

is it possible to recognize 'if' is ternary or not?

vega0 commented 1 year ago

is it possible to get import instructions of file ?

vega0 commented 1 year ago

Reflaxe does have the ability to output files manually if you'd prefer that! In my Reflaxe/C++ project, I return null for the compileClass/Enum functions so they don't generate anything automatically.

Instead, I store the output in an array. Using the BaseCompiler.onCompileEnd function, I can then output everything manually using the BaseCompiler.appendToExtraFile(filename: String, output: String).

In Reflaxe/C++ specifically, I use BaseCompiler.addCompileEndCallback at the end of generating the class to do this, but you don't have to.

two questing above.

SomeRanDev commented 1 year ago

Sorry for missing your two questions. If you have any general questions, I would highly recommend asking in the "Reflaxe" project forum on the Haxe Discord server.

is it possible to recognize 'if' is ternary or not?

I'm afraid not, this is a limitation built into the Haxe compiler.

is it possible to get import instructions of file ?

The Haxe compiler does not provide this information; you have to keep track of which classes are used in a module and create the imports yourself.