summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
AgeCommit message (Collapse)AuthorLines
2016-02-05trpl: fix macro follow setsAlex Burka-0/+1
2016-02-05add `[` to FOLLOW(ty) and FOLLOW(path)Alex Burka-1/+1
Following RFC 1462 (amending 550). Closes #31135.
2016-01-07extending FOLLOW(NT) as specified in amendment.Felix S. Klock II-4/+7
See RFC amendment 1384: https://github.com/rust-lang/rfcs/pull/1384
2016-01-07macro_rules: proper FIRST/FOLLOW computations for checking macro_rules validity.Felix S. Klock II-16/+500
See RFC amendment 1384 and tracking issue 30450: https://github.com/rust-lang/rfcs/pull/1384 https://github.com/rust-lang/rust/issues/30450 Moved old check_matcher code into check_matcher_old combined the two checks to enable a warning cycle (where we will continue to error if the two checks agree to reject, accept if the new check says accept, and warn if the old check accepts but the new check rejects).
2016-01-06Auto merge of #30654 - nrc:panictry, r=brsonbors-4/+4
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery. [breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2016-01-04Add test for "malformed macro lhs" and change back span_bug to span_fatalGuillaume Gomez-2/+2
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-4/+4
[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
2015-12-30use structured errorsNick Cameron-15/+28
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-4/+4
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-17Remove unused importsJeffrey Seyfried-2/+2
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-4/+4
Also split out emitters into their own module.
2015-12-15Generated code spans now point to callsite parameters (where applicable)Daniel Campbell-5/+8
2015-11-25Fix "Cannot fill in a NT" ICEJonas Schievink-12/+23
2015-11-25Auto merge of #30011 - jonas-schievink:macro-context, r=nrcbors-10/+10
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-24Remove "this"Jonas Schievink-1/+1
2015-11-24Fix unreachable code in libsyntaxManish Goregaokar-2/+2
2015-11-23Print the macro context name on incomplete parseJonas Schievink-10/+10
Fixes #22425 Also fixes #30007, since it's just a change from `true` to `false`.
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-17/+17
2015-11-16Auto merge of #29828 - sanxiyn:check-macro, r=nrcbors-49/+63
Fix #27409.
2015-11-14Check macro definition and do not expand invalid macrosSeo Sanghyeon-3/+22
2015-11-14Reindent codeSeo Sanghyeon-22/+22
2015-11-14Store TokenTree in MacroRulesMacroExpanderSeo Sanghyeon-28/+23
2015-11-13Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiynbors-10/+10
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-10/+10
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-10Use deref coercionsSeo Sanghyeon-1/+1
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-67/+72
[breaking change]
2015-10-27Don't panic for fatal errors in attribute parsing.Eli Friedman-1/+1
2015-10-27Delete unnecessary ParserAttr trait.Eli Friedman-1/+0
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-9/+9
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-2/+2
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-14/+14
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-08-19Auto merge of #27849 - jonas-schievink:macro-errors, r=nikomatsakisbors-46/+50
And some small indentation/code style fixes in the macro parser.
2015-08-15Slightly improved macro diagnostics + Indentation fixesJonas Schievink-46/+50
2015-08-15Fix span of invalid metavariable repetitionJonas Schievink-1/+1
2015-08-10add and use Span.substitute_dummy methodTim Neumann-17/+6
2015-08-07improve span of erroneous empty macro invocationTim Neumann-22/+27
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-08-04Extend macro machinery to expand macros in typesJared Roesch-0/+6
Reapplied the changes from https://github.com/freebroccolo/rust/commit/7aafe24139abc2d1f302bbb166bcaa006f12cf4d to a clean branch of master
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-24/+17
2015-07-24Make ICE an error and use a sensible error messageAndy Caldwell-2/+2
2015-07-13Auto merge of #27000 - alexcrichton:semi-after-type, r=cmrbors-1/+1
This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path }
2015-07-12syntax: Allow semi tokens after macro ty/pathAlex Crichton-1/+1
This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path }
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-05-22Allow patterns to be followed by if and in.Steven Allen-0/+1
Needed to support: match X { pattern if Y ... } for pattern in Y {}
2015-05-15Permit token trees, identifiers, and blocks to be following byNiko Matsakis-34/+78
sequences. Fixes #25436.
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-12/+12
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-2/+0
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-4/+4
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-11Auto merge of #24155 - chris-chambers:stmt_macros, r=sfacklerbors-4/+18
Statement macros are now treated somewhat like item macros, in that a statement macro can now expand into a series of statements, rather than just a single statement. This allows statement macros to be nested inside other kinds of macros and expand properly, where previously the expansion would only work when no nesting was present. See: - `src/test/run-pass/macro-stmt_macro_in_expr_macro.rs` - `src/test/run-pass/macro-nested_stmt_macro.rs` This changes the interface of the MacResult trait. make_stmt has become make_stmts and now returns a vector, rather than a single item. Plugin writers who were implementing MacResult will have breakage, as well as anyone using MacEager::stmt. See: - `src/libsyntax/ext/base.rs` This also causes a minor difference in behavior to the diagnostics produced by certain malformed macros. See: - `src/test/compile-fail/macro-incomplete-parse.rs`
2015-04-07Improves handling of statement macros.Christopher Chambers-4/+18
Statement macros are now treated somewhat like item macros, in that a statement macro can now expand into a series of statements, rather than just a single statement. This allows statement macros to be nested inside other kinds of macros and expand properly, where previously the expansion would only work when no nesting was present. See: src/test/run-pass/macro-stmt_macro_in_expr_macro.rs src/test/run-pass/macro-nested_stmt_macro.rs This changes the interface of the MacResult trait. make_stmt has become make_stmts and now returns a vector, rather than a single item. Plugin writers who were implementing MacResult will have breakage, as well as anyone using MacEager::stmt. See: src/libsyntax/ext/base.rs This also causes a minor difference in behavior to the diagnostics produced by certain malformed macros. See: src/test/compile-fail/macro-incomplete-parse.rs