Skip to content

Implement include macro #3494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2020
Merged

Implement include macro #3494

merged 1 commit into from
Mar 6, 2020

Conversation

edwin0cheng
Copy link
Member

This PR implement builtin include macro.

  • It does not support include as expression yet.
  • It doesn't consider env!("OUT_DIR") yet.

@edwin0cheng edwin0cheng changed the title Implment include macro Implement include macro Mar 6, 2020
Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

// FIXME:
// Handle include as expression
let node =
db.parse_or_expand(file_id.into()).ok_or_else(|| mbe::ExpandError::ConversionError)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ideally, I think we should do something like parse_to_token_tree(db.file_text(file_id)). That is, it seems like we don't need to construct a syntax tree at this point at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. It will be my next PR :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted #3518

@bors
Copy link
Contributor

bors bot commented Mar 6, 2020

@bors bors bot merged commit aa82b59 into rust-lang:master Mar 6, 2020
@edwin0cheng edwin0cheng deleted the include-macro branch March 6, 2020 15:17
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants