Skip to content

Commit 12149db

Browse files
committed
---
yaml --- r: 3487 b: refs/heads/master c: d53bfad h: refs/heads/master i: 3485: 1b58fd3 3483: 4189c2b 3479: e9e886e 3471: b2f052e 3455: 54d66c0 v: v3
1 parent bb30302 commit 12149db

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
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: cbcc7bba30920489d4c772f174bfb9715842f163
2+
refs/heads/master: d53bfad8e7b6f199436d8838f75eb90713dffd1d

trunk/src/comp/front/ast.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,16 @@ fn def_id_of_def(def d) -> def_id {
7676
fail;
7777
}
7878

79+
// The set of meta_items that define the compilation environment of the crate,
80+
// used to drive conditional compilation
81+
type crate_cfg = vec[@meta_item];
82+
7983
type crate = spanned[crate_];
8084

8185
type crate_ = rec(vec[@crate_directive] directives,
8286
_mod module,
83-
vec[attribute] attrs);
87+
vec[attribute] attrs,
88+
crate_cfg config);
8489

8590
tag crate_directive_ {
8691
cdir_expr(@expr);

trunk/src/comp/front/fold.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ fn noop_fold_crate(&crate_ c, ast_fold fld) -> crate_ {
131131
auto fold_attribute = bind fold_attribute_(_,fold_meta_item);
132132

133133
ret rec(directives=map(fld.fold_crate_directive, c.directives),
134-
module=c.module, attrs=map(fold_attribute, c.attrs));
134+
module=c.module, attrs=map(fold_attribute, c.attrs),
135+
config=map(fold_meta_item, c.config));
135136
}
136137

137138
fn noop_fold_crate_directive(&crate_directive_ cd, ast_fold fld)

trunk/src/comp/front/parser.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,8 @@ fn parse_crate_from_source_file(&parser p) -> @ast::crate {
23182318
let vec[@ast::crate_directive] cdirs = [];
23192319
ret @spanned(lo, p.get_lo_pos(), rec(directives=cdirs,
23202320
module=m,
2321-
attrs=crate_attrs._0));
2321+
attrs=crate_attrs._0,
2322+
config=[]));
23222323
}
23232324

23242325
fn parse_str(&parser p) -> ast::ident {
@@ -2450,7 +2451,8 @@ fn parse_crate_from_crate_file(&parser p) -> @ast::crate {
24502451
expect(p, token::EOF);
24512452
ret @spanned(lo, hi, rec(directives=cdirs,
24522453
module=m,
2453-
attrs=crate_attrs));
2454+
attrs=crate_attrs,
2455+
config=[]));
24542456
}
24552457
//
24562458
// Local Variables:

0 commit comments

Comments
 (0)