about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
2014-07-09ast: make Name its own typeCorey Richardson-7/+16
2014-07-09syntax: don't parse numeric literals in the lexerCorey Richardson-36/+5
This removes a bunch of token types. Tokens now store the original, unaltered numeric literal (that is still checked for correctness), which is parsed into an actual number later, as needed, when creating the AST. This can change how syntax extensions work, but otherwise poses no visible changes. [breaking-change]
2014-07-09syntax: don't process string/char/byte/binary litsCorey Richardson-2/+2
This shuffles things around a bit so that LIT_CHAR and co store an Ident which is the original, unaltered literal in the source. When creating the AST, unescape and postprocess them. This changes how syntax extensions can work, slightly, but otherwise poses no visible changes. To get a useful value out of one of these tokens, call `parse::{char_lit, byte_lit, bin_lit, str_lit}` [breaking-change]
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-12/+12
[breaking-change]
2014-07-03Simplify creating a parser from a token treePiotr Jawniak-6/+1
Closes #15306
2014-06-25auto merge of #15160 : alexcrichton/rust/remove-f128, r=brsonbors-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24Allow splicing more things in quotesKeegan McAllister-0/+16
2014-06-24Use macros to implement syntax::ext::quote::ToSourceKeegan McAllister-125/+74
This code deserves a bigger refactor, but here's a local improvement.
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-1/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-17Add a b'x' byte literal of type u8.Simon Sapin-0/+6
2014-06-14Register new snapshotsAlex Crichton-9/+0
2014-06-13syntax: parse outer attributes in `quote_item!` calls.Huon Wilson-3/+2
Fixes #14857.
2014-06-13syntax: fix quote_pat! & unignore a quotation test.Huon Wilson-3/+1
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-2/+2
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-24/+28
2014-06-07Implement ToSource and ToToken for ast::ArgHanno Braun-0/+7
This makes ast::Arg usable in the quote_ macros. Please note that this commit doesn't include a regression test. There are tests that use the quote macros, but all of them are ignored. Due to that, there is no obvious (to me) way to test this. Since this change is absolutely trivial and only hooks up an additional type to existing infrastructure (which presumably is tested elsewhere), I concluded it's not worth the effort to follow up on this.
2014-06-04syntax: Make quasiquoter use absolute pathsklutzy-69/+54
As part of removing `pub use` glob, two extra import globs were injected to make `quote_expr!` work. However the globs caused `unused_import` warning in some places. Quasiquoter needed the globs since it generated idents (e.g. `TyU`) rather than absolute paths (`::syntax::ast::TyU`). This patch removes the extra globs and makes quasiquoter use absolute paths. Fixes #14618
2014-06-02syntax: Remove use of `pub use` globsklutzy-8/+20
`quote_expr!` now injects two more (priv) `use` globs. This may cause extra unused_imports warning.
2014-05-27std: Rename strbuf operations to stringRicho Healey-12/+12
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-13/+13
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-35/+35
[breaking-change]
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-1/+0
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-23syntax: Clean out obsolete syntax parsingAlex Crichton-1/+0
All of these features have been obsolete since February 2014, where most have been obsolete since 2013. There shouldn't be any more need to keep around the parser hacks after this length of time.
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-3/+3
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-47/+55
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-6/+12
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02syntax: implement ToSource for more things in the quasiquoter.Huon Wilson-0/+23
The last few primitive types were missing.
2014-04-22add support for quadruple precision floating pointDaniel Micay-1/+2
This currently requires linking against a library like libquadmath (or libgcc), because compiler-rt barely has any support for this and most hardware does not yet have 128-bit precision floating point. For this reason, it's currently hidden behind a feature gate. When compiler-rt is updated to trunk, some tests can be added for constant evaluation since there will be support for the comparison operators. Closes #13381
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-16/+16
2014-04-16syntax: unify all MacResult's into a single trait.Huon Wilson-12/+12
There's now one unified way to return things from a macro, instead of being able to choose the `AnyMacro` trait or the `MRItem`/`MRExpr` variants of the `MacResult` enum. This does simplify the logic handling the expansions, but the biggest value of this is it makes macros in (for example) type position easier to implement, as there's this single thing to modify. By my measurements (using `-Z time-passes` on libstd and librustc etc.), this appears to have little-to-no impact on expansion speed. There are presumably larger costs than the small number of extra allocations and virtual calls this adds (notably, all `macro_rules!`-defined macros have not changed in behaviour, since they had to use the `AnyMacro` trait anyway).
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-3/+3
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-4/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-2/+2
Closes #12771
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-8/+14
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-52/+52
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-8/+7
2014-02-08Fixed error starting with uppercasemr.Shu-2/+2
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-02libsyntax: De-`@str` pathnamesPatrick Walton-17/+14
2014-02-02librustc: Stop using `@str` for source.Patrick Walton-11/+11
2014-02-02libsyntax: De-`@str` `to_source`Patrick Walton-41/+42
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-2/+4
2014-01-23Redo exported macro serializationSteven Fackler-1/+0
The old method of serializing the AST gives totally bogus spans if the expansion of an imported macro causes compilation errors. The best solution seems to be to serialize the actual textual macro definition and load it the same way the std-macros are. I'm not totally confident that getting the source from the CodeMap will always do the right thing, but it seems to work in simple cases.
2014-01-20auto merge of #11660 : sfackler/rust/quote-unused-sp, r=huonwbors-2/+2
The provided span isn't used in all cases (namely primitives).
2014-01-18Avoid unused variable warning in quote_*!Steven Fackler-2/+2
The provided span isn't used in all cases (namely primitives).
2014-01-18auto merge of #11607 : alexcrichton/rust/issue-9957, r=cmrbors-1/+1
For `use` statements, this means disallowing qualifiers when in functions and disallowing `priv` outside of functions. For `extern mod` statements, this means disallowing everything everywhere. It may have been envisioned for `pub extern mod foo` to be a thing, but it currently doesn't do anything (resolve doesn't pick it up), so better to err on the side of forwards-compatibility and forbid it entirely for now. Closes #9957
2014-01-18Forbid unnecessary visibility on view itemsAlex Crichton-1/+1
For `use` statements, this means disallowing qualifiers when in functions and disallowing `priv` outside of functions. For `extern mod` statements, this means disallowing everything everywhere. It may have been envisioned for `pub extern mod foo` to be a thing, but it currently doesn't do anything (resolve doesn't pick it up), so better to err on the side of forwards-compatibility and forbid it entirely for now. Closes #9957
2014-01-16Load macros from external modulesSteven Fackler-1/+1
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-67/+63
2014-01-02libsyntax: De-`@mut` `quote_depth` in the parserPatrick Walton-1/+1
2014-01-02libsyntax: Make the parser mutablePatrick Walton-9/+5