diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-10 13:54:23 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-14 11:24:09 -0800 |
| commit | 305cbf9b8ed24a23212cd99fc3eedfcd9b2b40af (patch) | |
| tree | 7c44ded595869e9996c66aa582a5fce43da35f35 /src/comp/syntax/parse/parser.rs | |
| parent | 6943b38e4fd75dfd3c6ff80b96060ec9a39e01e9 (diff) | |
| download | rust-305cbf9b8ed24a23212cd99fc3eedfcd9b2b40af.tar.gz rust-305cbf9b8ed24a23212cd99fc3eedfcd9b2b40af.zip | |
rustc: Parse crust functions
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 60a71ebe804..4d8a9dc02ba 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -150,7 +150,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> { "export", "fail", "fn", "for", "if", "iface", "impl", "import", "let", "log", "mod", "mutable", "native", "pure", "resource", "ret", "trait", "type", "unchecked", "unsafe", - "while"] { + "while, crust"] { words.insert(word, ()); } words @@ -2276,6 +2276,9 @@ fn parse_item(p: parser, attrs: [ast::attribute]) -> option<@ast::item> { p.bump(); expect_word(p, "fn"); ret some(parse_item_fn(p, ast::unsafe_fn, attrs)); + } else if eat_word(p, "crust") { + expect_word(p, "fn"); + ret some(parse_item_fn(p, ast::crust_fn, attrs)); } else if eat_word(p, "mod") { ret some(parse_item_mod(p, attrs)); } else if eat_word(p, "native") { |
