Skip to content

Commit 45a74f0

Browse files
committed
---
yaml --- r: 80598 b: refs/heads/auto c: 876cb76 h: refs/heads/master v: v3
1 parent e16e8bf commit 45a74f0

File tree

21 files changed

+206
-391
lines changed

21 files changed

+206
-391
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 2f96c22a21299cfe5860b0bb6fdd1af8ac500b11
16+
refs/heads/auto: 876cb76f1be63da0756a106ba743a617a5dfb2c8
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ CSREQ$(1)_T_$(2)_H_$(3) = \
442442
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
443443
$$(HBIN$(1)_H_$(3))/rustpkg$$(X_$(3)) \
444444
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
445+
$$(HBIN$(1)_H_$(3))/rustdoc_ng$$(X_$(3)) \
445446
$$(HBIN$(1)_H_$(3))/rusti$$(X_$(3)) \
446447
$$(HBIN$(1)_H_$(3))/rust$$(X_$(3)) \
447448
$$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTPKG_$(3)) \

branches/auto/mk/clean.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ clean$(1)_H_$(2):
6868
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustpkg$(X_$(2))
6969
$(Q)rm -f $$(HBIN$(1)_H_$(2))/serializer$(X_$(2))
7070
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustdoc$(X_$(2))
71+
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustdoc_ng$(X_$(2))
7172
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rusti$(X_$(2))
7273
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rust$(X_$(2))
7374
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTPKG_$(2))
@@ -105,6 +106,7 @@ clean$(1)_T_$(2)_H_$(3):
105106
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustpkg$(X_$(2))
106107
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/serializer$(X_$(2))
107108
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustdoc$(X_$(2))
109+
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustdoc_ng$(X_$(2))
108110
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rusti$(X_$(2))
109111
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rust$(X_$(2))
110112
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTPKG_$(2))

branches/auto/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ PKG_FILES := \
3939
libsyntax \
4040
rt \
4141
librustdoc \
42+
rustdoc_ng \
4243
rustllvm \
4344
snapshots.txt \
4445
test) \

branches/auto/mk/install.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
140140
$(Q)$(call INSTALL,$(HB2),$(PHB),rustc$(X_$(CFG_BUILD_TRIPLE)))
141141
$(Q)$(call INSTALL,$(HB2),$(PHB),rustpkg$(X_$(CFG_BUILD_TRIPLE)))
142142
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD_TRIPLE)))
143+
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc_ng$(X_$(CFG_BUILD_TRIPLE)))
143144
$(Q)$(call INSTALL,$(HB2),$(PHB),rusti$(X_$(CFG_BUILD_TRIPLE)))
144145
$(Q)$(call INSTALL,$(HB2),$(PHB),rust$(X_$(CFG_BUILD_TRIPLE)))
145146
$(Q)$(call INSTALL_LIB,$(STDLIB_GLOB_$(CFG_BUILD_TRIPLE)))
@@ -171,6 +172,7 @@ uninstall:
171172
$(Q)rm -f $(PHB)/rusti$(X_$(CFG_BUILD_TRIPLE))
172173
$(Q)rm -f $(PHB)/rust$(X_$(CFG_BUILD_TRIPLE))
173174
$(Q)rm -f $(PHB)/rustdoc$(X_$(CFG_BUILD_TRIPLE))
175+
$(Q)rm -f $(PHB)/rustdoc_ng$(X_$(CFG_BUILD_TRIPLE))
174176
$(Q)rm -f $(PHL)/$(CFG_RUSTLLVM_$(CFG_BUILD_TRIPLE))
175177
$(Q)rm -f $(PHL)/$(CFG_RUNTIME_$(CFG_BUILD_TRIPLE))
176178
$(Q)for i in \
@@ -180,6 +182,7 @@ uninstall:
180182
$(call HOST_LIB_FROM_HL_GLOB,$(LIBSYNTAX_GLOB_$(CFG_BUILD_TRIPLE))) \
181183
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTPKG_GLOB_$(CFG_BUILD_TRIPLE))) \
182184
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTDOC_GLOB_$(CFG_BUILD_TRIPLE))) \
185+
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTDOCNG_GLOB_$(CFG_BUILD_TRIPLE))) \
183186
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUSTI_GLOB_$(CFG_BUILD_TRIPLE))) \
184187
$(call HOST_LIB_FROM_HL_GLOB,$(LIBRUST_GLOB_$(CFG_BUILD_TRIPLE))) \
185188
; \

branches/auto/mk/tests.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# The names of crates that must be tested
1717
TEST_TARGET_CRATES = std extra
18-
TEST_HOST_CRATES = rust rusti rustpkg rustc rustdoc syntax
18+
TEST_HOST_CRATES = rust rusti rustpkg rustc rustdoc rustdocng syntax
1919
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2020

2121
# Markdown files under doc/ that should have their code extracted and run
@@ -393,6 +393,14 @@ $(3)/stage$(1)/test/rustdoctest-$(2)$$(X_$(2)): \
393393
@$$(call E, compile_and_link: $$@)
394394
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
395395

396+
$(3)/stage$(1)/test/rustdocngtest-$(2)$$(X_$(2)): \
397+
$$(RUSTDOCNG_LIB) $$(RUSTDOCNG_INPUTS) \
398+
$$(SREQ$(1)_T_$(2)_H_$(3)) \
399+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX_$(2)) \
400+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2))
401+
@$$(call E, compile_and_link: $$@)
402+
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
403+
396404
endef
397405

