Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Warcraft Editing Tools (http://www.wc3c.net/forumdisplay.php?f=13)
-   -   JassHelper 0.A.2.B - A vJass and Zinc 2 Jass compiler (http://www.wc3c.net/showthread.php?t=88142)

Dark_Dragon 01-22-2015 01:27 PM

Hello,

i have just updated my old Win7 HP 32bit to Win7 HP 64bit and everytime there is bug in code, jasshelper freezes... if there are no errors in code, it will compile just fine, else it will freeze at point "founding errors please wait"... so i have to use Task manager to end the process. if it is possible to fix this bug it would be great.

regards!
~DarkDragon

iNfraNe 01-23-2015 03:55 PM

Quote:

Originally Posted by Dark_Dragon
Hello,

i have just updated my old Win7 HP 32bit to Win7 HP 64bit and everytime there is bug in code, jasshelper freezes... if there are no errors in code, it will compile just fine, else it will freeze at point "founding errors please wait"... so i have to use Task manager to end the process. if it is possible to fix this bug it would be great.

regards!
~DarkDragon

I had the exact same problem. I just redownloaded and overwrote all the files. After that it worked again.

Dark_Dragon 01-23-2015 05:31 PM

Quote:

Originally Posted by iNfraNe
I had the exact same problem. I just redownloaded and overwrote all the files. After that it worked again.


Ok, i redownloaded the new'est version, copy and pasted everything from executable folder, but it did not work for me... still crashes when errors are found. :emote_sad:

EDIT: Ok, i created new folder in jasshelper one and just copied stuff there, run from that folder and it run just fine...

Nestharus 01-29-2015 05:45 PM

The following does not work

Collapse JASS:
module A
endmodule

module B
    dsfsfds
endmodule

module C
    static if false then
        static if false then
            implement A
        else
            implement B //this is implemented and commented out
        endif
    else
        implement B //this doesn't exist
    endif
endmodule

The following does not work.

Collapse JASS:
struct A
    static method test takes nothing returns nothing
    endmethod
endstruct

module K
    private static method test takes nothing returns nothing
        call A.test() //K__test is not a member of A
    endmethod
endmodule

struct B
    implement K
endstruct

The following generates syntax errors during variable generation

Collapse JASS:
scope M

globals
    debug private integer i

    //the above gives
    //    private integer

    //the following is also legal to do, but gives incorrect output
    debug private constant boolean m = true

    //the above gives
    //    private constant= true
endglobals

endscope

The following isn't caught by the parser

Collapse JASS:
struct O

//everything after "returns nothing" is ignored
private static method sfidsjof takes nothing returns nothing dsfdushfui sdfds sf afa  fsdfds
endmethod

endstruct

The following isn't caught by the parser

Collapse JASS:
function D takes nothing returns nothing
endfunction

function M takes nothing returns nothing
    //you shouldn't be able to compare a function to an integer
    if (D == 1) then
    endif
endfunction



It is currently possible to access private members with a percent chance of success.


This isn't correct. A private scope's contents should be private to the parent scope.

Collapse JASS:
scope c
    private scope d
        function m takes nothing returns nothing
        endfunction
    endscope
endscope
scope e
    function d takes nothing returns nothing
        call m()
    endfunction
endscope

Ambiguity between scopes and identifiers

Collapse JASS:
scope o
    public function o takes nothing returns nothing
    endfunction
endscope

function o_o takes nothing returns nothing
endfunction


The following is valid in one case and not valid in the other

Collapse JASS:
module b
    //the following is valid
    private method _c takes nothing returns nothing
    endmethod
    
    //the following is not valid
    method _d takes nothing returns nothing
    endmethod
endmodule

struct a
    implement b
endstruct

The following is valid for JASS but not jasshelper

Collapse JASS:
function m takes nothing returns nothing
endfunction

function d takes boolexpr b returns nothing
endfunction

function e takes nothing returns nothing
    call d(Condition(function m))
endfunction

Here is the current workaround

Collapse JASS:
function m takes nothing returns nothing
endfunction

function d takes code c returns nothing
    call Condition(c)
endfunction

function e takes nothing returns nothing
    call d(function m)
endfunction

The following is a valid object id but is not accepted by jasshelper

Collapse JASS:
function m takes nothing returns nothing
    local integer i = '\'\\34'
endfunction

The following is valid for one case and not the other

Collapse JASS:
globals
    integer integer = 5
endglobals

struct C
    unit unit = null
endstruct


The community has come up with a new allocation method that uses only 1 variable.

Collapse JASS:
struct C extends array
    private static integer array stack

    private static method allocate takes nothing returns integer
        local thistype this = stack[0]
        
        if (stack[0] == 0) then
            set stack[0] = this + 1
        else
            set stack[0] = stack[this]
        endif
        
        if (this == 8192) then
            call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Unable to allocate id for an object of type: C")
            return 0
        endif

        set stack[this] = -1
        
        return this
    endmethod

    private static method deallocate takes integer this returns nothing
        if this == null then
            call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Attempt to destroy a null struct of type: C")
            return
        elseif (stack[this] != -1) then
            call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,1000.,"Double free of type: C")
            return
        endif
        
        set stack[this] = stack[0]
        set stack[0] = this
    endmethod
    
    private static method onInit takes nothing returns nothing
        //just add this line to jasshelper__initstructs instead of ExecuteFunc
        set stack[0] = 1
    endmethod
endstruct

Anitarf 01-30-2015 05:58 PM

Some of those are just extra padding...

Barade 06-21-2015 12:43 PM

1 Attachment(s)
Found another bug: http://www.hiveworkshop.com/forums/t...plimit-266717/

.evaluate() does not always generate a TriggerEvaluate() call for methods but always for functions.
This can lead to undefined behaviour if you use .evaluate() to increase the OpLimit.
I am using ForForce now instead.

I have attached a test map which shows you the behaviour in the output map script.

Nestharus 06-25-2015 09:19 PM

Syntax error. Struct declared again.

Collapse JASS:
scope B
    static if true then
        private struct a extends array
        endstruct
    else
        private struct a extends array
        endstruct
    endif
endscope

The following works

Collapse JASS:
scope B
    static if true then
        struct a extends array
        endstruct
    else
        struct a extends array
        endstruct
    endif
endscope

As does the following

Collapse JASS:
scope B
    private keyword a
    
    static if true then
        struct a extends array
        endstruct
    else
        struct a extends array
        endstruct
    endif
endscope



What works with static ifs?

fields
methods
functions

What doesn't work with static ifs?

structs (keyword workaround)
scopes (no workaround)
libraries (no workaround)


Scopes and libraries make sense as they generate globals that static ifs depend on, so they need to be run first. However, structs do not ; ).



