Skip to content

Conversation

@edwin0cheng
Copy link
Contributor

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
Contributor

@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
Contributor

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
Contributor 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
Contributor 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