Skip to content

Instantly share code, notes, and snippets.

@eholk
Created July 5, 2012 21:41
Show Gist options
  • Select an option

  • Save eholk/3056657 to your computer and use it in GitHub Desktop.

Select an option

Save eholk/3056657 to your computer and use it in GitHub Desktop.
} else if !self.is_any_keyword(self.look_ahead(0))
&& self.look_ahead(1) == token::NOT
{
// item macro.
let pth = self.parse_path_without_tps();
self.expect(token::NOT);
let id = self.parse_ident();
let tt = self.parse_token_tree();
let m = ast::mac_invoc_tt(pth, tt);
let m: ast::mac = {node: m,
span: {lo: self.span.lo,
hi: self.span.hi,
expn_info: none}};
(id, item_mac(m), none)
@eholk

eholk commented Jul 5, 2012

Copy link
Copy Markdown
Author
/Users/eholk/Documents/projects/mozilla/rust/src/libcore/str.rs:1201:51: 1201:52 error: expected ';' or '}' after expression but found '{'
/Users/eholk/Documents/projects/mozilla/rust/src/libcore/str.rs:1201     while i > 0u { i -= 1u; if !u8::is_ascii(s[i]) { ret false; } }

@eholk

eholk commented Jul 5, 2012

Copy link
Copy Markdown
Author

And a backtrace:

#0  upcall_fail (expr=0x10074a9e0 "explicit failure", file=0x10074aa00 "/Users/eholk/Documents/projects/mozilla/rust/src/libsyntax/diagnostic.rs", line=52) at rust_upcall.cpp:95
#1  0x00000001005d1346 in diagnostic::codemap_span_handler::meth429::span_fatal::_d079c724c69e4cff::_02 ()
#2  0x0000000100656b0b in parse::parser::parser::meth3865::fatal::_d3f96bc3cccbb116::_02 ()
#3  0x0000000100684e80 in parse::parser::parser::meth4408::parse_block_tail_::_6bf9f486c251412c::_02 ()
#4  0x00000001006845ba in parse::parser::parser::meth4403::parse_inner_attrs_and_block::_41b05c19e165986c::_02 ()
#5  0x000000010066bccd in parse::parser::parser::meth4149::parse_while_expr::_ff30304f84aab99f::_02 ()
#6  0x0000000100668cea in parse::parser::parser::meth4137::parse_bottom_expr::_ce563d9724e54c77::_02 ()
#7  0x0000000100677240 in parse::parser::parser::meth4278::parse_prefix_expr::_ce563d9724e54c77::_02 ()
#8  0x000000010067847e in parse::parser::parser::meth4282::parse_assign_expr::_ff30304f84aab99f::_02 ()
#9  0x00000001006802c1 in parse::parser::parser::meth4384::parse_stmt::_98d2cf1dc80fd80d::_02 ()
#10 0x0000000100684a73 in parse::parser::parser::meth4408::parse_block_tail_::_6bf9f486c251412c::_02 ()
#11 0x00000001006845ba in parse::parser::parser::meth4403::parse_inner_attrs_and_block::_41b05c19e165986c::_02 ()
#12 0x0000000100688544 in parse::parser::parser::meth4474::parse_item_fn::_40ece725f4634ea3::_02 ()
#13 0x0000000100681bc0 in parse::parser::parser::meth4394::parse_item::_11fde9232c5e1d2d::_02 ()
#14 0x000000010064ab75 in parse::parser::parser::meth3655::parse_mod_items::_f4c877331f818323::_02 ()
#15 0x0000000100643e7d in parse::eval::eval_crate_directive::_bf271552afa48357::_02 ()
#16 0x0000000100644bb8 in parse::eval::eval_crate_directives_to_mod::_c32501defc0a980f::_02 ()
#17 0x00000001006a3717 in parse::parse_crate_from_crate_file::_d9dffe8dffd25251::_02 ()
#18 0x00000001006a3291 in parse::parse_crate_from_file::_d9dffe8dffd25251::_02 ()
#19 0x000000010132d755 in driver::driver::time24616::_4c109296b1703914::_02 ()
#20 0x000000010132ae1f in driver::driver::compile_upto::_faba8a2dddf3e08c::_02 ()
#21 0x000000010132f10b in driver::driver::compile_input::_8048386d35eb809c::_02 ()
#22 0x0000000100004b5a in run_compiler::_57463125e416c3ef::_00 ()
#23 0x0000000100009e6e in monitor::anon ()
#24 0x00000001000093d8 in task::try552::anon ()
#25 0x0000000100039e35 in task::spawn_raw::anon ()
#26 0x0000000101735ea5 in task_start_wrapper (a=0x10074a9e0) at rust_task.cpp:169

@eholk

eholk commented Jul 5, 2012

Copy link
Copy Markdown
Author
    fn is_any_keyword(tok: token::token) -> bool {
        alt tok {
          token::IDENT(sid, false) {
            self.keywords.contains_key(*self.get_str(sid))
          }
          _ { false }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment