Formatting cleanups.

This commit is contained in:
Kevin Atkinson 2012-02-01 03:40:49 -07:00
parent 9090a5c03b
commit 35a199c036
2 changed files with 13 additions and 11 deletions

View File

@ -38,7 +38,7 @@ fn new_filemap_w_substr(filename: filename, substr: file_substr,
fn new_filemap(filename: filename, src: @str,
start_pos_ch: uint, start_pos_byte: uint)
-> filemap {
ret new_filemap_w_substr(filename, none, src,
ret new_filemap_w_substr(filename, none, src,
start_pos_ch, start_pos_byte);
}

View File

@ -43,23 +43,25 @@ fn is_space(c: char) -> bool {
syntax::parse::lexer::is_whitespace(c)
}
fn expand_ast(ecx: ext_ctxt, _sp: span, _arg: ast::mac_arg, body: ast::mac_body)
-> @ast::expr
fn expand_ast(ecx: ext_ctxt, _sp: span, _arg:
ast::mac_arg, body: ast::mac_body)
-> @ast::expr
{
let body = get_mac_body(ecx,_sp,body);
let str = @codemap::span_to_snippet(body.span, ecx.session().parse_sess.cm);
let (fname, ss) = codemap::get_substr_info(ecx.session().parse_sess.cm,
let cm = ecx.session().parse_sess.cm;
let str = @codemap::span_to_snippet(body.span, cm);
let (fname, ss) = codemap::get_substr_info(cm,
body.span.lo, body.span.hi);
let {node: e, _} = parse_from_source_str(parser::parse_expr,
fname, some(ss), str,
ecx.session().opts.cfg,
let {node: e, _} = parse_from_source_str(parser::parse_expr,
fname, some(ss), str,
ecx.session().opts.cfg,
ecx.session().parse_sess);
ret expand_qquote(ecx, e.span, some(*str), e);
}
fn expand_qquote(ecx: ext_ctxt, sp: span, maybe_str: option::t<str>,
e: @ast::expr)
-> @ast::expr
fn expand_qquote(ecx: ext_ctxt, sp: span, maybe_str: option::t<str>,
e: @ast::expr)
-> @ast::expr
{
let str = alt(maybe_str) {
some(s) {s}