Skip to content

Commit 097a1af

Browse files
committed
---
yaml --- r: 2063 b: refs/heads/master c: 5a36786 h: refs/heads/master i: 2061: dcb08e0 2059: 9eb22b0 2055: 19dc016 2047: 92c572a v: v3
1 parent cd4bce0 commit 097a1af

File tree

4 files changed

+79
-49
lines changed

4 files changed

+79
-49
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9d9790c7f50b2bc2076a821974ed31e99bac9ef2
2+
refs/heads/master: 5a367866349b54b648f41e9ddd9efd4cfe88a649

trunk/src/comp/front/extfmt.rs

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,55 +21,37 @@ import std.option;
2121
import std.option.none;
2222
import std.option.some;
2323

24-
export expand_syntax_ext;
25-
26-
tag signedness {
27-
signed;
28-
unsigned;
29-
}
30-
31-
tag caseness {
32-
case_upper;
33-
case_lower;
34-
}
35-
36-
tag ty {
37-
ty_bool;
38-
ty_str;
39-
ty_char;
40-
ty_int(signedness);
41-
ty_bits;
42-
ty_hex(caseness);
43-
// FIXME: More types
44-
}
24+
import std.ExtFmt;
25+
import std.ExtFmt.signedness;
26+
import std.ExtFmt.signed;
27+
import std.ExtFmt.unsigned;
28+
import std.ExtFmt.caseness;
29+
import std.ExtFmt.case_upper;
30+
import std.ExtFmt.case_lower;
31+
import std.ExtFmt.ty;
32+
import std.ExtFmt.ty_bool;
33+
import std.ExtFmt.ty_str;
34+
import std.ExtFmt.ty_char;
35+
import std.ExtFmt.ty_int;
36+
import std.ExtFmt.ty_bits;
37+
import std.ExtFmt.ty_hex;
38+
import std.ExtFmt.flag;
39+
import std.ExtFmt.flag_left_justify;
40+
import std.ExtFmt.flag_left_zero_pad;
41+
import std.ExtFmt.flag_left_space_pad;
42+
import std.ExtFmt.flag_plus_if_positive;
43+
import std.ExtFmt.flag_alternate;
44+
import std.ExtFmt.count;
45+
import std.ExtFmt.count_is;
46+
import std.ExtFmt.count_is_param;
47+
import std.ExtFmt.count_is_next_param;
48+
import std.ExtFmt.count_implied;
49+
import std.ExtFmt.conv;
50+
import std.ExtFmt.piece;
51+
import std.ExtFmt.piece_string;
52+
import std.ExtFmt.piece_conv;
4553

46-
tag flag {
47-
flag_left_justify;
48-
flag_left_zero_pad;
49-
flag_left_space_pad;
50-
flag_plus_if_positive;
51-
flag_alternate;
52-
}
53-
54-
tag count {
55-
count_is(int);
56-
count_is_param(int);
57-
count_is_next_param;
58-
count_implied;
59-
}
60-
61-
// A formatted conversion from an expression to a string
62-
type conv = rec(option.t[int] param,
63-
vec[flag] flags,
64-
count width,
65-
count precision,
66-
ty ty);
67-
68-
// A fragment of the output sequence
69-
tag piece {
70-
piece_string(str);
71-
piece_conv(conv);
72-
}
54+
export expand_syntax_ext;
7355

7456
// TODO: Need to thread parser through here to handle errors correctly
7557
fn expand_syntax_ext(vec[@ast.expr] args,

trunk/src/lib/ExtFmt.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
tag signedness {
2+
signed;
3+
unsigned;
4+
}
5+
6+
tag caseness {
7+
case_upper;
8+
case_lower;
9+
}
10+
11+
tag ty {
12+
ty_bool;
13+
ty_str;
14+
ty_char;
15+
ty_int(signedness);
16+
ty_bits;
17+
ty_hex(caseness);
18+
// FIXME: More types
19+
}
20+
21+
tag flag {
22+
flag_left_justify;
23+
flag_left_zero_pad;
24+
flag_left_space_pad;
25+
flag_plus_if_positive;
26+
flag_alternate;
27+
}
28+
29+
tag count {
30+
count_is(int);
31+
count_is_param(int);
32+
count_is_next_param;
33+
count_implied;
34+
}
35+
36+
// A formatted conversion from an expression to a string
37+
type conv = rec(option.t[int] param,
38+
vec[flag] flags,
39+
count width,
40+
count precision,
41+
ty ty);
42+
43+
// A fragment of the output sequence
44+
tag piece {
45+
piece_string(str);
46+
piece_conv(conv);
47+
}

trunk/src/lib/std.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ mod sort;
8383
mod sha1;
8484
mod ebml;
8585
mod UFind;
86+
mod ExtFmt;
8687

8788
// Local Variables:
8889
// mode: rust;

0 commit comments

Comments
 (0)