398406
$(foreach host,$(CFG_HOST_TRIPLES), \

branches/auto/mk/tools.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
2525

2626
# rustdoc_ng, the next generation documentation tool
2727

28-
RUSTDOCNG_LIB := $(S)src/rustdoc_ng/lib.rs
28+
RUSTDOCNG_LIB := $(S)src/rustdoc_ng/rustdoc_ng.rs
2929
RUSTDOCNG_INPUTS := $(wildcard $(S)src/rustdoc_ng/*.rs)
3030

3131
# Rusti, the JIT REPL
@@ -208,6 +208,14 @@ $$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTDOCNG_$(4)): \
208208
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTDOCNG_DSYM_GLOB_$(4))) \
209209
$$(HLIB$(2)_H_$(4))
210210

211+
$$(HBIN$(2)_H_$(4))/rustdoc_ng$$(X_$(4)): \
212+
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc_ng$$(X_$(4)) \
213+
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTDOCNG_$(4)) \
214+
$$(HSREQ$(2)_H_$(4)) \
215+
| $$(HBIN$(2)_H_$(4))/
216+
@$$(call E, cp: $$@)
217+
$$(Q)cp $$< $$@
218+
211219
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTI_$(4)): \
212220
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)) \
213221
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTC_$(4)) \

branches/auto/src/driver/driver.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ extern mod this(name = "rust");
2323
#[cfg(rustc)]
2424
extern mod this(name = "rustc");
2525

26+
#[cfg(rustdoc_ng)]
27+
extern mod this(name = "rustdoc_ng");
28+
2629
fn main() { this::main() }

branches/auto/src/libextra/json.rs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,18 @@ impl serialize::Encoder for Encoder {
135135
_id: uint,
136136
cnt: uint,
137137
f: &fn(&mut Encoder)) {
138-
// enums are encoded as strings or objects
138+
// enums are encoded as strings or vectors:
139139
// Bunny => "Bunny"
140-
// Kangaroo(34,"William") => {"variant": "Kangaroo", "fields": [34,"William"]}
140+
// Kangaroo(34,"William") => ["Kangaroo",[34,"William"]]
141+
141142
if cnt == 0 {
142143
self.wr.write_str(escape_str(name));
143144
} else {
144-
self.wr.write_char('{');
145-
self.wr.write_str("\"variant\"");
146-
self.wr.write_char(':');
145+
self.wr.write_char('[');
147146
self.wr.write_str(escape_str(name));
148147
self.wr.write_char(',');
149-
self.wr.write_str("\"fields\"");
150-
self.wr.write_str(":[");
151148
f(self);
152-
self.wr.write_str("]}");
149+
self.wr.write_char(']');
153150
}
154151
}
155152

@@ -950,20 +947,14 @@ impl serialize::Decoder for Decoder {
950947
debug!("read_enum_variant(names=%?)", names);
951948
let name = match self.stack.pop() {
952949
String(s) => s,
953-
Object(o) => {
954-
let n = match o.find(&~"variant").expect("invalidly encoded json") {
955-
&String(ref s) => s.clone(),
956-
_ => fail!("invalidly encoded json"),
957-
};
958-
match o.find(&~"fields").expect("invalidly encoded json") {
959-
&List(ref l) => {
960-
for field in l.rev_iter() {
961-
self.stack.push(field.clone());
962-
}
963-
},
964-
_ => fail!("invalidly encoded json")
950+
List(list) => {
951+
for v in list.move_rev_iter() {
952+
self.stack.push(v);
953+
}
954+
match self.stack.pop() {
955+
String(s) => s,
956+
value => fail!("invalid variant name: %?", value),
965957
}
966-
n
967958
}
968959
ref json => fail!("invalid variant: %?", *json),
969960
};
@@ -1526,7 +1517,7 @@ mod tests {
15261517
let mut encoder = Encoder(wr);
15271518
animal.encode(&mut encoder);
15281519
},
1529-
~"{\"variant\":\"Frog\",\"fields\":[\"Henry\",349]}"
1520+
~"[\"Frog\",\"Henry\",349]"
15301521
);
15311522
assert_eq!(
15321523
do io::with_str_writer |wr| {
@@ -1930,14 +1921,14 @@ mod tests {
19301921
assert_eq!(value, Dog);
19311922

19321923
let mut decoder =
1933-
Decoder(from_str("{\"variant\":\"Frog\",\"fields\":[\"Henry\",349]}").unwrap());
1924+
Decoder(from_str("[\"Frog\",\"Henry\",349]").unwrap());
19341925
let value: Animal = Decodable::decode(&mut decoder);
19351926
assert_eq!(value, Frog(~"Henry", 349));
19361927
}
19371928
19381929
#[test]
19391930
fn test_decode_map() {
1940-
let s = ~"{\"a\": \"Dog\", \"b\": {\"variant\":\"Frog\",\"fields\":[\"Henry\", 349]}}";
1931+
let s = ~"{\"a\": \"Dog\", \"b\": [\"Frog\", \"Henry\", 349]}";
19411932
let mut decoder = Decoder(from_str(s).unwrap());
19421933
let mut map: TreeMap<~str, Animal> = Decodable::decode(&mut decoder);
19431934

0 commit comments

Comments
 (0)