summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2013-12-10auto merge of #10833 : sfackler/rust/mut-pat, r=brsonbors-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-11Separate strict/reserved keywords, derive bounds.Chris Morgan-11/+29
It's twenty lines longer, but makes for clearer separation of strict and reserved keywords (probably a good thing) and removes another moving part (the definitions of `(STRICT|RESERVED)_KEYWORD_(START|FINAL)`).
2013-12-11Remove the following unused special identifiers:Chris Morgan-107/+67
- underscore ("_") - unary ("unary") - not_fn ("!") - idx_fn ("[]") - unary_minus_fn ("unary-") - item ("item") - block ("block") - stmt ("stmt") - pat ("pat") - expr ("expr") - ty ("ty") - ident ("ident") - path ("path") - descrim ("descrim") - clownshoe_stack_shim ("__rust_stack_shim") - blk ("blk") - c_abi ("C") (And, of course, renumber everything to match.)
2013-12-11Deduplicate in syntax::parse::token with a macro.Chris Morgan-271/+183
I also renumbered things at the same time; ``in`` was shifted into its alphabetical position and the reserved keywords were reordered (a couple of them were out of order).
2013-12-10Allow ref and mut modifiers for short form field patternsSteven Fackler-1/+16
Previously, if you wanted to bind a field mutably or by ref, you had to do something like Foo { x: ref mut x }. You can now just do Foo { ref mut x }. Closes #6137
2013-12-08Remove dead codesKiet Tran-113/+0
2013-12-05Forbid keywords as lifetime parameters names.Léo Testard-1/+11
2013-12-04Rename extra::json::*::init() constructors to *::new()Kevin Ballard-1/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-2/+2
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04auto merge of #10792 : kballard/rust/parse_sugary_call_expr-comments, ↵bors-8/+8
r=alexcrichton The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-04std::str: remove from_utf8.Huon Wilson-1/+1
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-03Fix the comments for libsyntax::parse::parser::parse_sugary_call_exprKevin Ballard-8/+8
The comments on this function date back from when it was used for `for` expressions in addition to `do` expressions.
2013-12-01auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichtonbors-7/+7
2013-12-01auto merge of #10676 : eddyb/rust/ast-box-in-enums, r=cmrbors-78/+92
**Note**: I only tested on top of my #10670 PR, size reductions come from both change sets. With this, [more enums are shrinked](https://gist.github.com/eddyb/08fef0dfc6ff54e890bc), the most significant one being `ast_node`, from 104 bytes (master) to 96 (#10670) and now to 32 bytes. My own testcase requires **200MB** less when compiling (not including the other **200MB** gained in #10670), and rustc-stage2 is down by about **130MB**. I believe there is more to gain by fiddling with the enums' layouts.
2013-12-01ast: Remove one `@` and fix the falloutPhilipp Brüschweiler-7/+7
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-78/+92
critical enum sizes.
2013-11-30auto merge of #10727 : erickt/rust/json, r=huonwbors-4/+5
This PR does some small modernizations to the json library. First is to remove the `@` boxes, second is to rename the constructors to `new`.
2013-11-29extra: missed a couple `@` in jsonErick Tryzelaar-1/+1
2013-11-29extra: json::Encoder should take a &mut io::WriterErick Tryzelaar-3/+4
2013-11-29extra: Rename json constructors into *::initErick Tryzelaar-1/+1
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-2/+2
2013-11-28Register new snapshotsAlex Crichton-69/+66
2013-11-27Be more strict about doc commentsCorey Richardson-4/+2
Previously, `//// foo` and `/*** foo ***/` were accepted as doc comments. This changes that, so that only `/// foo` and `/** foo ***/` are accepted. This confuses many newcomers and it seems weird. Also update the manual for these changes, and modernify the EBNF for comments. Closes #10638
2013-11-27Freeze the AST by removing a couple of unused @mut ~[T] from token_tree.Eduard Burtescu-2/+2
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-6/+6
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-6/+6
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-40/+34
2013-11-26libsyntax: Remove the old-style borrowed closure type syntax from thePatrick Walton-1/+8
language.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-7/+7
2013-11-25auto merge of #10628 : huonw/rust/3614, r=alexcrichtonbors-7/+17
Fixes #3614.
2013-11-25syntax: parse inner attributes on impls.Huon Wilson-7/+17
Fixes #3614.
2013-11-24Add a note for unclosed delimitersCorey Richardson-9/+7
Currently, the parser doesn't give any context when it finds an unclosed delimiter and it's not EOF. Report the most recent unclosed delimiter, to help the user along. Closes #10636
2013-11-20auto merge of #10567 : sanxiyn/rust/bytepos, r=alexcrichtonbors-7/+7
2013-11-21Fix parsing testsSeo Sanghyeon-1/+1
2013-11-20Make BytePos 32-bitSeo Sanghyeon-6/+6
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-65/+73
2013-11-18libsyntax: Remove `~fn()` from the languagePatrick Walton-3/+11
2013-11-18Use '..' as slice wildcard in vectorsBrian Anderson-12/+35
2013-11-18Use '..' as multi-field wildcard in enums and structs.Brian Anderson-1/+26
2013-11-16auto merge of #10420 : sanxiyn/rust/path, r=cmrbors-4/+0
Fix #10283.
2013-11-11Move std::rt::io to std::ioAlex Crichton-6/+6
2013-11-11Fix path parsingSeo Sanghyeon-4/+0
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-50/+25
2013-11-07auto merge of #10243 : mattcarberry/rust/master, r=brsonbors-0/+13
Associated with Issue #6563. Useful for Apollo Guidance Computer simulation, Unix file system permissions, and maybe one or two other things.
2013-11-04libsyntax/librustc: Allow calling variadic foreign functions.Luqman Aden-26/+78
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-3/+2
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-10/+6
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-11-02Added octal literal support.Matt Carberry-0/+13
2013-10-31librustc: Implement `|A| -> B` syntax for closures and make bare `fn`Patrick Walton-31/+155
work
2013-10-30syntax: Forbid non-string literals in meta items. #623Brian Anderson-0/+10