Commit Graph

896 Commits

Author SHA1 Message Date
Erick Tryzelaar
9da641bd8c libsyntax: convert interner into a modern struct 2013-02-19 10:02:50 -08:00
bors
6351515d98 auto merge of #5005 : alexcrichton/rust/bitv++, r=catamorphism
These commits take the old bitv implementation and modernize it with an explicit self, some minor touchups, and using what I think is some more recent patterns (like `::new` instead of `Type()`).

Additionally, this adds an implementation of `container::Set` on top of a bit vector to have as a set of `uint`s. I initially tried to parameterize the type for the set to be `T: NumCast` but I was hitting build problems in stage0 which I think means that it's not in a snapshot yet, so it's just hardcoded as a set of `uint`s now. In the future perhaps it could be parameterized. I'm not sure if it would really add anything, though, so maybe it's nicer to be hardcoded anyway.

I also added some extra methods to do normal bit vector operations on the set in-place, but these aren't a part of the `Set` trait right now. I haven't benchmarked any of these operations just yet, but I imagine that there's quite a lot of room for optimization here and there.
2013-02-18 18:40:33 -08:00
bors
9ba2e65fd6 auto merge of #5004 : luqmana/rust/rename-use-import, r=catamorphism
Seems like my previous pull request got lost along the way somehow. So here it is updated.
2013-02-18 17:48:34 -08:00
Alex Crichton
91fae27912 Modernize bitv mut fields and explicit self 2013-02-17 23:09:20 -05:00
Luqman Aden
0f09c106f0 libsyntax: Update view_item_use/import to reflect actual usage 2013-02-17 21:45:00 -05:00
Luqman Aden
baeac2f9ac libsyntax: Long lines. 2013-02-17 05:25:26 -05:00
Luqman Aden
de57bacf43 libsyntax: Explicit-self-ify pipes compiler. 2013-02-17 05:25:26 -05:00
Luqman Aden
0126af3144 libsyntax: Remove last use of structural records in pipes compiler. 2013-02-17 05:25:26 -05:00
bors
9ea05a4d3e auto merge of #4978 : z0w0/rust/issue-607, r=graydon 2013-02-16 22:39:29 -08:00
Zack Corr
fe9f1d155a syntax: Implement recursive sorting of meta items. Closes #607 2013-02-17 00:31:57 +10:00
Niko Matsakis
6c728e32c0 Parse (and discard) lifetime declarations on function types 2013-02-16 08:03:58 -05:00
Niko Matsakis
c7f85003a3 Permit lifetimes to appear in type parameter lists and after &. Lifetimes in
type parameter lists are currently ignored, but `&'a T` is equivalent to
`&a/T`.
2013-02-16 08:01:10 -05:00
Patrick Walton
bb833ca0f0 librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc 2013-02-15 16:59:56 -08:00
bors
566bcf2225 auto merge of #4969 : nickdesaulniers/rust/issue3869, r=brson
Issue #3869
review? @nikomatsakis 

Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
Fix windows build error.  `buf` is borrowed by the call to
`as_mut_buf()` and so we must invoke `slice()` outside of that
call.
2013-02-15 13:54:49 -08:00
Luqman Aden
3a19eef496 libsyntax: Remove move as a keyword. 2013-02-15 02:49:55 -08:00
Luqman Aden
e244f103c9 libsyntax: Get rid of uses of move and don't parse it. 2013-02-15 02:49:55 -08:00
bors
172c29fe0a auto merge of #4941 : nickdesaulniers/rust/issue4524cleanup, r=catamorphism
review? @brson
Issue #4524
2013-02-14 21:12:06 -08:00
Nick Desaulniers
13fe167dbb remove die definition and use in doc tests 2013-02-14 17:33:16 -08:00
bors
af2f0ef088 auto merge of #4927 : sanxiyn/rust/remove-dvec, r=catamorphism 2013-02-14 17:23:18 -08:00
bors
bf27352953 auto merge of #4911 : lifthrasiir/rust/comment-exemptions, r=catamorphism
This is a natural extension of #4887, and handles the following three cases:

~~~~
a line with only /s
////////////////////////////////////////////

a line with only /s followed by whitespace
////////////////////////////////////////////         

a block comment with only *s between two /s
/********************************/
~~~~
2013-02-14 16:34:38 -08:00
Nick Desaulniers
5d62a4a52e Convert all uses of vec::slice to vec::view Issue #3869
Rename const_view to const_slice
Renamed mut_view to mut_slice
2013-02-14 16:14:32 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Seo Sanghyeon
7a6db3f982 Remove DVec from syntax::parse 2013-02-14 22:14:59 +09:00
bors
6efa3543a8 auto merge of #4922 : jbclements/rust/add-deriving-eq-to-asts, r=catamorphism
r?

