about summary refs log tree commit diff
path: root/src/libsyntax/ext/quote.rs
AgeCommit message (Collapse)AuthorLines
2015-12-31Cut out a bunch of Result and panictry! boilerplate from libsyntax.Nick Cameron-1/+1
[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-1/+1
2015-12-17Remove unused importsJeffrey Seyfried-2/+2
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-0/+1
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-17Fix match_ref_pats flagged by ClippySeo Sanghyeon-3/+3
2015-11-13Move the panicking parse functions out of the parserKyle Mayes-3/+52
Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
2015-11-13Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiynbors-1/+1
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-11libsyntax: Add more quasiquoting macrosKyle Mayes-0/+51
2015-11-10Rename _nopanic methods to remove the suffix.Eli Friedman-1/+1
Just `sed s/_nopanic//g`. Hopefully makes libsyntax a bit more readable.
2015-11-06remove `Tt` prefix from TokenType variantsOliver Schneider-46/+53
[breaking change]
2015-10-28Make quote plugin use parsing functions which explicitly panic.Eli Friedman-7/+7
Rename parse_* to parse_*_panic, and add parse_attribute_panic.
2015-10-27Don't use panicking helpers in Parser.Eli Friedman-1/+1
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-1/+1
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-8/+9
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-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-2/+2
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-9/+9
2015-05-15syntax: Unquoting some statements requires trailing semicolonsErick Tryzelaar-3/+11
2015-05-15syntax: Add unquoting ast::{Generics,WhereClause}Erick Tryzelaar-0/+12
2015-04-25Interpolate AST nodes in quasiquote.Geoffry Song-235/+128
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. A new `Nonterminal` is added, NtArm, which the parser now interpolates. This is just for quasiquote, not macros (although it could be in the future). `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
2015-04-05Work towards a non-panicing parser (libsyntax)Phil Dawes-3/+3
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-4/+4
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23776: nrc/allow_trivial_castAlex Crichton-1/+0
r? @alexcrichton
2015-03-27Change the trivial cast lints to allow by defaultNick Cameron-1/+0
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-2/+2
Now that support has been removed, all lingering use cases are renamed.
2015-03-26Auto merge of #23359 - erickt:quote, r=pnkfelixbors-0/+4
This PR allows the quote macros to unquote trait items, impl items, where clauses, and paths.
2015-03-25rustc: Remove support for int/uintAlex Crichton-2/+2
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-24syntax: Allow quotes to insert pathErick Tryzelaar-0/+2
2015-03-24syntax: Allow where strings to be parsed independent from genericsErick Tryzelaar-0/+2
This allows quasiquoting to insert where clauses.
2015-03-25Change lint names to pluralsNick Cameron-1/+1
2015-03-25Add trivial cast lints.Nick Cameron-0/+1
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-19Added missing impl_to_source! and impl_to_tokens! for TraitItem.Vladimir Pouzanov-0/+2
2015-03-19Added missing impl_to_source! and impl_to_tokens! for ImplItem.Vladimir Pouzanov-0/+2
This fixes several use cases that were broken after #23265 landed.
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-8/+4
passing the latter around.
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-11/+0
2015-03-05Fix quoting of ?SizedSeo Sanghyeon-1/+2
2015-03-04Add quasiquote for matchers and attributesPiotr Czarnecki-28/+127
2015-02-27Replace MacExpr / MacPat / MacItems with MacEagerKeegan McAllister-8/+8
MacEager is a MacResult implementation for the common case where you've already built each form of AST that you might return. Fixes #17637. Based on #18814. This is a [breaking-change] for syntax extensions: * MacExpr::new becomes MacEager::expr. * MacPat::new becomes MacEager::pat. * MacItems::new becomes MacEager::items. It takes a SmallVector directly, not an iterator.
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-2/+2
2015-02-06Libsyntax has been updatedGuillaumeGomez-3/+1
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-1/+3
2015-02-04remove all kind annotations from closuresJorge Aparicio-2/+2
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-1/+1
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-1/+1
2015-02-02Omit integer suffix when unnecessaryAlfie John-1/+1
See PR # 21378 for context
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-1/+1
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