diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-14 07:12:09 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-14 07:12:09 +0100 |
commit | c417c77b681f10cc7585507bd874e9fd2cea63b8 (patch) | |
tree | d05cf30716a7791cfc0d8fcfe522a7132b5fff06 /editors/code | |
parent | ee0ab7c00b4b8c5375c14b44e3d7288ebf0d732d (diff) | |
parent | caa8663c08e1724af2abcde11fa937937d76aa14 (diff) |
Merge #1267
1267: Macro expand to r=edwin0cheng a=matklad
closes #1264
The core problem this PR is trying to wrangle is that macros can expand to different stuffs, depending on context.
That is, `foo!()` on the top-level expands to a list of items, but the same `foo!()` in expression position expands to expression.
Our current `hir_parse(HirFileId) -> TreeArc<SourceFile>` does not really support this.
So, the plan is to change `hir_parse` to untyped inreface (`TreeArc<Syntaxnode>`), and add `expands_to` field to `MacroCallLoc`, such that the *target* of macro expansion is selected by the calling code and is part of macro id.
This unfortunately looses some type-safety :(
Moreover, this doesn't really fix #1264 by itself, because we die due to some other error inside macro expansion: expander fails to produce a tree with a single root, which trips assert inside rowan.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'editors/code')
0 files changed, 0 insertions, 0 deletions