diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-08-26 18:48:08 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-08-27 15:54:45 -0700 |
| commit | f09ef6ec66b0a204c52cc67a6c91a69da65a5407 (patch) | |
| tree | e7cbbe4ccf72c51d25b05be37b1218b6bdbeecbf /src/comp/syntax/parse | |
| parent | f603e912ee55c92a40a4b4ea22f20c545b72804f (diff) | |
| download | rust-f09ef6ec66b0a204c52cc67a6c91a69da65a5407.tar.gz rust-f09ef6ec66b0a204c52cc67a6c91a69da65a5407.zip | |
Convert rest of the AST to istrs. Issue #855
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 85f809ef965..ce3b917118e 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -696,7 +696,7 @@ fn parse_lit(p: &parser) -> ast::lit { token::LIT_UINT(u) { p.bump(); lit = ast::lit_uint(u); } token::LIT_FLOAT(s) { p.bump(); - lit = ast::lit_float(p.get_str(s)); + lit = ast::lit_float(istr::from_estr(p.get_str(s))); } token::LIT_MACH_INT(tm, i) { p.bump(); @@ -704,12 +704,12 @@ fn parse_lit(p: &parser) -> ast::lit { } token::LIT_MACH_FLOAT(tm, s) { p.bump(); - lit = ast::lit_mach_float(tm, p.get_str(s)); + lit = ast::lit_mach_float(tm, istr::from_estr(p.get_str(s))); } token::LIT_CHAR(c) { p.bump(); lit = ast::lit_char(c); } token::LIT_STR(s) { p.bump(); - lit = ast::lit_str(p.get_str(s), ast::sk_rc); + lit = ast::lit_str(istr::from_estr(p.get_str(s)), ast::sk_rc); } token::LPAREN. { p.bump(); @@ -896,7 +896,8 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr { let sp = p.get_span(); p.bump(); let lit = - @{node: ast::lit_str(p.get_str(s), ast::sk_unique), + @{node: ast::lit_str(istr::from_estr(p.get_str(s)), + ast::sk_unique), span: sp}; ex = ast::expr_lit(lit); } @@ -1971,7 +1972,10 @@ fn parse_item_native_fn(p: &parser, attrs: &[ast::attribute]) -> let t = parse_fn_header(p); let decl = parse_fn_decl(p, ast::impure_fn, ast::il_normal); let link_name = none; - if p.peek() == token::EQ { p.bump(); link_name = some(parse_str(p)); } + if p.peek() == token::EQ { + p.bump(); + link_name = some(istr::from_estr(parse_str(p))); + } let hi = p.get_hi_pos(); expect(p, token::SEMI); ret @{ident: t.ident, @@ -2006,7 +2010,7 @@ fn parse_native_mod_items(p: &parser, native_name: &str, initial_attrs = []; items += [parse_native_item(p, attrs)]; } - ret {native_name: native_name, + ret {native_name: istr::from_estr(native_name), abi: abi, view_items: view_items, items: items}; |
