about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-18/+10
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-18/+10
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-1/+1
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-1/+1
2015-01-08Store deprecated status of i/u-suffixed literals.Huon Wilson-14/+14
2015-01-07use slicing sugarJorge Aparicio-3/+3
2015-01-06rollup merge of #20609: cmr/memAlex Crichton-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-06syntax/rustc: implement isize/usizeCorey Richardson-2/+2
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-2/+2
2015-01-02std: Stabilize the prelude moduleAlex Crichton-2/+1
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-2/+2
2014-12-21Fallout of std::str stabilizationAlex Crichton-3/+3
2014-12-19ack parser.parse_ty change in quote_ty! (+ test)Mathieu Poumeyrol-2/+1
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-61/+61
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-11-29fix expand_quote_ty function as parse_ty was changed and needs no arguments nowJauhien Piatlicki-2/+1
2014-11-26Test fixes and rebase conflictsAlex Crichton-6/+6
2014-11-25/** -> ///Steve Klabnik-10/+6
This is considered good convention.
2014-11-20Parse and store suffixes on literals.Huon Wilson-15/+18
This adds an optional suffix at the end of a literal token: `"foo"bar`. An actual use of a suffix in a expression (or other literal that the compiler reads) is rejected in the parser. This doesn't switch the handling of numbers to this system, and doesn't outlaw illegal suffixes for them yet.
2014-11-19Switch to an independent enum for `Lit*` subtokens.Huon Wilson-18/+19
2014-11-17libsyntax: DSTify `ToSource` and `ToSourceWithHygiene`Jorge Aparicio-9/+9
2014-11-09Fix ICEs that involved quasi-quotationPiotr Czarnecki-25/+17
* fixed get_tt for doc comments * properly handle MatchNt in `quote` Fixes #18763 Fixes #18775
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-19/+33
2014-10-30Test fixes and rebase conflictsAlex Crichton-1/+1
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-11/+21
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-29Rename fail! to panic!Steve Klabnik-4/+4
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Use an enum rather than a bool in token::IdentBrendan Zabarauskas-2/+7
2014-10-28Use PascalCase for token variantsBrendan Zabarauskas-68/+67
2014-10-26Reduce the size of the TokenTreeBrendan Zabarauskas-1/+2
2014-10-26Use standard capitalisation for TokenTree variantsBrendan Zabarauskas-7/+7
2014-10-26Prevent some vector reallocationsBrendan Zabarauskas-5/+4
2014-10-26Rename TokenTree variants for clarityBrendan Zabarauskas-4/+4
This should be clearer, and fits in better with the `TTNonterminal` variant. Renames: - `TTTok` -> `TTToken` - `TTDelim` -> `TTDelimited` - `TTSeq` -> `TTSequence`
2014-10-26Add Span and separate open/close delims to TTDelimBrendan Zabarauskas-7/+10
This came up when working [on the gl-rs generator extension](https://github.com/bjz/gl-rs/blob/990383de801bd2e233159d5be07c9b5622827620/src/gl_generator/lib.rs#L135-L146). The new definition of `TTDelim` adds an associated `Span` that covers the whole token tree and enforces the invariant that a delimited sequence of token trees must have an opening and closing delimiter. A `get_span` method has also been added to `TokenTree` type to make it easier to implement better error messages for syntax extensions.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-4/+6
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-06syntax: Parse outer attributes in quote_method!Ben Gamari-7/+2
Fixes #17782.
2014-09-29Fixed quote_method!() implementationVladimir Pouzanov-2/+6
Parser.parse_method now has a second argument, I assume ast::Inherited is the correct visibility in this case.
2014-09-16Fallout from renamingAaron Turon-1/+1
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-39/+37
2014-09-08quote: Explicitly borrow the ExtCtxtKeegan McAllister-1/+3
Fixes #16992.
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-19/+20
2014-08-13quote_expr macro: embed Ident using special encoding that preserves hygiene.Felix S. Klock II-3/+96
This adds support to `quote_expr!` and friends for round-trip hygienic preservation of Ident. Here are the pieces of the puzzle: * adding a method for encoding Ident for re-reading into token tree. * Support for reading such encoded Idents in the lexer. Note that one must peek ahead for MOD_SEP after scan_embedded_hygienic_ident. * To ensure that encoded Idents are only read when we are in the midst of expanding a `quote_expr` or similar, added a `read_embedded_ident` flag on `StringReader`. * pprust support for encoding Ident's as (uint,uint) pairs (for hygiene).
2014-08-05Fixes missing overflow lint for i64 #14269Falco Hirschenberger-4/+5
The `type_overflow` lint, doesn't catch the overflow for `i64` because the overflow happens earlier in the parse phase when the `u64` as biggest possible int gets casted to `i64` , without checking the for overflows. We can't lint in the parse phase, so a refactoring of the `LitInt` type was necessary. The types `LitInt`, `LitUint` and `LitIntUnsuffixed` where merged to one type `LitInt` which stores it's value as `u64`. An additional parameter was added which indicate the signedness of the type and the sign of the value.
2014-07-29syntax: add support for quoting armsErick Tryzelaar-0/+8
2014-07-29Fix a bug pretty printing `match { 5i } { _ => { } }`Erick Tryzelaar-0/+2
This also always puts a trailing comma on the last non-block expr.
2014-07-29syntax: allow quasiquoter to inline `Vec<Stmt>`sErick Tryzelaar-0/+2
2014-07-17syntax: Add ToTokens impl for MethodBen Gamari-0/+2
2014-07-17syntax: Add quote_method!Ben Gamari-0/+10
2014-07-16syntax: Generalize ToTokens impl for Vec<T>Ben Gamari-3/+4
It will now `flat_map` over the elements of a `Vec<T>` if `T: ToTokens`
2014-07-16syntax: Add ToTokens for Attribute_Ben Gamari-0/+7
2014-07-16syntax: Add ToTokens for Option<T>Ben Gamari-0/+9