about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2014-04-30librustc: Remove `~"string"` and `&"string"` from the languagePatrick Walton-22/+5
2014-04-28auto merge of #13812 : alxgnon/rust/master, r=alexcrichtonbors-8/+5
This is a quick fix for repeated documentation descriptions in certain modules. Following is a list of the faulty modules I found. I ran `pcregrep -r -M "<p>(.+)\n\1" doc` on the html documentation to help identify them. - [rustuv::uvio](http://static.rust-lang.org/doc/master/rustuv/uvio/index.html) - [rustuv::uvll](http://static.rust-lang.org/doc/master/rustuv/uvll/index.html) - [std::rt::backtrace](http://static.rust-lang.org/doc/master/std/rt/backtrace/index.html) - [std::rt::env](http://static.rust-lang.org/doc/master/std/rt/env/index.html) - [std::rt::global_heap](http://static.rust-lang.org/doc/master/std/rt/global_heap/index.html) - [std::rt::local_heap](http://static.rust-lang.org/doc/master/std/rt/local_heap/index.html) - [std::rt::rtio](http://static.rust-lang.org/doc/master/std/rt/rtio/index.html) - [std::rt::task](http://static.rust-lang.org/doc/master/std/rt/task/index.html) - [std::rt::thread](http://static.rust-lang.org/doc/master/std/rt/thread/index.html) - [std::rt::unwind](http://static.rust-lang.org/doc/master/std/rt/unwind/index.html) - [syntax::parse::classify](http://static.rust-lang.org/doc/master/syntax/parse/classify/index.html) - [syntax::parse::common](http://static.rust-lang.org/doc/master/syntax/parse/common/index.html) After a little testing, I discovered that moving the documentation inside (`//!`) instead of outside (`///`) modules fixed the immediate problem. I went through the trouble of moving the documentation, and with this commit there are no more repeated descriptions within those faulty modules. This does not fix the underlying problem though. We should look into why having the documentation outside instead of inside caused the descriptions to be repeated. I will create a separate issue with my findings on the subject if necessary. In the meantime, this simple fix should be enough.
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-27Fix repeated module documentationAlexandre Gagnon-8/+5
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-22auto merge of #13398 : nick29581/rust/unsized-enum, r=nikomatsakisbors-3/+26
Now with proper checking of enums and allows unsized fields as the last field in a struct or variant. This PR only checks passing of unsized types and distinguishing them from sized ones. To be safe we also need to control storage. Closes issues #12969 and #13121, supersedes #13375 (all the discussion there is valid here too).
2014-04-22add support for quadruple precision floating pointDaniel Micay-3/+8
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-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-14/+12
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-19/+45
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-122/+123
2014-04-18Use more precise span when reporting semicolon hintEdward Wang-14/+12
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-16syntax: Demote `priv` to a reserved keywordAlex Crichton-18/+18
It is no longer used in rust anywhere. RFC: 0006-remove-priv
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-13auto merge of #13452 : Ryman/rust/fix_uint_as_u, r=alexcrichtonbors-6/+2
Fixes #13359.
2014-04-13libsyntax: update helper to stringify TyU* and TyI* to take into account ↵Kevin Butler-6/+2
having a value. Fixes #13359.
2014-04-11syntax: remove ast::Sigil.Eduard Burtescu-26/+6
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-38/+55
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
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-24/+24
updated associated variable and function names.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-38/+55
port all code over to use it.
2014-04-08Register new snapshotsAlex Crichton-32/+17
2014-04-06auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichtonbors-4/+5
`Reader`, `Writer`, `MemReader`, `MemWriter`, and `MultiWriter` now work with `Vec<u8>` instead of `~[u8]`. This does introduce some extra copies since `from_utf8_owned` isn't usable anymore, but I think that can't be helped until `~str`'s representation changes.
2014-04-06De-~[] Reader and WriterSteven Fackler-4/+5
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-04-06syntax: Tweak parsing lifetime bounds on closuresAlex Crichton-123/+112
In summary these are some example transitions this change makes: 'a || => ||: 'a proc:Send() => proc():Send The intended syntax for closures is to put the lifetime bound not at the front but rather in the list of bounds. Currently there is no official support in the AST for bounds that are not 'static, so this case is currently specially handled in the parser to desugar to what the AST is expecting. Additionally, this moves the bounds on procedures to the correct position, which is after the argument list. The current grammar for closures and procedures is: procedure := 'proc' [ '<' lifetime-list '>' ] '(' arg-list ')' [ ':' bound-list ] [ '->' type ] closure := [ 'unsafe' ] ['<' lifetime-list '>' ] '|' arg-list '|' [ ':' bound-list ] [ '->' type ] lifetime-list := lifetime | lifetime ',' lifetime-list arg-list := ident ':' type | ident ':' type ',' arg-list bound-list := bound | bound '+' bound-list bound := path | lifetime This does not currently handle the << ambiguity in `Option<<'a>||>`, I am deferring that to a later patch. Additionally, this removes the support for the obsolete syntaxes of ~fn and &fn. Closes #10553 Closes #10767 Closes #11209 Closes #11210 Closes #11211
2014-04-04syntax: remove obsolete mutability from ExprVec and ExprRepeat.Eduard Burtescu-5/+4
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-52/+35
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-04-02Fix fallout of requiring uint indicesAlex Crichton-2/+2
2014-03-31syntax: allow stmt/expr macro invocations to be delimited by [].Gábor Lehel-34/+22
this is useful for macros like vec! which construct containers
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-42/+38
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-26/+13
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-1/+1
2014-03-29auto merge of #13188 : FlaPer87/rust/master, r=alexcrichtonbors-27/+0
2014-03-28auto merge of #13170 : eddyb/rust/syntax-cleanup, r=alexcrichtonbors-215/+195
Removes all Cell's/RefCell's from lexer::Reader implementations and a couple @.
2014-03-29Register new snapshotFlavio Percoco-27/+0
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-4/+6
Closes #2569
2014-03-28syntax: Accept meta matchers in macrosAlex Crichton-15/+12
This removes the `attr` matcher and adds a `meta` matcher. The previous `attr` matcher is now ambiguous because it doesn't disambiguate whether it means inner attribute or outer attribute. The new behavior can still be achieved by taking an argument of the form `#[$foo:meta]` (the brackets are part of the macro pattern). Closes #13067
2014-03-28De-@ IdentInterner.Eduard Burtescu-6/+8
2014-03-28De-@ TokenTree.Eduard Burtescu-5/+6
2014-03-28Used inherited mutability in lexer::Reader.Eduard Burtescu-204/+181
2014-03-28Rename Pod into CopyFlavio Percoco-2/+2
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-27serialize: use ResultSean McArthur-1/+27
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-26auto merge of #13079 : alexcrichton/rust/colons, r=cmrbors-55/+18
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26syntax: Tweak parsing bounds on generics pathsAlex Crichton-55/+18
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26syntax: Permit visibility on tuple fieldsAlex Crichton-1/+1
This change is in preparation for #8122. Nothing is currently done with these visibility qualifiers, they are just parsed and accepted by the compiler. RFC: 0004-private-fields