]> git.lizzy.rs Git - rust.git/commit
Suggest comma when missing in macro call
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 8 Aug 2018 05:28:09 +0000 (22:28 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Wed, 8 Aug 2018 05:31:57 +0000 (22:31 -0700)
commitf4039affa338fc5640c102ac5786a491bc94201f
treed14193269d6e327b07827b5c4398805822986ade
parent26d7b64237c6daa66064c8583b7aecf534c2a9ae
Suggest comma when missing in macro call

When missing a comma in a macro call, suggest it, regardless of
position. When a macro call doesn't match any of the patterns, check
if the call's token stream could be missing a comma between two idents,
and if so, create a new token stream containing the comma and try to
match against the macro patterns. If successful, emit the suggestion.
src/libsyntax/ext/tt/macro_rules.rs
src/libsyntax/tokenstream.rs
src/test/ui/macros/missing-comma.rs
src/test/ui/macros/missing-comma.stderr