Bug #2109
Feature #1739: add hints/features for better control over comment conversion
a comment that is the first node in a block doesn't have a new-line after it
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
8.00 h
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
History
#1 Updated by Greg Shah over 9 years ago
- Target version deleted (
Code Improvements)
#2 Updated by Roger Borrello over 5 years ago
Just wanted to add that when the comment is very long, it can produce confusing resultant Java code. For example:
def var type as char init "A".
def var tval as int init 1.
case type:
/* This is a comment before */
when "A" then
/* This is a comment before the do */
do:
/* This is a comment after the do */
assign tval = 2.
case tval:
when 1 then message "One".
when 2 then message "Two".
end case.
end.
/* This is a comment before When B */
when "B" then
/* This is a comment after When B */
assign tval = 3.
when "C" then
assign tval = 4.
when "D" then
do:
assign tval = 5.
end.
when "E" or when "F" then
do:
message "Oddity".
end.
end case.
This produces:
switch (StringHelper.safeTrimTrailing((type).toStringMessage()).toUpperCase() /* This is a comment before */)
{
case "A":
/* This is a comment before the do */ /* This is a comment after the do */ {
tval.assign(2);
switch (StringHelper.safeTrimTrailing((tval).toStringMessage()))
{
case "1":
{
message("One");
}
break;
case "2":
{
message("Two");
}
break;
}
}
break;
/* This is a comment before When B */ case "B": <-- If the comment is very long, this can be off screen, impacting readability
/* This is a comment after When B */ {
tval.assign(3);
}
break;
case "C":
{
tval.assign(4);
}
break;
case "D":
{
tval.assign(5);
}
break;
case "E":
case "F":
{
message("Oddity");
}
break;
}