Commit Graph

32 Commits

Author SHA1 Message Date
Aleksey Kladov
fa893a3225 use TokenStream rather than &[TokenTree] for built-in macros
That way, we don't loose the jointness info
2019-09-03 21:15:45 +03:00
Vadim Petrochenkov
0fb01d219c Audit uses of apply_mark in built-in macros
Replace them with equivalents of `Span::{def_site,call_site}` from proc macro API.
The new API is much less error prone and doesn't rely on macros having default transparency.
2019-08-23 01:44:33 +03:00
Vadim Petrochenkov
433b1e36e1 Remove Spanned from ast::Mac 2019-08-15 11:45:28 +03:00
Vadim Petrochenkov
376636e517 syntax: Remove DummyResult::expn_only 2019-08-13 20:53:49 +03:00
bors
f01b9f803b Auto merge of #62816 - estebank:type-ascription-macros, r=petrochenkov
Point at type ascription before macro invocation on expansion parse error

Fix https://github.com/rust-lang/rust/issues/47666. Follow up to https://github.com/rust-lang/rust/pull/62791.

r? @petrochenkov
2019-08-04 16:19:04 +00:00
Mark Rousskov
0f985817bd Replace AstBuilder with inherent methods 2019-07-31 08:55:37 -04:00
Esteban Küber
c82e1f2d0e Point at type ascription before macro invocation on expansion parse error 2019-07-30 09:16:27 -07:00
Vadim Petrochenkov
09703e3843 Adjust other names after the Mark renaming 2019-07-19 12:01:49 +03:00
Jeremy Stucki
d28832dde9
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Vadim Petrochenkov
3da094319c parser: self.span -> self.token.span 2019-06-07 13:51:23 +03:00
Vadim Petrochenkov
ff40e37b98 Some code cleanup and tidy/test fixes 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
67ce3f4589 syntax: Switch function parameter order in TokenTree::token 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
aa6fba98ae syntax: Use Token in Parser 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
e0127dbf81 syntax: Use Token in TokenTree::Token 2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
99b27d749c syntax: Rename Token into TokenKind 2019-06-06 14:03:14 +03:00
Nicholas Nethercote
26451ef7b5 Avoid unnecessary internings.
Most involving `Symbol::intern` on string literals.
2019-05-27 13:58:38 +10:00
Vadim Petrochenkov
ca2a50fad7 syntax: Turn token::Lit into a struct 2019-05-23 12:46:24 +03:00
Alexey Shmalko
f29e9a5cb8
Handle common assert! misuses 2019-04-25 02:06:38 +03:00
Alexey Shmalko
dfc0861085
Make assert! ensure the macro is parsed completely 2019-04-17 15:30:15 +03:00
Taiki Endo
3216c7656a Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
Taiki Endo
94f121ff3f libsyntax_ext => 2018 2019-02-04 21:49:54 +09:00
Andy Russell
0a6fb84738
make panictry! private to libsyntax
This commit completely removes usage of the `panictry!` macro from
outside libsyntax. The macro causes parse errors to be fatal, so using
it in libsyntax_ext caused parse failures *within* a syntax extension to
be fatal, which is probably not intended.

Furthermore, this commit adds spans to diagnostics emitted by empty
extensions if they were missing, à la #56491.
2019-01-02 11:02:30 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Andy Russell
a367cec6e3
emit error with span for empty asserts
Fixes #55547.
2018-12-04 10:22:48 -05:00
Donato Sciarra
82607d2cf3 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
ljedrz
08c113abef Deny bare trait objects in src/libsyntax_ext 2018-07-12 11:58:16 +02:00
Alex Crichton
a137d00ce5 rustc: Correctly pretty-print macro delimiters
This commit updates the `Mac_` AST structure to keep track of the delimiters
that it originally had for its invocation. This allows us to faithfully
pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in
turn helps procedural macros due to #43081.

Closes #50840
2018-05-22 11:56:41 -07:00
Shotaro Yamada
39df2231bb Fix assertion message generation 2018-05-06 12:13:32 +09:00
Vadim Petrochenkov
b3b5ef186c Remove more duplicated spans 2018-04-06 11:50:49 +03:00
Vadim Petrochenkov
43ad972318 Use Span::apply_mark where possible 2018-04-06 11:48:19 +03:00
Shotaro Yamada
4a254c0050 Escape stringified expression
Payload of `Literal` token must be escaped.
Also print printable non-ASCII characters.
2018-03-14 18:11:42 +09:00
Shotaro Yamada
517083fbad Make assert macro a built-in procedural macro 2018-03-07 17:22:58 +09:00