Skip to content

Permit token trees, identifiers, and blocks to be following by sequences.#25444

Merged
bors merged 2 commits intorust-lang:masterfrom
nikomatsakis:macro-tt-fix
May 16, 2015
Merged

Permit token trees, identifiers, and blocks to be following by sequences.#25444
bors merged 2 commits intorust-lang:masterfrom
nikomatsakis:macro-tt-fix

Conversation

@nikomatsakis
Copy link
Contributor

Permit token trees, identifiers, and blocks to be following by sequences.

Fixes #25436.

r? @pnkfelix

@pnkfelix
Copy link
Contributor

@nikomatsakis the PR looks good. Could you add a compile-fail test for two sequences with no delimiter between them, e.g.:

macro_rules! foo {
    ( $($a:tt)* $($b:tt)* ) => { }; //~ ERROR sequence repetition followed by another sequence repetition
    ( $($a:item)* $($b:item)* ) => { }; //~ ERROR sequence repetition followed by another sequence repetition
}

@pnkfelix
Copy link
Contributor

(r=me after adding above test; or if you point me at a pre-existing test that does it -- i just didn't see one in my own grepping.)

@nikomatsakis
Copy link
Contributor Author

@bors r=pnkfelix

@bors
Copy link
Collaborator

bors commented May 16, 2015

📌 Commit 7a5d748 has been approved by pnkfelix

@bors
Copy link
Collaborator

bors commented May 16, 2015

⌛ Testing commit 7a5d748 with merge 63b000b...

bors added a commit that referenced this pull request May 16, 2015
Permit token trees, identifiers, and blocks to be following by sequences.

Fixes #25436.

r? @pnkfelix
@bors
Copy link
Collaborator

bors commented May 16, 2015

@bors bors merged commit 7a5d748 into rust-lang:master May 16, 2015
@nikomatsakis nikomatsakis deleted the macro-tt-fix branch March 30, 2016 16:16
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.

$a:tt $($b:tt)* is forbidden in macros

3 participants