bors
d31053277a
auto merge of #5586 : pcwalton/rust/expr-repeat-vstore, r=graydon
...
r? @graydon
2013-03-28 01:33:48 -07:00
bors
84ddff3909
auto merge of #5578 : erickt/rust/incoming, r=jbclements,erickt
...
Hey folks,
This patch series does some work on the json decoder, specifically with auto decoding of enums. Previously, we would take this code:
```
enum A {
B,
C(~str, uint)
}
```
and would encode a value of this enum to either `["B", []]` or `["C", ["D", 123]]`. I've changed this to `"B"` or `["C", "D", 123]`. This matches the style of the O'Caml json library [json-wheel](http://mjambon.com/json-wheel.html ). I've added tests to make sure all this work.
In order to make this change, I added passing a `&[&str]` vec to `Decode::emit_enum_variant` so the json decoder can convert the name of a variant into it's position. I also changed the impl of `Encodable` for `Option<T>` to have the right upper casing.
I also did some work on the parser, which allows for `fn foo<T: ::cmp::Eq>() { ... }` statements (#5572 ), fixed the pretty printer properly expanding `debug!("...")` expressions, and removed `ast::expr_vstore_fixed`, which doesn't appear to be used anymore.
2013-03-27 21:51:53 -07:00
Andrew Paseltiner
f02ee42a86
derive Eq and Clone impls where applicable
2013-03-27 22:04:23 -04:00
Luqman Aden
09255dbe2d
libsyntax: error on struct Foo {}.
2013-03-27 18:17:58 -07:00
Luqman Aden
b867fe41de
libsyntax: Allow selecting intel style asm.
2013-03-27 15:41:58 -07:00
Luqman Aden
203d691a6b
libsyntax: use a struct for inline asm in ast.
2013-03-27 15:41:58 -07:00
Patrick Walton
e5dda811a9
librustc: Allow expr_repeat to be used with any vstore
2013-03-27 13:53:03 -07:00
bors
995425badb
auto merge of #5558 : nikomatsakis/rust/issue-4920-autoref-index-operator, r=nikomatsakis
...
Per discussion on IRC.
r? @pcwalton
2013-03-27 13:27:58 -07:00
Niko Matsakis
2a74fda316
Fix pretty-printer test failure by carrying the bound lifetime names through
...
the types. Initially I thought it would be necessary to thread this data
through not only the AST but the types themselves, but then I remembered that
the pretty printer only cares about the AST. Regardless, I have elected to
leave the changes to the types intact since they will eventually be needed. I
left a few FIXMEs where it didn't seem worth finishing up since the code wasn't
crucial yet.
2013-03-27 11:35:04 -07:00
Erick Tryzelaar
83e831bc22
syntax: Remove deprecated expr_vstore_fixed
2013-03-27 07:04:16 -07:00
Erick Tryzelaar
7a199d41a9
syntax: fix pretty printing __log stmts
2013-03-27 07:04:15 -07:00
Erick Tryzelaar
2e0b363a7f
syntax: Remove dead code from the parser
2013-03-27 07:04:15 -07:00
Erick Tryzelaar
b26ae289d0
syntax: Fix parsing global generics ( Closes #5572 )
2013-03-27 07:04:14 -07:00
Erick Tryzelaar
4d6dcefcbb
std: Decode::read_enum_variant should pass in the variant names
...
Because the json::Decoder uses the string variant name, we need a
way to correlate the string to the enum index. This passes in a
static &[&str] to read_enum_variant, which allows the json::Decoder
to know which branch it's trying to process.
2013-03-27 07:04:13 -07:00
Erick Tryzelaar
478e4498b7
std: add option type directly to serialize::{En,De}code
2013-03-27 07:04:12 -07:00
Erick Tryzelaar
4d995e66a2
std: change default json enum encoder to use strings or a flat vec
2013-03-27 07:04:12 -07:00
Erick Tryzelaar
b10b8c3ee4
std: Add tests for json decoding options
2013-03-27 07:04:11 -07:00
Erick Tryzelaar
bd77e9433f
syntax: pass some values around by reference
2013-03-27 07:01:45 -07:00
Erick Tryzelaar
2f1ab3a7fa
syntax: Add new values that can be used with the quasiquoter
2013-03-27 06:49:39 -07:00
Niko Matsakis
2c17ff7dbc
Simplify and remove unnecessary use of ast_map
2013-03-27 07:10:04 -04:00
Niko Matsakis
aa67deff33
remove sty_by_ref, though traces still remain due to dtors
2013-03-27 07:09:16 -04:00
Patrick Walton
0a4d0f37ca
librustc: Enforce that extern mod
directives come first, then use
directives, then items.
...
Resolve them in this order as well.
2013-03-26 21:30:17 -07:00
Patrick Walton
8b56a8380b
librustc: Modify all code to use new lifetime binder syntax
2013-03-26 21:30:17 -07:00
Patrick Walton
a376f46862
librustc: Stop parsing [T * N]
.
2013-03-26 21:29:35 -07:00
Patrick Walton
142dbd65da
librustc: Remove all uses of the old [T * N]
fixed-length vector syntax
2013-03-26 21:29:34 -07:00
Patrick Walton
46d4cc12d1
libsyntax: Stop parsing [const T]
.
2013-03-26 21:29:34 -07:00
Daniel Micay
34c5a09ce3
option: rm functions that duplicate methods
2013-03-26 22:44:40 -04:00
Alex Crichton
dbe1354321
Move ast_map::map to LinearMap
2013-03-26 19:21:05 -04:00
Alex Crichton
e4c3d805a4
syntax: Removing uses of HashMap
2013-03-26 19:20:02 -04:00
Alex Crichton
fa7772893a
Remove unused imports throughout
2013-03-26 19:20:02 -04:00
bors
3d588c5286
auto merge of #5555 : Kimundi/rust/str-dealloc-3, r=catamorphism
...
- Most functions that used to return `~[~str]` for a list of substrings got turned into iterators over `&str` slices
- Some cleanup of apis, docs and code layout
2013-03-26 15:07:07 -07:00
Niko Matsakis
e11d13f3de
Rip out old code that still structured method calls as a
...
expr_call(expr_field(...)) rather than an expr_method_call.
There is probably more such code in trans that should be removed.
2013-03-26 15:16:58 -04:00
Marvin Löbel
b9de2b5787
Switched over a bunch of splitting funktions to non-allocating iterators
2013-03-26 14:59:17 +01:00
Seo Sanghyeon
585c57234f
rustdoc: Show purity
2013-03-25 15:02:42 +09:00
Patrick Walton
8aee0a6a29
libsyntax: Fix static
in pretty printer. rs=burningtree
2013-03-23 10:28:24 -07:00
Patrick Walton
e2fde83ce4
libsyntax: Stop parsing old lifetime syntax
2013-03-22 22:24:36 -07:00
Patrick Walton
6d81307a9b
librustc: Add explicit lifetime binders and new lifetime notation in core/std/syntax/rustc
2013-03-22 22:24:35 -07:00
Patrick Walton
68cb53672b
libsyntax: Stop parsing const
.
2013-03-22 22:24:35 -07:00
Patrick Walton
85c9fc6f8f
librustc: Remove the const
declaration form everywhere
2013-03-22 22:24:35 -07:00
Patrick Walton
eba3367404
libsyntax: Introduce the new assert!
macro; make assert
no longer a keyword
2013-03-22 22:24:34 -07:00
Patrick Walton
fa70709e07
libsyntax: Stop parsing pure
and static
2013-03-22 22:24:33 -07:00
bors
e9b077c0e9
auto merge of #5488 : pcwalton/rust/depure, r=pcwalton
2013-03-22 13:00:56 -07:00
Patrick Walton
e7c60c141b
librustc: Remove pure
from libsyntax and librustc.
2013-03-22 12:57:27 -07:00
bors
b6f9aa1fd7
auto merge of #5483 : pcwalton/rust/static-syntax, r=graydon
...
r? @nikomatsakis
2013-03-22 11:21:48 -07:00
Patrick Walton
4634f7edae
librustc: Remove all uses of static
from functions. rs=destatic
2013-03-22 10:27:39 -07:00
Alex Crichton
e93654c96d
Pass the fmt! buffer to each conversion method
...
Achieves a little more speedup and avoids allocations around some strings in
conv_str
2013-03-22 11:49:45 -04:00
Alex Crichton
1a0d212dd9
Build up the result of fmt! in a buffer instead of a vector
2013-03-22 11:49:45 -04:00
Andrew Paseltiner
999e7ef9a9
syntax: make old #[deriving_foo]
attribute obsolete
2013-03-22 07:15:13 -04:00
Andrew Paseltiner
e2abecd3ab
syntax: replace uses of old deriving attribute with new one
2013-03-22 06:30:59 -04:00
bors
d52408d46a
auto merge of #5480 : pcwalton/rust/at-const, r=pcwalton
...
r? @catamorphism
2013-03-21 20:39:51 -07:00