-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
sv-parser gobbles comments after String literals into its whitespace vector. Consequently, they are not stripped from the sources. A minimal example:
// General comment
module comment_module #(
parameter blub = "blub" // "blub" or "blub1"
) (
// In body comment.
);
endmoduleProduces:
module blub_comment_module #(
parameter blub = "blub" // "blub" or "blub1"
) (
);
endmoduleExpect:
module blub_comment_module #(
parameter blub = "blub"
) (
);
endmodulePreprocessed syntax tree:
PreprocessorText { nodes: ([Comment(Comment { nodes: (Locate { offset: 0, line: 1, len: 18 },) }), NotDirective(SourceDescriptionNotDirective { nodes: (Locate { offset: 18, line: 1, len: 47 },) }), StringLiteral(StringLiteral { nodes: (Locate { offset: 65, line: 3, len: 6 }, [Space(Locate { offset: 71, line: 3, len: 4 }), Comment(Comment { nodes: (Locate { offset: 75, line: 3, len: 20 },) }), Space(Locate { offset: 95, line: 3, len: 1 })]) }), NotDirective(SourceDescriptionNotDirective { nodes: (Locate { offset: 96, line: 4, len: 8 },) }), Comment(Comment { nodes: (Locate { offset: 104, line: 5, len: 19 },) }), NotDirective(SourceDescriptionNotDirective { nodes: (Locate { offset: 123, line: 5, len: 43 },) })],) }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels