@@ -20,29 +20,30 @@ tag eval_mode { mode_depend; mode_parse; }
20
20
type ctx =
21
21
@{ p: parser,
22
22
mode: eval_mode,
23
- mutable deps: [ str ] ,
23
+ mutable deps: [ istr ] ,
24
24
sess: parser:: parse_sess,
25
25
mutable chpos: uint,
26
26
mutable byte_pos: uint,
27
27
cfg: ast:: crate_cfg} ;
28
28
29
29
fn eval_crate_directives ( cx : ctx , cdirs : & [ @ast:: crate_directive ] ,
30
- prefix : str , view_items : & mutable [ @ast:: view_item ] ,
30
+ prefix : & istr ,
31
+ view_items : & mutable [ @ast:: view_item ] ,
31
32
items : & mutable [ @ast:: item ] ) {
32
33
for sub_cdir: @ast:: crate_directive in cdirs {
33
34
eval_crate_directive ( cx, sub_cdir, prefix, view_items, items) ;
34
35
}
35
36
}
36
37
37
38
fn eval_crate_directives_to_mod ( cx : ctx , cdirs : & [ @ast:: crate_directive ] ,
38
- prefix : str ) -> ast:: _mod {
39
+ prefix : & istr ) -> ast:: _mod {
39
40
let view_items: [ @ast:: view_item ] = [ ] ;
40
41
let items: [ @ast:: item ] = [ ] ;
41
42
eval_crate_directives ( cx, cdirs, prefix, view_items, items) ;
42
43
ret { view_items : view_items, items : items} ;
43
44
}
44
45
45
- fn eval_crate_directive ( cx : ctx , cdir : @ast:: crate_directive , prefix : str ,
46
+ fn eval_crate_directive ( cx : ctx , cdir : @ast:: crate_directive , prefix : & istr ,
46
47
view_items : & mutable [ @ast:: view_item ] ,
47
48
items : & mutable [ @ast:: item ] ) {
48
49
alt cdir. node {
@@ -54,15 +55,15 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
54
55
}
55
56
none. { }
56
57
}
57
- let full_path = if std:: fs:: path_is_absolute (
58
- file_path) {
59
- istr:: to_estr ( file_path)
58
+ let full_path = if std:: fs:: path_is_absolute ( file_path) {
59
+ file_path
60
60
} else {
61
- prefix + istr :: to_estr ( std:: fs:: path_sep ( ) + file_path)
61
+ prefix + std:: fs:: path_sep ( ) + file_path
62
62
} ;
63
63
if cx. mode == mode_depend { cx. deps += [ full_path] ; ret; }
64
64
let p0 =
65
- new_parser_from_file ( cx. sess , cx. cfg , full_path, cx. chpos ,
65
+ new_parser_from_file ( cx. sess , cx. cfg ,
66
+ istr:: to_estr ( full_path) , cx. chpos ,
66
67
cx. byte_pos , SOURCE_FILE ) ;
67
68
let inner_attrs = parse_inner_attrs_and_next ( p0) ;
68
69
let mod_attrs = attrs + inner_attrs. inner ;
@@ -87,9 +88,9 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
87
88
}
88
89
let full_path =
89
90
if std:: fs:: path_is_absolute ( path) {
90
- istr :: to_estr ( path)
91
+ path
91
92
} else {
92
- prefix + istr :: to_estr ( std:: fs:: path_sep ( ) + path)
93
+ prefix + std:: fs:: path_sep ( ) + path
93
94
} ;
94
95
let m0 = eval_crate_directives_to_mod ( cx, cdirs, full_path) ;
95
96
let i =
0 commit comments