Apply deriving_eq to the data structures in ast.rs, and get rid of the custom definitions of eq that were everywhere. resulting ast.rs is about 400 lines shorter.

Also: add a few test cases and a bunch of comments.

Also: change ast_ty_to_ty_cache to use node ids rather than ast::ty's. I believe this was a suggestion related to my changes, and it appears to pass all tests.

Also: tiny doc fix, remove references to crate keywords.
2013-02-13 18:49:29 -08:00
Nick Desaulniers
4445b38df2 Remove die!, raplace invocations with fail! Issue #4524 pt 3 2013-02-13 17:01:32 -08:00
John Clements
f9d789fa08 cleanup, fix test case 2013-02-13 15:38:42 -08:00
Patrick Walton
754718c910 libsyntax: Pretty print using the new impl syntax. r=brson 2013-02-13 15:23:48 -08:00
John Clements
9d962d8466 add test case 2013-02-13 15:08:27 -08:00
John Clements
ded95d2c28 deriving_eq for tokens and binops
Note that the replaced definition of equality on tokens
contains a *huge* shortcut on INTERPOLATED tokens (those
that contain ASTs), whereby any two INTERPOLATED tokens
are considered equal. This seems like a really broken
notion of equality, but it appears that the existing
test cases and the compiler don't depend on it. Niko
noticed this, BTW.

Replace long definition of Eq on tokens and binops
w
2013-02-13 15:08:27 -08:00
John Clements
0419e36b76 finish deriving_eq in ast 2013-02-13 15:08:27 -08:00
John Clements
819c6d1c04 deriving-eq all over ast 2013-02-13 15:08:27 -08:00
John Clements
17d3a55362 @mut fix 2013-02-13 15:08:27 -08:00
John Clements
25c4676dfa Commenting, test cases, cleanup 2013-02-13 15:08:27 -08:00
bors
5e6d7871c6 auto merge of #4840 : jbclements/rust/add-json-enum-encoding, r=catamorphism
r?

I added code to the JSON encoder to support the serialization of enums.  Before this, the JSON serializer only handled Option, and encoded None as 'null'. Following this change, all enums are encoded as arrays containing the enum name followed by the encoded fields. This appears consistent with the unstated invariant that the resulting output can be mapped back to the input *if* there's a decoder around that knows the types that were in existence when the serialization occurred.

Also, added test cases.
2013-02-13 13:18:38 -08:00
John Clements
9df11ae83f retabbing 2013-02-13 10:49:36 -08:00
Kang Seonghoon
6d98ca94cc libsyntax: don't parse ////, /***/ as doc comments 2013-02-13 11:39:13 +09:00
John Clements
46d2be1bd4 added rather elaborate test framework 2013-02-12 17:18:29 -08:00
Brian Anderson
8ed1c15845 Fix license block 2013-02-11 15:01:24 -08:00
Mikko Perttunen
ca030b4fc8 Update copyright years 2013-02-11 21:02:36 +02:00
Mikko Perttunen
f2a8a71266 Use topmost span for macro expansion location. Fixes behaviour of file!, line! and col! 2013-02-11 20:23:40 +02:00
bors
9d7014e55c auto merge of #4861 : sethpink/rust/incoming, r=catamorphism
Fix for issue #4830.
2013-02-09 18:37:02 -08:00
bors
d6442e97a5 auto merge of #4854 : thestinger/rust/oldmap, r=catamorphism 2013-02-09 15:02:51 -08:00
John Clements
394f8eeb7e tidy 2013-02-09 13:37:04 -08:00
John Clements
765961438d fix typos in sample code, add enum to json encoder, add test case 2013-02-09 13:37:04 -08:00
Seth Pink
8ebdb3d0ab Issue #4830 fix 2013-02-09 23:00:55 +10:00
Daniel Micay
d30fdbb357 libsyntax/attr.rs: switch from oldmap to LinearSet 2013-02-08 20:57:14 -05:00
Daniel Micay
a32c5c73ee oldmap: get rid of legacy _ref suffixes 2013-02-08 19:12:51 -05:00
Matthijs Hofstra
8d0c1cb406 Added related FIXME for 3260 2013-02-09 01:01:39 +01:00
Matthijs Hofstra
fd98ea8129 Fix for issue 2174
The function that formats and prints the squigly line that hilights
errors counted tabs as spaces, which resulted in incorrect error
messages when tabs were used for indentation. This change compares
the highlight line with the previous line and inserts a tab instead
of a space whenever such a tab exists on the previous line. Note
that error messages will still highlight incorrectly when the
previous line include characters that require more than one utf8
code point, as mentioned in issue 3260.
2013-02-09 00:57:39 +01:00
Niko Matsakis
14930fbffe Add and lex LIFETIME tokens
cc #4846
2013-02-08 06:02:35 -08:00