Bug #3256
comments disappear inside strings when the preprocessor evaluates expressions
Start date:
Due date:
% Done:
100%
billable:
No
vendor_id:
GCD
case_num:
History
#1 Updated by Greg Shah about 7 years ago
The following program (see testcases/uast/comments_disappear_inside_strings_when_the_preprocessor_evaluates_expressions.p
):
/* "8" */ message index("one /* two */ three", "two"). /* one /* two */ three */ message "one /* two */ three". /* "Comments disappear inside strings when the preprocessor evaluates expressions." */ &if index("one /* two */ three", "two") NE 0 &THEN &message "Should not display." &else &message "Comments disappear inside strings when the preprocessor evaluates expressions." &endif /* index("one three", "two") */ /* notice that nested comments are zapped too, unbalanced comments cause a compiler error */ /* ** An open comment string (/*) was found, but no closing string. (134) */ /* an extra closing comment sequence has gets emitted into the output without error */ &message index("one /* two /* */ */ three", "two") /* "one three" */ &message "one /* two */ three"
The preprocessor output for Progress:
"Comments disappear inside strings when the preprocessor evaluates expressions." index("one three", "two") "one three"
Here is the result in FWD:
Message from comments_disappear_inside_strings_when_the_preprocessor_evaluates_expressions.p#8 ==> "Should not display." Message from comments_disappear_inside_strings_when_the_preprocessor_evaluates_expressions.p#14 ==> index("one /* two */ three", "two") Message from comments_disappear_inside_strings_when_the_preprocessor_evaluates_expressions.p#17 ==> "one /* two */ three"
Although comments aren't normally removed from strings (they do appear in the string output for the ABL MESSAGE statement in the above program), Progress does zap them from the strings in preprocessor directives.
#3 Updated by Greg Shah about 7 years ago
This is fixed in 3255a revision 11223.
#4 Updated by Greg Shah about 7 years ago
- % Done changed from 0 to 100
- Target version set to Reporting 3.0
- Status changed from WIP to Closed
3255a was merged to trunk as revision 11143.