SomeRanDev / reflaxe.GDScript

Compile Haxe to GDScript 2.0 as easily as you'd output to any other target
MIT License
18 stars 2 forks source link

kudos + build question #5

Open coderofsalvation opened 3 months ago

coderofsalvation commented 3 months ago

Oh man this is such a cool project. The polyglotness of Haxe + the benefits of Godot is such match made in Heaven. I was surprised to see even plugin-generation in there (awesome).

Question, have you experienced the following error? I was getting a hickup with haxe v4.2.x (it did not recognize the ?? operator) so I tried with v4.3.3:

$ git clone https://github.com/coderofsalvation/xrfragment
$ cd xrfragment
$ git checkout feat/godot
feat/godot $ haxe --version
4.3.3
feat/godot $ haxe build.hxml 
Invalid_argument("index out of bounds")

Any clue? It would be so awesome to be able to generate a GoDoT-plugin of the https://xrfragment.org parser

Btw. the particular build.hxml snippet is:

--next
-dce full
-cp src
xrfragment
-lib gdscript
-D gdscript-output=dist/godot 
-D generate_godot_plugin

btw. the above can be reproduced by running the snippets above (or in case of windows: cloning the repo from the snippet)

coderofsalvation commented 3 months ago

https://github.com/HaxeFoundation/haxe/issues/10627 <--- seems to be the same issue (my codebase is heavily using static functions too)

Any idea why only gdscript triggers this error?

SomeRanDev commented 2 months ago

Hey, I'm so sorry I missed this! Are you still having the issue?

This could be a Reflaxe or Reflaxe/GDScript issue where I'm running some macro code that calls an internal compiler function doing something wrong... then again, I can't seem to find any "index out of bounds" string in the Haxe compiler code, hope it isn't something deeper. Hmmmm... it'd be really hard to say. Would it be possible to provide me with some code that can replicate the problem?

SomeRanDev commented 2 months ago

Also what happens when you try compiling the code to a different language? Like doing -js instead?

coderofsalvation commented 2 months ago

Hi, thanks for the reply. So to replicate the problem the terminal-snippet above will do that for you (that repo contains the build.hxml etc). My guess is that Reflaxe does not resolve static function (calls). The classes in the repo (which convert fine to javascript, python etc, see build.hxml) call static class functions/vars a lot (like XRF).