Relative paths don't work for //! import. Or rather, they are buggy.


folder
folder\normal
folder\normal\data
folder\debug
folder\debug\data

folder\normal\main.j
folder\normal\data\collection.j

folder\debug\main.j
folder\debug\collection.j

folder\main.j

folder\main.j
Collapse JASS:
static if DEBUG_MODE then
    //! import "folder\debug\main.j"
else
    //! import "folder\normal\main.j"
endif

folder\debug\main.j
Collapse JASS:
    //! import "data\collection.j"

folder\normal\main.j
Collapse JASS:
    //! import "data\collection.j"

result
Collapse JASS:
BEGIN IMPORT OF "folder\debug\main.j"
    BEGIN IMPORT OF "folder\debug\collection.j"
    END IMPORT OF "folder\debug\collection.j"
END IMPORT OF "folder\debug\main.j"

BEGIN IMPORT OF "folder\normal\main.j"
    IGNORE DOUBLE IMPORT "folder\debug\collection.j"
END IMPORT OF "folder\normal\main.j"

This is the specific bugged feature
Quote:

As of jasshelper 0.9.C.0 , relative paths used by import an already-imported file will be able to also support the file's path as possible container. Notice that the files in the same folder as the current file have priority over files on the configured paths or even the map's location.



edit
To try and stop the broken relative paths, I used the ".". Now everything is getting imported several times.

Collapse JASS:
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\main.j
library ListHtNt  uses  optional ErrorMessage     optional MemoryAnalysis     TableField                 Table                    
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Element.j


private struct Element extends array
endstruct


// END IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Element.j
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Collection.j

// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\.\Element.j


private struct Element extends array
endstruct


// END IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\.\Element.j


All times are GMT. The time now is 04:39 AM.

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services