Skip to content

Commit ea2b02d

Browse files
committed
---
yaml --- r: 148917 b: refs/heads/try2 c: fc1d655 h: refs/heads/master i: 148915: 8df1dcf v: v3
1 parent 99dc7db commit ea2b02d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+306
-1081
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 6aad3bf944da209d1852c51144ba584de400a10c
8+
refs/heads/try2: fc1d655ed29a6ead06dfccece1b585e2c4212e16
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,25 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate arena glob term semver uuid serialize sync
52+
TARGET_CRATES := std extra green rustuv native flate arena glob term semver uuid sync
5353
HOST_CRATES := syntax rustc rustdoc
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustdoc rustc
5656

5757
DEPS_std := native:rustrt
58-
DEPS_extra := std serialize sync term
58+
DEPS_extra := std term sync
5959
DEPS_green := std
6060
DEPS_rustuv := std native:uv native:uv_support
6161
DEPS_native := std
62-
DEPS_syntax := std extra term serialize
63-
DEPS_rustc := syntax native:rustllvm flate arena serialize sync
64-
DEPS_rustdoc := rustc native:sundown serialize sync
62+
DEPS_syntax := std extra term
63+
DEPS_rustc := syntax native:rustllvm flate arena sync
64+
DEPS_rustdoc := rustc native:sundown sync
6565
DEPS_flate := std native:miniz
6666
DEPS_arena := std extra
6767
DEPS_glob := std
68-
DEPS_serialize := std
6968
DEPS_term := std
7069
DEPS_semver := std
71-
DEPS_uuid := std serialize
70+
DEPS_uuid := std extra
7271
DEPS_sync := std
7372

7473
TOOL_DEPS_compiletest := extra green rustuv

branches/try2/src/doc/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ li {list-style-type: none; }
4141
* [The `flate` compression library](flate/index.html)
4242
* [The `glob` file path matching library](glob/index.html)
4343
* [The `semver` version collation library](semver/index.html)
44-
* [The `serialize` value encoding/decoding library](serialize/index.html)
45-
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
4644
* [The `term` terminal-handling library](term/index.html)
47-
* [The `uuid` 128-bit universally unique identifier library](uuid/index.html)
45+
* [The UUID library](uuid/index.html)
46+
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
4847

4948
# Tooling
5049

branches/try2/src/etc/snapshot.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,30 @@ def in_tar_name(fn):
195195

196196
return file1
197197

198-
def determine_curr_snapshot_info(triple):
198+
def curr_snapshot_rev():
199+
i = 0
200+
found_snap = False
201+
date = None
202+
rev = None
203+
204+
f = open(snapshotfile)
205+
for line in f.readlines():
206+
i += 1
207+
parsed = parse_line(i, line)
208+
if (not parsed): continue
209+
210+
if parsed["type"] == "snapshot":
211+
date = parsed["date"]
212+
rev = parsed["rev"]
213+
found_snap = True
214+
break
215+
216+
if not found_snap:
217+
raise Exception("no snapshot entries in file")
218+
219+
return (date, rev)
220+
221+
def determine_curr_snapshot(triple):
199222
i = 0
200223
platform = get_platform(triple)
201224

@@ -228,7 +251,4 @@ def determine_curr_snapshot_info(triple):
228251
raise Exception("no snapshot file found for platform %s, rev %s" %
229252
(platform, rev))
230253

231-
return (date, rev, platform, hsh)
232-
233-
def determine_curr_snapshot(triple):
234-
return full_snapshot_name(*determine_curr_snapshot_info(triple))
254+
return full_snapshot_name(date, rev, platform, hsh)

branches/try2/src/etc/tidy.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ def do_license_check(name, contents):
5757
match = re.match(r'^.*//\s*SNAP\s+(\w+)', line)
5858
if match:
5959
hsh = match.group(1)
60-
a, b, c, phash = snapshot.determine_curr_snapshot_info()
61-
if not phash.startswith(hsh):
62-
report_err("Snapshot out of date: " + line)
60+
date, rev = snapshot.curr_snapshot_rev()
61+
if not hsh.startswith(rev):
62+
report_err("snapshot out of date (" + date
63+
+ "): " + line)
6364
else:
6465
if "SNAP" in line:
65-
report_warn("Unmatched SNAP line: " + line)
66+
report_warn("unmatched SNAP line: " + line)
6667

