Skip to content

issues with stmt arguments to macros #13679

Closed
@comex

Description

@comex

I'm not exactly sure what it's supposed to do, but it seems wrong:

#![feature(macro_rules)]
macro_rules! some_stmts(
    ({ $($s:stmt)* }) => ($($s)*)
)

fn main() {
    some_stmts!({
        //let a = 5;
        type a = int;
    })
}

As is, we get:

stmts.rs:10:5: 10:6 error: local ambiguity: multiple parsing options: built-in NTs stmt ('s') or 1 other options.
stmts.rs:10     })

even though there is no way } could start a statement. With the let instead, it's

stmts.rs:8:18: 8:19 error: unexpected token: `;`
stmts.rs:8         let a = 5;

which doesn't seem to make sense either.

rustc 0.11-pre-nightly (d35804e 2014-04-18 00:01:22 -0700)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions