Skip to content

Commit e3fae5d

Browse files
committed
---
yaml --- r: 11749 b: refs/heads/master c: b22556a h: refs/heads/master i: 11747: f843447 v: v3
1 parent bc37b50 commit e3fae5d

33 files changed

+1076
-2115
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a0521971b1b9a3203c250591991092a445b50586
2+
refs/heads/master: b22556a6f818845cd400ad58065a83916ba591a7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/bool.rs

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,36 @@ export from_str, to_str, all_values, to_bit;
1010
#[doc = "The type of boolean logic values"]
1111
type t = bool;
1212

13-
#[doc(
14-
brief = "Negation/Inverse"
15-
)]
13+
#[doc = "Negation/Inverse"]
1614
pure fn not(v: t) -> t { !v }
1715

18-
#[doc(
19-
brief = "Conjunction"
20-
)]
16+
#[doc = "Conjunction"]
2117
pure fn and(a: t, b: t) -> t { a && b }
2218

23-
#[doc(
24-
brief = "Disjunction"
25-
)]
19+
#[doc = "Disjunction"]
2620
pure fn or(a: t, b: t) -> t { a || b }
2721

28-
#[doc(
29-
brief = "Exclusive or, i.e. `or(and(a, not(b)), and(not(a), b))`"
30-
)]
22+
#[doc = "Exclusive or, i.e. `or(and(a, not(b)), and(not(a), b))`"]
3123
pure fn xor(a: t, b: t) -> t { (a && !b) || (!a && b) }
3224

33-
#[doc(
34-
brief = "Implication in the logic, i.e. from `a` follows `b`"
35-
)]
25+
#[doc = "Implication in the logic, i.e. from `a` follows `b`"]
3626
pure fn implies(a: t, b: t) -> t { !a || b }
3727

38-
#[doc(
39-
brief = "true if truth values `a` and `b` \
40-
are indistinguishable in the logic"
41-
)]
28+
#[doc = "
29+
true if truth values `a` and `b` are indistinguishable in the logic
30+
"]
4231
pure fn eq(a: t, b: t) -> bool { a == b }
4332

44-
#[doc(
45-
brief = "true if truth values `a` and `b` are distinguishable in the logic"
46-
)]
33+
#[doc = "true if truth values `a` and `b` are distinguishable in the logic"]
4734
pure fn ne(a: t, b: t) -> bool { a != b }
4835

49-
#[doc(
50-
brief = "true if `v` represents truth in the logic"
51-
)]
36+
#[doc = "true if `v` represents truth in the logic"]
5237
pure fn is_true(v: t) -> bool { v }
5338

54-
#[doc(
55-
brief = "true if `v` represents falsehood in the logic"
56-
)]
39+
#[doc = "true if `v` represents falsehood in the logic"]
5740
pure fn is_false(v: t) -> bool { !v }
5841

59-
#[doc(
60-
brief = "Parse logic value from `s`"
61-
)]
42+
#[doc = "Parse logic value from `s`"]
6243
pure fn from_str(s: str) -> option<t> {
6344
alt check s {
6445
"true" { some(true) }
@@ -67,23 +48,19 @@ pure fn from_str(s: str) -> option<t> {
6748
}
6849
}
6950

70-
#[doc(
71-
brief = "Convert `v` into a string"
72-
)]
51+
#[doc = "Convert `v` into a string"]
7352
pure fn to_str(v: t) -> str { if v { "true" } else { "false" } }
7453

75-
#[doc(
76-
brief = "Iterates over all truth values by passing them to `blk` \
77-
in an unspecified order"
78-
)]
54+
#[doc = "
55+
Iterates over all truth values by passing them to `blk` in an unspecified
56+
order
57+
"]
7958
fn all_values(blk: fn(v: t)) {
8059
blk(true);
8160
blk(false);
8261
}
8362

84-
#[doc(
85-
brief = "converts truth value to an 8 bit byte"
86-
)]
63+
#[doc = "converts truth value to an 8 bit byte"]
8764
pure fn to_bit(v: t) -> u8 { if v { 1u8 } else { 0u8 } }
8865

8966
#[test]

trunk/src/libcore/box.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
#[doc = "Operations on shared box types"];
2+
13
export ptr_eq;
24

3-
#[doc(
4-
brief = "Determine if two shared boxes point to the same object"
5-
)]
65
pure fn ptr_eq<T>(a: @T, b: @T) -> bool unchecked {
6+
#[doc = "Determine if two shared boxes point to the same object"];
77
ptr::addr_of(*a) == ptr::addr_of(*b)
88
}
99

trunk/src/libcore/char.rs

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -45,66 +45,72 @@ import is_XID_start = unicode::derived_property::XID_Start;
4545
import is_XID_continue = unicode::derived_property::XID_Continue;
4646

4747

48-
#[doc(
49-
brief = "Indicates whether a character is in lower case, defined \
50-
in terms of the Unicode General Category 'Ll'."
51-
)]
48+
#[doc = "
49+
Indicates whether a character is in lower case, defined
50+
in terms of the Unicode General Category 'Ll'
51+
"]
5252
pure fn is_lowercase(c: char) -> bool {
5353
ret unicode::general_category::Ll(c);
5454
}
5555

