about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
AgeCommit message (Collapse)AuthorLines
2014-05-28Parse macros in patternsKeegan McAllister-7/+20
Fixes #6830.
2014-05-27Rename PatUniq to PatBox. Fixes part of #13910.Ahmed Charles-3/+3
2014-05-27auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, ↵bors-4/+4
r=alexcrichton This should block on #14323
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-27std: Remove String's to_ownedRicho Healey-1/+1
2014-05-26syntax: Add a source field to `Local` for tracking if it comes from `let`s ↵Huon Wilson-1/+2
or `for`s.
2014-05-25Allow $foo:block nonterminals in expression positionKevin Ballard-7/+11
Fixes #13678.
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-10/+10
[breaking-change]
2014-05-23Improve error message for lifetimes after type params.Kevin Butler-1/+13
Closes #14303.
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-127/+13
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-127/+13
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-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-2/+4
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-3/+3
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-51/+76
2014-05-20syntax: Parse global paths in patternsAlex Crichton-1/+1
Closes #6449
2014-05-17syntax: Tighten search paths for inner modulesAlex Crichton-6/+44
This is an implementation of RFC 16. A module can now only be loaded if the module declaring `mod name;` "owns" the current directory. A module is considered as owning its directory if it meets one of the following criteria: * It is the top-level crate file * It is a `mod.rs` file * It was loaded via `#[path]` * It was loaded via `include!` * The module was declared via an inline `mod foo { ... }` statement For example, this directory structure is now invalid // lib.rs mod foo; // foo.rs mod bar; // bar.rs; fn bar() {} With this change `foo.rs` must be renamed to `foo/mod.rs`, and `bar.rs` must be renamed to `foo/bar.rs`. This makes it clear that `bar` is a submodule of `foo`, and can only be accessed through `foo`. RFC: 0016-module-file-system-hierarchy Closes #14180 [breaking-change]
2014-05-13syntax: Fix parsing << with closure typesAlex Crichton-6/+54
This uses the trick of replacing the << token with a < token to parse closure types correctly. Closes #13324
2014-05-13Touch up and rebase previous commitsAlex Crichton-3/+0
* Added `// no-pretty-expanded` to pretty-print a test, but not run it through the `expanded` variant. * Removed #[deriving] and other expanded attributes after they are expanded * Removed hacks around &str and &&str and friends (from both the parser and the pretty printer). * Un-ignored a bunch of tests
2014-05-12Cleanup some ugly variable names, now that we have `let`-hygiene.Paul Stansifer-14/+14
2014-05-12Add some long-overdue documentation on the INTERPOLATED helper macros.Paul Stansifer-1/+6
2014-05-09Register new snapshotsAlex Crichton-6/+0
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-7/+13
2014-05-07auto merge of #14005 : alexcrichton/rust/extern-unsafe, r=pcwaltonbors-14/+24
Previously, the parser would not allow you to simultaneously implement a function with a different abi as well as being unsafe at the same time. This extends the parser to allow functions of the form: unsafe extern fn foo() { // ... } The closure type grammar was also changed to reflect this reversal, types previously written as "extern unsafe fn()" must now be written as "unsafe extern fn()". The parser currently has a hack which allows the old style, but this will go away once a snapshot has landed. Closes #10025 [breaking-change]
2014-05-07auto merge of #13958 : pcwalton/rust/detilde, r=pcwaltonbors-5/+21
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. r? @brson or @alexcrichton or whoever
2014-05-07auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brsonbors-6/+2
Lots of assorted things here and there, all the details are in the commits. Closes #11712
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-5/+21
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-06rustc: Enable writing "unsafe extern fn() {}"Alex Crichton-14/+24
Previously, the parser would not allow you to simultaneously implement a function with a different abi as well as being unsafe at the same time. This extends the parser to allow functions of the form: unsafe extern fn foo() { // ... } The closure type grammar was also changed to reflect this reversal, types previously written as "extern unsafe fn()" must now be written as "unsafe extern fn()". The parser currently has a hack which allows the old style, but this will go away once a snapshot has landed. Closes #10025 [breaking-change]
2014-05-04auto merge of #13908 : pcwalton/rust/box-pattern, r=alexcrichtonbors-0/+13
r? @alexcrichton
2014-05-04auto merge of #13898 : nikomatsakis/rust/type-bounds-b, r=acrichtobors-4/+3
This is needed to bootstrap fix for #5723.
2014-05-03Temporary patch to accept arbitrary lifetimes (behind feature gate) in bound ↵Niko Matsakis-4/+3
lists. This is needed to bootstrap fix for #5723.
2014-05-03syntax: Fix duplicate attributes on module filesAlex Crichton-6/+2
The outer attributes were manually appended when a module file was parsed, but the attributes were also added higher up the stack of parsing (when the module finished parsing). This removes the append in parsing the module file. Closes #13826
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-1/+1
2014-05-02libsyntax: Add `box PAT` to the pattern grammar. RFC #14.Patrick Walton-0/+13
2014-04-30librustc: Remove `~"string"` and `&"string"` from the languagePatrick Walton-22/+5
2014-04-28auto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonwbors-5/+12
This PR is primarily motivated by (and fixes) #12926. We currently only have a span for the individual item itself and not for the referred contents. This normally does not cause a problem since both are located in the same file; it *is* possible that the contained statement or item is located in the other file (the syntax extension can do that), but even in that case the syntax extension should be located in the same file as the item. The module item (i.e. `mod foo;`) is the only exception here, and thus warrants a special treatment. Rustdoc would now distinguish `mod foo;` from `mod foo {...}` by checking if the span for the module item and module contents is in different files. If it's the case, we'd prefer module contents over module item. There are alternative strategies, but as noted above we will have some corner cases if we don't record the contents span explicitly.
2014-04-27syntax: `Mod` records the span for inner contents.Kang Seonghoon-5/+12
this is useful when the module item and module contents are defined from different files (like rustdoc). in most cases the original span for the module item would be used; in other cases, the span for module contents is available separately at the `inner` field.
2014-04-26syntax: ViewItemUse no longer contains multiple view paths.Kang Seonghoon-3/+3
it reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). this legacy affected many portions of rustc and rustdoc as well, so this commit cleans them up altogether.
2014-04-24auto merge of #13713 : edwardw/rust/methodcall-span, r=alexcrichtonbors-2/+8
Specifically, the method parameter cardinality mismatch or missing method error message span now gets method itself exactly. It was the whole expression. Closes #9390 Closes #13684 Closes #13709
2014-04-23Allow attributes on match armsSteven Fackler-1/+7
RFC: 0008-match-arm-attributes
2014-04-24Calibrate span for method call error messagesEdward Wang-2/+8
Specifically, the method parameter cardinality mismatch or missing method error message span now gets method itself exactly. It was the whole expression. Closes #9390 Closes #13684 Closes #13709
2014-04-23Support unsized types with the `type` keywordNick Cameron-3/+24
2014-04-23Add a span to ast::TyParamNick Cameron-1/+3
2014-04-21auto merge of #13435 : edwardw/rust/span, r=brsonbors-13/+11
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-20Allow inheritance between structs.Nick Cameron-5/+30
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-18Use more precise span when reporting semicolon hintEdward Wang-13/+11
When reporting "consider removing this semicolon" hint message, the offending semicolon may come from macro call site instead of macro itself. Using the more appropriate span makes the hint more helpful. Closes #13428.
2014-04-17syntax: Parses `&&` as `& &` whenever appropriate.Kang Seonghoon-38/+54
Closes #11227.
2014-04-16rustc: Remove private enum variantsAlex Crichton-6/+1
This removes the `priv` keyword from the language and removes private enum variants as a result. The remaining use cases of private enum variants were all updated to be a struct with one private field that is a private enum. RFC: 0006-remove-priv Closes #13535
2014-04-11syntax: remove ast::Sigil.Eduard Burtescu-26/+6
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-4/+5
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it. Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269