| 03-29-2009, 08:22 PM | #1 | |
Here is my JASS parser which is designed to be used as a background syntax checker and parser. I though I should put it up here for some gentle testing Command line options JassParserCLI <options> <documents>
Known bugs
Version history
You can find the latest source here: http://github.com/Zoxc/JassParser |
| 03-29-2009, 09:49 PM | #2 |
The error messages seam to be better understandable than Pjass. However I found one error when parsing my map script. JASS:if this==null then Maybe you could also add a check for uninitialized variables, so something like this should throw an error: JASS:function stupid takes nothing returns nothing local integer i call doSomethingWith(i) // i used without initialisation endfunction |
| 03-30-2009, 05:15 PM | #3 |
Source code? |
| 03-30-2009, 06:15 PM | #4 |
Is it portable? Can we use it without gui in scripts? Should there be syntax errors in the demo? edit: You haven't written the parse part by hand? JASS:function t takes nothing returns nothing if 1==0then endif endfunction |
| 03-30-2009, 06:28 PM | #5 | |||||
Quote:
Quote:
Quote:
Quote:
Quote:
I updated the parser with most of the complaints I found in the PJASS thread. |
| 03-31-2009, 04:45 PM | #6 |
Here is version 0.1.3. Now it handles the return bug and has a pjass compatible command line interface. Simply replace the pjass.exe you were using with JassParserCLI.exe. |
| 04-04-2009, 02:29 AM | #7 |
Line numbers sometimes get off-by-one errors like in this blizzard.j: |
| 04-04-2009, 09:09 AM | #8 |
Bugreport: JASS:globals code array cc //this gives no error endglobals function bla takes nothing returns nothing endfunction function test takes nothing returns nothing call TriggerAddCondition(CreateTrigger(), Condition(function bla)) //this gives no error endfunction |
| 04-04-2009, 11:13 AM | #9 |
the second bug is no bug. |
| 04-04-2009, 11:28 AM | #10 |
it is a bug, bla has to return a boolean. --- It is really nice you added the Checks for uninitialized variables but it could still be better. This two functions give no error: JASS:function foo takes nothing returns nothing local integer i set i = i + 1 endfunction function bar takes nothing returns integer local integer i if false then set i = 5 endif return i endfunction |
| 04-04-2009, 11:36 AM | #11 |
It should, but it doesnt have to. Returning no boolean is fine, as long as noone with a Mac plays your map. |
| 04-04-2009, 12:12 PM | #12 | |
Quote:
that example would be really hard to implement .as you wont have a simple "false", but some real condition there normally ..and parser cant check usually if that condition will come true. But still it should display a warning that some code paths can return non-initialized-shit |
| 04-04-2009, 01:15 PM | #13 | |
Quote:
|
| 04-04-2009, 02:08 PM | #14 |
Ah true ... Well pretty much true ...Visual Studio C# throws an error for this aswell ... but Visual Studio C++ doesnt ...but Oh'well ..Visual Studio C++ sucks anyways.. |
| 04-04-2009, 04:20 PM | #15 |
Fixed some stuff. The uninitialized variable thing is really just a simple flag designed to catch the most primitive errors. The Condition/Filter thing is more or less a WC3 bug and would require special handling, maybe I'll add it later. |