56-
#[doc(
57-
brief = "Indicates whether a character is in upper case, defined \
58-
in terms of the Unicode General Category 'Lu'."
59-
)]
56+
#[doc = "
57+
Indicates whether a character is in upper case, defined
58+
in terms of the Unicode General Category 'Lu'.
59+
"]
6060
pure fn is_uppercase(c: char) -> bool {
6161
ret unicode::general_category::Lu(c);
6262
}
6363

64-
#[doc(
65-
brief = "Indicates whether a character is whitespace, defined in \
66-
terms of the Unicode General Categories 'Zs', 'Zl', 'Zp' \
67-
additional 'Cc'-category control codes in the range [0x09, 0x0d]"
68-
)]
64+
#[doc = "
65+
Indicates whether a character is whitespace, defined in
66+
terms of the Unicode General Categories 'Zs', 'Zl', 'Zp'
67+
additional 'Cc'-category control codes in the range [0x09, 0x0d]
68+
"]
6969
pure fn is_whitespace(c: char) -> bool {
7070
ret ('\x09' <= c && c <= '\x0d')
7171
|| unicode::general_category::Zs(c)
7272
|| unicode::general_category::Zl(c)
7373
|| unicode::general_category::Zp(c);
7474
}
7575

76-
#[doc(
77-
brief = "Indicates whether a character is alphanumeric, defined \
78-
in terms of the Unicode General Categories 'Nd', \
79-
'Nl', 'No' and the Derived Core Property 'Alphabetic'."
80-
)]
76+
#[doc = "
77+
Indicates whether a character is alphanumeric, defined
78+
in terms of the Unicode General Categories 'Nd',
79+
'Nl', 'No' and the Derived Core Property 'Alphabetic'.
80+
"]
8181
pure fn is_alphanumeric(c: char) -> bool {
8282
ret unicode::derived_property::Alphabetic(c) ||
8383
unicode::general_category::Nd(c) ||
8484
unicode::general_category::Nl(c) ||
8585
unicode::general_category::No(c);
8686
}
8787

88-
#[doc( brief = "Indicates whether the character is an ASCII character" )]
88+
#[doc = "Indicates whether the character is an ASCII character"]
8989
pure fn is_ascii(c: char) -> bool {
9090
c - ('\x7F' & c) == '\x00'
9191
}
9292

93-
#[doc( brief = "Indicates whether the character is numeric (Nd, Nl, or No)" )]
93+
#[doc = "Indicates whether the character is numeric (Nd, Nl, or No)"]
9494
pure fn is_digit(c: char) -> bool {
9595
ret unicode::general_category::Nd(c) ||
9696
unicode::general_category::Nl(c) ||
9797
unicode::general_category::No(c);
9898
}
9999

100-
#[doc(
101-
brief = "Convert a char to the corresponding digit. \
102-
Safety note: This function fails if `c` is not a valid char",
103-
return = "If `c` is between '0' and '9', the corresponding value \
104-
between 0 and 9. If `c` is 'a' or 'A', 10. If `c` is \
105-
'b' or 'B', 11, etc. Returns none if the char does not \
106-
refer to a digit in the given radix."
107-
)]
100+
#[doc = "
101+
Convert a char to the corresponding digit.
102+
103+
# Safety note
104+
105+
This function fails if `c` is not a valid char
106+
107+
# Return value
108+
109+
If `c` is between '0' and '9', the corresponding value
110+
between 0 and 9. If `c` is 'a' or 'A', 10. If `c` is
111+
'b' or 'B', 11, etc. Returns none if the char does not
112+
refer to a digit in the given radix.
113+
"]
108114
pure fn to_digit(c: char, radix: uint) -> option<uint> {
109115
let val = alt c {
110116
'0' to '9' { c as uint - ('0' as uint) }
@@ -119,9 +125,7 @@ pure fn to_digit(c: char, radix: uint) -> option<uint> {
119125
/*
120126
FIXME: works only on ASCII
121127
*/
122-
#[doc(
123-
brief = "Convert a char to the corresponding lower case."
124-
)]
128+
#[doc = "Convert a char to the corresponding lower case."]
125129
pure fn to_lower(c: char) -> char {
126130
alt c {
127131
'A' to 'Z' { ((c as u8) + 32u8) as char }
@@ -132,20 +136,21 @@ pure fn to_lower(c: char) -> char {
132136
/*
133137
FIXME: works only on ASCII
134138
*/
135-
#[doc(
136-
brief = "Convert a char to the corresponding upper case."
137-
)]
139+
#[doc = "Convert a char to the corresponding upper case."]
138140
pure fn to_upper(c: char) -> char {
139141
alt c {
140142
'a' to 'z' { ((c as u8) - 32u8) as char }
141143
_ { c }
142144
}
143145
}
144146

145-
#[doc(
146-
brief = "Compare two chars.",
147-
return = "-1 if a<b, 0 if a==b, +1 if a>b"
148-
)]
147+
#[doc = "
148+
Compare two chars
149+
150+
# Return value
151+
152+
-1 if a < b, 0 if a == b, +1 if a > b
153+
"]
149154
pure fn cmp(a: char, b: char) -> int {
150155
ret if b > a { -1 }
151156
else if b < a { 1 }

0 commit comments

Comments
 (0)