about summary refs log tree commit diff
path: root/src/libsyntax/print
AgeCommit message (Collapse)AuthorLines
2016-05-29Auto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelixbors-2/+2
Prevent overflows by increasing ring buffer size Please note that this change is just done to prevent issues as currently seen by syntex_syntax in future. See https://github.com/serde-rs/syntex/pull/47 for details. As shown in https://github.com/serde-rs/syntex/issues/33, complex code can easily overflow the ring-buffer and cause an assertion error.
2016-05-28Prevent overflows by increasing ring buffer sizeSebastian Thiel-2/+2
Please note that this change is just done to prevent issues as currently seen by syntex_syntax in future. See https://github.com/serde-rs/syntex/pull/47 for details. As shown in https://github.com/serde-rs/syntex/issues/33, complex code can easily overflow the ring-buffer and cause an assertion error.
2016-05-27Rollup merge of #33644 - petrochenkov:selfast, r=nrcManish Goregaokar-52/+29
The AST part of https://github.com/rust-lang/rust/pull/33505. https://github.com/rust-lang/rust/pull/33505 isn't landed yet, so this PR is based on top of it. r? @nrc plugin-[breaking-change] cc #31645 @Manishearth
2016-05-27Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakisManish Goregaokar-14/+30
cc https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-14/+30
2016-05-25Add a new AST-only type variant `ImplicitSelf`Vadim Petrochenkov-0/+3
2016-05-25Remove ExplicitSelf from ASTVadim Petrochenkov-52/+26
2016-05-24syntax/hir: give loop labels a spanGeorg Brandl-4/+4
This makes the "shadowing labels" warning *not* print the entire loop as a span, but only the lifetime. Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-05-14syntax: Refactor parsing of method declarationsVadim Petrochenkov-36/+15
Fix spans and expected token lists, fix #33413 + other cosmetic improvements Add test for #33413 Convert between `Arg` and `ExplicitSelf` precisely Simplify pretty-printing for methods
2016-05-01libsyntax/pp: replace manual ring buffer with a VecDequeGeorg Brandl-52/+19
2016-05-01libsyntax/pp: minor modernizationsGeorg Brandl-40/+32
* implement Display on Token instead of custom tok_str() fn * use expression returns * remove redundant parens in asserts * remove "/* bad */" comments that appear to be related to early changes in memory management * and a few individual idiomatic changes
2016-04-25Rollup merge of #33041 - petrochenkov:path, r=nrc,ManishearthManish Goregaokar-20/+10
Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary. The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109. This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed. The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\". The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!). This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change]. r? @eddyb
2016-04-24Remove some old code from libsyntaxVadim Petrochenkov-2/+2
2016-04-24syntax: Merge keywords and remaining special idents in one listVadim Petrochenkov-4/+3
Simplify the macro used for generation of keywords Make `Keyword::ident` private
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-1/+1
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-14/+5
2016-04-24thread tighter span for closures aroundNiko Matsakis-1/+1
Track the span corresponding to the `|...|` part of the closure.
2016-04-14Add a span to the `Crate` variant of `ast::Visibility`Jeffrey Seyfried-2/+2
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-4/+6
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-06Move span into `StructField`Vadim Petrochenkov-6/+6
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-21/+11
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-0/+5
2016-04-02Make `ast::Visibility` non-copyableJeffrey Seyfried-32/+32
2016-03-22fix alignmentJorge Aparicio-41/+35
2016-03-22try! -> ?Jorge Aparicio-865/+865
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-16Auto merge of #31746 - erickt:newline, r=sfacklerbors-1/+2
syntax: Always pretty print a newline after doc comments Before this patch, code that had a doc comment as the first line, as in: ```rust /// Foo struct Foo; ``` Was pretty printed into: ```rust ///Foostruct Foo; ``` This makes sure that that there is always a trailing newline after a doc comment. Closes #31722
2016-03-14Add pretty printer output for `default`Aaron Turon-0/+3
2016-03-12Removed integer suffixes in libsyntax cratesrinivasreddy-2/+2
2016-03-07implement the `?` operatorJorge Aparicio-0/+4
The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining: `File::open("foo")?.metadata()?.is_dir()`. `?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`, `(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`. cc #31436
2016-03-07syntax: Always pretty print a newline after doc commentsErick Tryzelaar-1/+2
Before this patch, code that had a doc comment as the first line, as in: ```rust /// Foo struct Foo; ``` Was pretty printed into: ```rust ///Foostruct Foo; ``` This makes sure that that there is always a trailing newline after a doc comment. Closes #31722
2016-02-27fix fallout from libsyntax enumpocalypseAlex Burka-1/+1
2016-02-27libsyntax: parse inclusive rangesAlex Burka-2/+6
2016-02-13Split ast::PatKind::Enum into tuple struct and path patternsVadim Petrochenkov-7/+8
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-16/+16
2016-02-12Use more autoderef in libsyntaxJonas Schievink-133/+133
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-4/+4
2016-02-11[breaking-change] don't glob export ast::PathListItem_ variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-8/+8
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-8/+8
2016-02-11[breaking-change] don't glob export ast::TraitItemKind variantsOliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-11/+11
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::MacStmtStyleOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::KleeneOp variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-15/+15
2016-02-11[breaking-change] don't glob export ast::ForeignItem_ variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-8/+8
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-15/+15