I am attempting to implement the Haxe programming language into 4coder and I am exploring options on how to do syntax highlighting.
I have also noticed there was a bug in buildsuper.bat, which I have now fixed. See below:
1 | if "%SRC%" == "" set SRC=%code_home%\4coder_default_bindings.cpp |
Before, SRC was not prefixed with %code_home%. Adding it fixes the issue where 4_coder_default_bindings.cpp was not found.
I am currently experiencing a few issues with my custom implementation.
The first is when using an anonymous function like in the following scope:
1 2 3 4 5 | frontFadeOut(function() { Browser.document.getElementById("content").innerHTML = xml.responseText; switchPage(url); }); |
The auto-indentation done by 4coder in the background seems to not pick up the fact that function can be a flow, but also a declaration. I'm not sure how 4coder can handle the function keyword being used in two different circumstances, one for actually declaring a function, and another for assigning an anonymous function without a name. In my custom implementation, I currently have function assigned to CPP_TOKEN_KEY_TYPE_DECLARATION. If JavaScript were to be implemented, I can foresee the same issue there.
Is there perhaps a better way to accomplish correct auto-indentation in this scenario?
Also, the '@' symbol is used in places for runtime and compile-time metadata or code generation respectively. In the below example, the use of the '@:' symbol is automatically indenting the next line.
1 2 | @:noPublic var categories:Array<String>; |
But it does not apply to the class which is declared as a CPP_TOKEN_KEY_TYPE_DECLARATION, which var is not.
1 2 | @:build(StaticBuilder.build()) class News |
However, there is some inconsistency with this behaviour. As mentioned previously, function is also declared as a TYPE_DECLARATION, but has the same effect as the first example:
1 2 | @:makePublic function display(url:String) |
Any thoughts on why this may be the case?
Many thanks for all your help in advance.