You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle multiline comments correctly after target attributes #645
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
preprocess_target_attrs in front/parser/src/import.rs skips blank lines and lines whose trimmed text starts with //, /*, *, or */ while looking for the item controlled by #[target(...)].
That is line-based rather than comment-state-based. For a block comment such as:
#[target(os="linux")]
/* explanation
ordinary text inside the comment
*/
pub fun selected() {}
the first comment line is treated as leading trivia, but the ordinary interior line is not. An inactive target can therefore stop preprocessing inside the comment and leave the following item in the source instead of removing it.
Scope
Track multiline-comment state while walking leading trivia after a target attribute.
Keep comments and blank lines associated with the following target-controlled item.
Handle ordinary interior block-comment lines and nested block comments consistently with the lexer.
Preserve source line structure for diagnostics.
Do not change #[target(...)] syntax or lexer comment syntax.
Completion criteria
Tests cover active and inactive target attributes followed by multiline comments whose interior lines do not begin with *.
Include a nested block-comment case.
An inactive attributed item is fully removed after the comment while an active item is preserved.
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
Activity
Fix frontend contracts and native regression tests (#723)