Skip to content

[Bug] FuseCommentsPass is not differentiating between inline comments and comment lines #3060

@mgtm98

Description

@mgtm98

Bug Details

The tree after FuseCommentsPass is the same in two different casses, for example

Case1 Case2
with entry {
    a = 7;  # jjj
}

with entry {
    a = 7;  
    # jjj
}

1:1 - 3:3       Module, 
1:1 - 3:3       +-- ModuleCode, 
1:1 - 1:5           +-- Token - with, 
1:6 - 1:11          +-- Token - entry, 
1:12 - 1:13         +-- Token - {, 
2:5 - 2:11          +-- Assignment, 
2:5 - 2:6           |   +-- Name - a - Type: NoType,  SymbolTable: None
2:7 - 2:8           |   +-- Token - =, 
2:9 - 2:10          |   +-- Int - 7 - Type: NoType,  SymbolTable: None
2:10 - 2:11         |   +-- Semi - ;, 
2:12 - 2:17         +-- CommentToken - # jjj, 
3:2 - 3:3           +-- Token - }, 
1:1 - 3:3       Module, 
1:1 - 3:3       +-- ModuleCode, 
1:1 - 1:5           +-- Token - with, 
1:6 - 1:11          +-- Token - entry, 
1:12 - 1:13         +-- Token - {, 
2:5 - 2:11          +-- Assignment, 
2:5 - 2:6           |   +-- Name - a - Type: NoType,  SymbolTable: None
2:7 - 2:8           |   +-- Token - =, 
2:9 - 2:10          |   +-- Int - 7 - Type: NoType,  SymbolTable: None
2:10 - 2:11         |   +-- Semi - ;, 
2:12 - 2:17         +-- CommentToken - # jjj, 
3:2 - 3:3           +-- Token - }, 

This is a blocker issue for #2999

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions