SimonRichardson/ihx — pull request #1 by jasononeil (2013-06-22 13:25:02+00:00)
Title: Fixes, features and unit tests

Hi Simon (and Ian)

I've spent the afternoon doing a fair amount of work on ihx. I am using exclusively Haxe 3 now, so I started with Simon's pull request, and have gone from there. Ian: maintaining compatibility between the two versions will probably be a fair bit of hassle given the syntax/std library changes and the way we have to run unit tests. I'd probably recommend maintaining two branches for now...

Anyway, this pull request includes:

* The classpath updates and the haxelib path fix Ian did (Simon's branch had not merged them yet)
* Changes to accomodate haxe3 haxelib packaging - moving the haxelib.json file to the top of the repo and generally moving things around a bit.
* A "Set" implementation so a library or classpath can't be added more than once. I had trouble getting hxSet to work in Haxe 3, so I just did a super-basic Abstract implementation. If hxSet is ported later we can use that...
* Adds support for "debug" toggle
* Add commands for adding defines "-D mydefine" ... "#if mydefine ... #end"
* Adds support for "-lib libname" "-cp classpath" "-D define" and "-debug" flags form the command line
* When running "print", don't include the macro type printer Simon made
* When running "print", show line numbers
* Moved the macro formatter class to a separate file, include as a Haxe resource (makes for nicer editing)
* Refactored the macro formatter to use built in haxe macro printing, which is more useful the majority of the time
* Created test.hxml , rather than having it commented out in build.hxml
* Updated unit tests to all pass in Haxe 3 and with the printer modifications. (One unit test was no longer applicable, so I removed it - Int32 no longer exists in Haxe3)
* Added new unit tests for some of the features I added.
* Added new unit tests for some of the Haxe 3 syntax changes (map, array comprehensions etc)
* Added support for "Home" and "End" buttons, at least on Unix. I'd need to know the key codes on Windows to get them working there.

Anyway, thanks again for such a great tool. I'm really impressed with how well it works.

I'd be seen to see this packaged and release to Haxe 3's haxelib if Ian doesn't mind. In the mean time I can direct people to use:

haxelib git ihx https://github.com/jasononeil/ihx.git

and it will install for them.

Jason