6768
if (line.find('\t') != -1 and
6869
fileinput.filename().find("Makefile") == -1):

branches/try2/src/libextra/dlist.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ use std::iter;
3030

3131
use container::Deque;
3232

33-
use serialize::{Encodable, Decodable, Encoder, Decoder};
34-
3533
/// A doubly-linked list.
3634
pub struct DList<T> {
3735
priv length: uint,
@@ -630,31 +628,6 @@ impl<A: Clone> Clone for DList<A> {
630628
}
631629
}
632630

633-
impl<
634-
S: Encoder,
635-
T: Encodable<S>
636-
> Encodable<S> for DList<T> {
637-
fn encode(&self, s: &mut S) {
638-
s.emit_seq(self.len(), |s| {
639-
for (i, e) in self.iter().enumerate() {
640-
s.emit_seq_elt(i, |s| e.encode(s));
641-
}
642-
})
643-
}
644-
}
645-
646-
impl<D:Decoder,T:Decodable<D>> Decodable<D> for DList<T> {
647-
fn decode(d: &mut D) -> DList<T> {
648-
let mut list = DList::new();
649-
d.read_seq(|d, len| {
650-
for i in range(0u, len) {
651-
list.push_back(d.read_seq_elt(i, |d| Decodable::decode(d)));
652-
}
653-
});
654-
list
655-
}
656-
}
657-
658631
#[cfg(test)]
659632
mod tests {
660633
use container::Deque;

branches/try2/src/libserialize/ebml.rs renamed to branches/try2/src/libextra/ebml.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,15 @@ pub enum EbmlEncoderTag {
8383

8484
pub mod reader {
8585
use std::char;
86+
use super::*;
87+
88+
use serialize;
8689

8790
use std::cast::transmute;
8891
use std::int;
8992
use std::option::{None, Option, Some};
9093
use std::io::extensions::u64_from_be_bytes;
9194

92-
use serialize;
93-
94-
use super::{ EsVec, EsMap, EsEnum, EsVecLen, EsVecElt, EsMapLen, EsMapKey,
95-
EsEnumVid, EsU64, EsU32, EsU16, EsU8, EsInt, EsI64, EsI32, EsI16, EsI8,
96-
EsBool, EsF64, EsF32, EsChar, EsStr, EsMapVal, EsEnumBody, EsUint,
97-
EsOpaque, EsLabel, EbmlEncoderTag, Doc, TaggedDoc };
98-
9995
// ebml reading
10096

10197
pub struct Res {
@@ -592,20 +588,15 @@ pub mod reader {
592588
}
593589

594590
pub mod writer {
591+
use super::*;
592+
595593
use std::cast;
596594
use std::clone::Clone;
597595
use std::io;
598596
use std::io::{Writer, Seek};
599597
use std::io::MemWriter;
600598
use std::io::extensions::u64_to_be_bytes;
601599

602-
use super::{ EsVec, EsMap, EsEnum, EsVecLen, EsVecElt, EsMapLen, EsMapKey,
603-
EsEnumVid, EsU64, EsU32, EsU16, EsU8, EsInt, EsI64, EsI32, EsI16, EsI8,
604-
EsBool, EsF64, EsF32, EsChar, EsStr, EsMapVal, EsEnumBody, EsUint,
605-
EsOpaque, EsLabel, EbmlEncoderTag };
606-
607-
use serialize;
608-
609600
// ebml writing
610601
pub struct Encoder<'a> {
611602
// FIXME(#5665): this should take a trait object. Note that if you
@@ -784,7 +775,7 @@ pub mod writer {
784775
}
785776
}
786777

787-
impl<'a> serialize::Encoder for Encoder<'a> {
778+
impl<'a> ::serialize::Encoder for Encoder<'a> {
788779
fn emit_nil(&mut self) {}
789780

790781
fn emit_uint(&mut self, v: uint) {
@@ -961,7 +952,8 @@ pub mod writer {
961952
mod tests {
962953
use ebml::reader;
963954
use ebml::writer;
964-
use {Encodable, Decodable};
955+
use serialize::Encodable;
956+
use serialize;
965957

966958
use std::io::MemWriter;
967959
use std::option::{None, Option, Some};
@@ -1025,7 +1017,7 @@ mod tests {
10251017
}
10261018
let ebml_doc = reader::Doc(wr.get_ref());
10271019
let mut deser = reader::Decoder(ebml_doc);
1028-
let v1 = Decodable::decode(&mut deser);
1020+
let v1 = serialize::Decodable::decode(&mut deser);
10291021
debug!("v1 == {:?}", v1);
10301022
assert_eq!(v, v1);
10311023
}
@@ -1039,7 +1031,7 @@ mod tests {
10391031
#[cfg(test)]
10401032
mod bench {
10411033
use ebml::reader;
1042-
use extra::test::BenchHarness;
1034+
use test::BenchHarness;
10431035

10441036
#[bench]
10451037
pub fn vuint_at_A_aligned(bh: &mut BenchHarness) {

branches/try2/src/libextra/json.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@ A simple JSON document encoding a person, his/her age, address and phone numbers
5151
5252
Rust provides a mechanism for low boilerplate encoding & decoding
5353
of values to and from JSON via the serialization API.
54-
To be able to encode a piece of data, it must implement the `serialize::Encodable` trait.
55-
To be able to decode a piece of data, it must implement the `serialize::Decodable` trait.
54+
To be able to encode a piece of data, it must implement the `extra::serialize::Encodable` trait.
55+
To be able to decode a piece of data, it must implement the `extra::serialize::Decodable` trait.
5656
The Rust compiler provides an annotation to automatically generate
5757
the code for these traits: `#[deriving(Decodable, Encodable)]`
5858
5959
To encode using Encodable :
6060
6161
```rust
62-
extern mod serialize;
6362
use extra::json;
6463
use std::io;
65-
use serialize::Encodable;
64+
use extra::serialize::Encodable;
6665
6766
#[deriving(Encodable)]
6867
pub struct TestStruct {
@@ -126,8 +125,7 @@ fn main() {
126125
To decode a json string using `Decodable` trait :
127126
128127
```rust
129-
extern mod serialize;
130-
use serialize::Decodable;
128+
use extra::serialize::Decodable;
131129
132130
#[deriving(Decodable)]
133131
pub struct MyStruct {
@@ -152,9 +150,8 @@ Create a struct called TestStruct1 and serialize and deserialize it to and from
152150
using the serialization API, using the derived serialization code.
153151
154152
```rust
155-
extern mod serialize;
156153
use extra::json;
157-
use serialize::{Encodable, Decodable};
154+
use extra::serialize::{Encodable, Decodable};
158155
159156
#[deriving(Decodable, Encodable)] //generate Decodable, Encodable impl.
160157
pub struct TestStruct1 {
@@ -184,10 +181,9 @@ This example use the ToJson impl to unserialize the json string.
184181
Example of `ToJson` trait implementation for TestStruct1.
185182
186183
```rust
187-
extern mod serialize;
188184
use extra::json;
189185
use extra::json::ToJson;
190-
use serialize::{Encodable, Decodable};
186+
use extra::serialize::{Encodable, Decodable};
191187
use extra::treemap::TreeMap;
192188
193189
#[deriving(Decodable, Encodable)] // generate Decodable, Encodable impl.
@@ -316,7 +312,7 @@ impl<'a> Encoder<'a> {
316312
}
317313

318314
/// Encode the specified struct into a json [u8]
319-
pub fn buffer_encode<T:serialize::Encodable<Encoder<'a>>>(to_encode_object: &T) -> ~[u8] {
315+
pub fn buffer_encode<T:Encodable<Encoder<'a>>>(to_encode_object: &T) -> ~[u8] {
320316
//Serialize the object in a string using a writer
321317
let mut m = MemWriter::new();
322318
{
@@ -327,7 +323,7 @@ impl<'a> Encoder<'a> {
327323
}
328324

329325
/// Encode the specified struct into a json str
330-
pub fn str_encode<T:serialize::Encodable<Encoder<'a>>>(to_encode_object: &T) -> ~str {
326+
pub fn str_encode<T:Encodable<Encoder<'a>>>(to_encode_object: &T) -> ~str {
331327
let buff:~[u8] = Encoder::buffer_encode(to_encode_object);
332328
str::from_utf8_owned(buff).unwrap()
333329
}
@@ -688,7 +684,7 @@ impl<E: serialize::Encoder> serialize::Encodable<E> for Json {
688684
}
689685
}
690686

691-
impl Json {
687+
impl Json{
692688
/// Encodes a json value into a io::writer. Uses a single line.
693689
pub fn to_writer(&self, wr: &mut io::Writer) -> io::IoResult<()> {
694690
let mut encoder = Encoder::new(wr);

branches/try2/src/libextra/lib.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ Rust extras are part of the standard Rust distribution.
3535
#[deny(missing_doc)];
3636

3737
extern mod sync;
38-
#[cfg(not(stage0))]
39-
extern mod serialize;
40-
41-
#[cfg(stage0)]
42-
pub mod serialize {
43-
#[allow(missing_doc)];
44-
// Temp re-export until after a snapshot
45-
extern mod serialize = "serialize";
46-
pub use self::serialize::{Encoder, Decoder, Encodable, Decodable,
47-
EncoderHelpers, DecoderHelpers};
48-
}
4938

5039
#[cfg(stage0)]
5140
macro_rules! if_ok (
@@ -73,6 +62,7 @@ pub mod lru_cache;
7362
// And ... other stuff
7463

7564
pub mod url;
65+
pub mod ebml;
7666
pub mod getopts;
7767
pub mod json;
7868
pub mod tempfile;
@@ -95,6 +85,7 @@ mod unicode;
9585
// Compiler support modules
9686

9787
pub mod test;
88+
pub mod serialize;
9889

9990
// A curious inner-module that's not exported that contains the binding
10091
// 'extra' so that macro-expanded references to extra::serialize and such

branches/try2/src/libextra/ringbuf.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use std::iter::{Rev, RandomAccessIterator};
1919

2020
use container::Deque;
2121

22-
use serialize::{Encodable, Decodable, Encoder, Decoder};
23-
2422
static INITIAL_CAPACITY: uint = 8u; // 2^3
2523
static MINIMUM_CAPACITY: uint = 2u;
2624

@@ -404,31 +402,6 @@ impl<A> Extendable<A> for RingBuf<A> {
404402
}
405403
}
406404

407-
impl<
408-
S: Encoder,
409-
T: Encodable<S>
410-
> Encodable<S> for RingBuf<T> {
411-
fn encode(&self, s: &mut S) {
412-
s.emit_seq(self.len(), |s| {
413-
for (i, e) in self.iter().enumerate() {
414-
s.emit_seq_elt(i, |s| e.encode(s));
415-
}
416-
})
417-
}
418-
}
419-
420-
impl<D:Decoder,T:Decodable<D>> Decodable<D> for RingBuf<T> {
421-
fn decode(d: &mut D) -> RingBuf<T> {
422-
let mut deque = RingBuf::new();
423-
d.read_seq(|d, len| {
424-
for i in range(0u, len) {
425-
deque.push_back(d.read_seq_elt(i, |d| Decodable::decode(d)));
426-
}
427-
});
428-
deque
429-
}
430-
}
431-
432405
#[cfg(test)]
433406
mod tests {
434407
use container::Deque;

0 commit comments

Comments
 (0)