diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2011-10-06 21:33:04 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-12 14:26:47 -0700 |
| commit | 046ca827dd02ca6e9b18264bfe5ffb8d30f77b47 (patch) | |
| tree | 09e19a68135d2e4ff624d15df111de4a84ecf7e0 /src/comp/syntax | |
| parent | 29584cc5ac9369a18d1082d3d2c95eb0471a64db (diff) | |
| download | rust-046ca827dd02ca6e9b18264bfe5ffb8d30f77b47.tar.gz rust-046ca827dd02ca6e9b18264bfe5ffb8d30f77b47.zip | |
Add unsafe blocks, unsafe functions, and two rudimentary tests
related to them
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 25344a8b2cf..75b72acba3f 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -2165,7 +2165,8 @@ fn parse_item(p: parser, attrs: [ast::attribute]) -> option::t<@ast::item> { let proto = parse_fn_proto(p); ret some(parse_item_fn_or_iter(p, ast::pure_fn, proto, attrs, ast::il_normal)); - } else if eat_word(p, "unsafe") { + } else if is_word(p, "unsafe") && p.look_ahead(1u) != token::LBRACE { + p.bump(); expect_word(p, "fn"); ret some(parse_item_fn_or_iter(p, ast::unsafe_fn, ast::proto_fn, attrs, ast::il_normal)); |
