Skip to content
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

syntax: indicate an error when a macro ignores trailing tokens. #9673

Merged
merged 2 commits into from
Oct 2, 2013

Commits on Oct 2, 2013

  1. syntax: remove some dead code.

    huonw committed Oct 2, 2013
    Configuration menu
    Copy the full SHA
    bbbafc4 View commit details
    Browse the repository at this point in the history
  2. syntax: indicate an error when a macro ignores trailing tokens.

    That is, only a single expression or item gets parsed, so if there are
    any extra tokens (e.g. the start of another item/expression) the user
    should be told, rather than silently dropping them.
    
    An example:
    
        macro_rules! foo {
            () => {
                println("hi");
                println("bye);
            }
        }
    
    would expand to just `println("hi")`, which is almost certainly not
    what the programmer wanted.
    
    Fixes rust-lang#8012.
    huonw committed Oct 2, 2013
    7 Configuration menu
    Copy the full SHA
    8284df9 View commit details
    Browse the repository at this point in the history