diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2011-08-04 11:58:09 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2011-08-15 15:35:27 -0700 |
| commit | 5428d4ee6d7afbd9d587658903a7c686eb97f9c3 (patch) | |
| tree | b49ba6bd245e67c4af28d83e5960dcab270e8956 /src/comp/syntax/ext/simplext.rs | |
| parent | e39d83539029a153216b32fd016e253ce7a8aa8a (diff) | |
| download | rust-5428d4ee6d7afbd9d587658903a7c686eb97f9c3.tar.gz rust-5428d4ee6d7afbd9d587658903a7c686eb97f9c3.zip | |
Check for nonconsistent macro names.
Diffstat (limited to 'src/comp/syntax/ext/simplext.rs')
| -rw-r--r-- | src/comp/syntax/ext/simplext.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs index 77366f81dc7..29a9c0b5345 100644 --- a/src/comp/syntax/ext/simplext.rs +++ b/src/comp/syntax/ext/simplext.rs @@ -675,7 +675,17 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr, alt mac.node { mac_invoc(pth, invoc_arg, body) { alt path_to_ident(pth) { - some(id) { macro_name = some(id); } + some(id) { + alt macro_name { + none. { macro_name = some(id); } + some(other_id) { + if id != other_id { + cx.span_fatal(pth.span, "macro name must be " + + "consistent"); + } + } + } + } none. { cx.span_fatal(pth.span, "macro name must not be a path"); |
