Project

General

Profile

Bug #3711

resolve remaining orphaned comments cases

Added by Greg Shah almost 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

Related issues

Related to Conversion Tools - Feature #2110: improve orphan comment processing Closed

History

#1 Updated by Greg Shah almost 6 years ago

  • Related to Feature #2110: improve orphan comment processing added

#2 Updated by Greg Shah almost 6 years ago

With 2110a, the number of orphaned comments is now a small fraction of the previous amount. For example, the large ChUI application had over 26000 orphaned comments before 2110a and after it had 289.

The remaining orphaned comments are probably related to cases where the conversion deletes nodes such that the shadow node's left id/right id reference nodes that no longer exist.

An example can be seen in testcases/uast/strings_comments_whitespace.p.

The code is similar to this:

my-char-var = 'The beginning ' + /* comment1 */
              'of some ' + /* comment2 */
              'text.'.

The conversion will rewrite the rvalue expression as a simple STRING with text "The beginning of some text.". Thus, the original STRING and PLUS nodes no longer exist and the comments are orphaned.

A solution to this would require fixups for the shadow nodes when referenced AST nodes are deleted. There may be other cases too.

Also available in: Atom PDF