Skip to content

Commit

Permalink
Update to Reflaxe 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeRanDev committed Oct 20, 2023
1 parent be11416 commit 752b73b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/cxxcompiler/Compiler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using cxxcompiler.helpers.Error;
using cxxcompiler.helpers.MetaHelper;
using cxxcompiler.helpers.CppTypeHelper;

class Compiler extends reflaxe.PluginCompiler<Compiler> {
class Compiler extends reflaxe.DirectToStringCompiler {
// ----------------------------
// The extension for the generated header files.
public static final HeaderExt: String = ".h";
Expand Down Expand Up @@ -978,14 +978,14 @@ class Compiler extends reflaxe.PluginCompiler<Compiler> {

// ----------------------------
// Stores typedef to be compiled later.
var typedefs: Array<{ defType: DefType, mt: ModuleType, filename: String, dep: DependencyTracker }> = [];
public override function compileTypedef(defType: DefType): Null<String> {
var storedTypedefs: Array<{ defType: DefType, mt: ModuleType, filename: String, dep: DependencyTracker }> = [];
public override function compileTypedefImpl(defType: DefType): Null<String> {
final filename = getFileNameFromModuleData(defType);
final mt = getCurrentModule();

if(mt == null) throw "No current module";

typedefs.push({
storedTypedefs.push({
defType: defType,
mt: mt,
filename: filename,
Expand All @@ -998,12 +998,12 @@ class Compiler extends reflaxe.PluginCompiler<Compiler> {
// ----------------------------
// Compiles an typedef into C++.
public function compileAllTypedefs() {
for(t in typedefs) {
compileTypedefImpl(t.defType, t.mt, t.filename, t.dep);
for(t in storedTypedefs) {
compileOneTypedef(t.defType, t.mt, t.filename, t.dep);
}
}

public function compileTypedefImpl(defType: DefType, mt: ModuleType, filename: String, dep: DependencyTracker): Null<String> {
public function compileOneTypedef(defType: DefType, mt: ModuleType, filename: String, dep: DependencyTracker): Null<String> {
if(defType.hasMeta(Meta.Extern)) {
return null;
}
Expand Down Expand Up @@ -1096,7 +1096,7 @@ class Compiler extends reflaxe.PluginCompiler<Compiler> {

// ----------------------------
// Ensures an abstract's internal type is compiled.
public override function compileAbstract(absType: AbstractType): Null<String> {
public override function compileAbstractImpl(absType: AbstractType): Null<String> {
// Check & compile code from @:headerCode and @:cppFileCode.
// Even if the abstract itself isn't compiled, it can still
// add code to an output file using these meta.
Expand Down

0 comments on commit 752b73b

Please sign in to comment.