HaxeFoundation/hscript — pull request #11 by jcward (2014-05-30 18:17:24+00:00)
Title: Nice parser error formatting in debug (-D hscriptPos) mode

I've fixed up the debug compile (-D hscriptPos) mode, ensured that character numbers are properly passed through all errors, and added a nice formatting function to the Parser.

In hscriptPos mode only, the Parser's `parseString` function now will throw errors formatted like this:

Error: Parse error: EUnexpected()),	on line 2, char 21-21
> 1: var a=1; var b=2;
> 2: trace('a+b='+(a + b)));
^
> 3: trace('complete!');
> 4:

Prior to this, it was ***very*** difficult to track down syntax errors, especially in multi-line scripts, where error messages were simply:

Error: Parse error: EUnexpected())

This happens to encompass my previous pull request (ternary operator support, 7535030), as well as a fix (92224f62353) that throws EInvalidAccess when a referenced function is missing from an object -- instead of a useless error message thrown later about a null reference when trying to call null()

I've added test cases into `Test.hx` for all fixes.