Hi,
Thank you for the work done.
I notice that the conditional compilation directives >>define
, >>if
, >>evaluate
, which are part of the COBOL ISO 2002 standard, do not work as expected by the standard, or are not supported.
My observations:
>>define varname as b'0'
is not accepted, (the literal b'0'
is not accepted)>>if varname1 + varname2 = value
is not accepted, even if varname1
and varname2
are declared beforehand and associated with numeric values.>>define
, >>if
, >>when
and boolean literals b'0'
and b'1'
are not recognized as such but as variables.>>evaluate
, >>when
, >>end-evaluate
are not supported.>>DEFINE VAR1 AS PARAMETER
>>DEFINE VAR2 AS VAR1 + 2
>>IF VAR2 < 12
compute x = x + 1 *> this code should NOT be included
>>ELSE
compute x = x – 1 *> this code should be included
>>END-IF
syntax error, unexpected Variable, expecting OFF or PARAMETER or Literal
10 | >>DEFINE VAR1 AS PARAMETER
11 > >>DEFINE VAR2 AS VAR1 + 2
12 | >>IF VAR2 < 12
13 | compute x = x + 1 *> this code should NOT be included
statut de retour : 1
>>DEFINE VAR1 AS 6
>>DEFINE VAR2 AS 1
>>EVALUATE VAR1
>>WHEN VAR2 + 2
compute x = x + 1 *> this code should NOT be included
>>WHEN 4 THRU 8
compute x = x – 1 *> this code should be included
>>WHEN OTHER
compute x = x * 2 *> this code should NOT be included
>>END-EVALUATE
warning: invalid directive is ignored : « >>EVALUATE » [-Wothers]
10 | >>DEFINE VAR1 AS 6
11 | >>DEFINE VAR2 AS 1
12 > >>EVALUATE VAR1
13 | >>WHEN VAR2 + 2
14 | compute x = x + 1 *> this code should NOT be included
warning: invalid directive is ignored : « >>EVALUATE » [-Wothers]
11 | >>DEFINE VAR2 AS 1
12 | >>EVALUATE VAR1
13 > >>WHEN VAR2 + 2
14 | compute x = x + 1 *> this code should NOT be included
15 | >>WHEN 4 THRU 8
warning: invalid directive is ignored : « >>EVALUATE » [-Wothers]
13 | >>WHEN VAR2 + 2
14 | compute x = x + 1 *> this code should NOT be included
15 > >>WHEN 4 THRU 8
16 | compute x = x - 1 *> this code should be included
17 | >>WHEN OTHER
warning: invalid directive is ignored : « >>EVALUATE » [-Wothers]
15 | >>WHEN 4 THRU 8
16 | compute x = x - 1 *> this code should be included
17 > >>WHEN OTHER
18 | compute x = x * 2 *> this code should NOT be included
19 | >>END-EVALUATE
warning: invalid directive is ignored : « >>EVALUATE » [-Wothers]
17 | >>WHEN OTHER
18 | compute x = x * 2 *> this code should NOT be included
19 > >>END-EVALUATE
statut de retour : 0
>> EVALUATE
[feature-requests:#46]I'll leave this open for arithmetic statements in conditional compilation.
Related
Wish List: #303
Wish List: #46
Ticket moved from /p/gnucobol/bugs/929/
Hi,
Thanks.
Not sure that
>>define xxx as b'0'
/>>define xxxx as b'1'
relate to [feature-requests:#303].>>define
only accept these two boolean constant.Related
Wish List: #303