olety / cjass

Preserving cjass code from code.google.com/p/cjass
0 stars 0 forks source link

static if bug #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
library a {
    private constant bool Y = FALSE

    void aa() {
        static if Y {

        } else {

        }
    }
}

What is the expected output? What do you see instead?
Error: Unknown Block

What version of the product are you using? What flags are checked (i.e.
locals autoflush or removing unused code)
.34

Please provide any additional information below.
I thought this was fixed in .34?

Original issue reported on code.google.com by erwgfifo...@gmail.com on 13 Aug 2011 at 10:12

GoogleCodeExporter commented 9 years ago
Yea, cJass does't support C-style static if block now. I'll add it in next 
versions.

> I thought this was fixed in .34?
In .34 you may use only Jass style static if. Wait one-two days, until I fix 
modules (I'm working with it now)

Also you may use (if you code in cJass) #if preprocessor command. It works with 
defines - read abot it in the old manual (http://cjass.xgm.ru/manual-en#htoc26).

Shortly it may be used outside the function and may be used with the defines 
(example below). Also cJass generate system defines like `FUNCNAME` or 
`AUTOFLUSH_LOCALS` (check, is autoflush flug enabled). 

#define A (a, b) = {
    #if (a == 0)
        // ...
    #elseif (a == 1)
        // ...
    #else
        #error ("You may pass only 0 or 1 in macro A.")
    #endif
}

Original comment by adi...@gmail.com on 13 Aug 2011 at 11:18

GoogleCodeExporter commented 9 years ago
Fixed in .35

Original comment by adi...@gmail.com on 15 Aug 2011 at 4:27