Bug #10237
keepTildes is keeping tilde when preprocessor directive contains tilde and curly brace
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
4GL Preprocessor
Related issues
History
#1 Updated by Stefan Vieru about 1 year ago
Having the following testcase:
DEFINE VARIABLE iSDOLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE cSDOList AS CHARACTER NO-UNDO.
DEFINE VARIABLE hSDOHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE lStatic AS LOGICAL NO-UNDO.
cSDOList = "7896".
lStatic = true.
&SCOPED-DEFINE NumTTS 5
&SCOPED-DEFINE fetchTT &IF {&NumTTs} < ~{&num~} &THEN~
WHEN ~{&num~} THEN message {&NumTTs} ~{&num~}.~
&ENDIF
DO iSDOLoop = 1 TO NUM-ENTRIES(cSDOList):
hSDOHandle = WIDGET-HANDLE(ENTRY(iSDOLoop,cSDOList)).
IF lStatic THEN
DO:
CASE iSDOLoop:
&SCOPED-DEFINE num 1
{&fetchTT}
&SCOPED-DEFINE num 2
{&fetchTT}
&SCOPED-DEFINE num 3
{&fetchTT}
&SCOPED-DEFINE num 4
{&fetchTT}
&SCOPED-DEFINE num 5
{&fetchTT}
&SCOPED-DEFINE num 6
{&fetchTT}
&SCOPED-DEFINE num 7
{&fetchTT}
&SCOPED-DEFINE num 8
{&fetchTT}
END CASE.
END.
END.
When we preprocess in OE we should get:
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE list AS CHARACTER NO-UNDO.
list = "3456789".
DO i = 1 TO NUM-ENTRIES(list):
CASE i:
-
-
-
-
-
WHEN 6 THEN message "5 < 6".
WHEN 7 THEN message "5 < 7".
WHEN 8 THEN message "5 < 8".
END CASE.
END.
Ignore the
-, I've inserted them to keep the empty lines
When we preprocess in FWD without keepTildes we get the same output, but when enabling it we get:
DEFINE VARIABLE iSDOLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE cSDOList AS CHARACTER NO-UNDO.
DEFINE VARIABLE hSDOHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE lStatic AS LOGICAL NO-UNDO.
cSDOList = "7896".
lStatic = true.
DO iSDOLoop = 1 TO NUM-ENTRIES(cSDOList):
hSDOHandle = WIDGET-HANDLE(ENTRY(iSDOLoop,cSDOList)).
IF lStatic THEN
DO:
CASE iSDOLoop:
-
-
-
-
-
-
-
-
END CASE.
END.
END.
/
Warning [./abl/test.p line 19, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 21, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 23, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 25, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 27, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 29, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 31, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
Warning [./abl/test.p line 33, col 29]: Preprocessor evaluation of expression '2 < ~{&num~}' failed, returning false.
#2 Updated by Alexandru Lungu about 1 year ago
- Related to Bug #6308: post string literal alternative coding quirk in 4GL preprocessor added
#3 Updated by Stefan Vieru about 1 year ago
- Related to Support #6859: preprocessor tests added