diff options
| author | Stefan Plantikow <stefan.plantikow@googlemail.com> | 2011-11-22 19:51:05 +0100 |
|---|---|---|
| committer | Stefan Plantikow <stefan.plantikow@googlemail.com> | 2011-11-22 20:01:25 +0100 |
| commit | 148a6c1a38e5f4ed92127717390a2df058967b5b (patch) | |
| tree | 7bf5eeaf424db98ae01d08220c4d01d8415e7d13 /src/comp/syntax | |
| parent | fedb775fbb127a5099f46078c85046440479b0ef (diff) | |
| download | rust-148a6c1a38e5f4ed92127717390a2df058967b5b.tar.gz rust-148a6c1a38e5f4ed92127717390a2df058967b5b.zip | |
comp: allowed the declaration of pure fn's in native mods
This is especially useful for the native calls in std::math This commit does NOT yet point to new snapshots
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index e33572d4575..13136a8d7ed 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1975,6 +1975,9 @@ fn parse_native_item(p: parser, attrs: [ast::attribute]) -> ret parse_item_native_type(p, attrs); } else if eat_word(p, "fn") { ret parse_item_native_fn(p, attrs, ast::impure_fn); + } else if eat_word(p, "pure") { + expect_word(p, "fn"); + ret parse_item_native_fn(p, attrs, ast::pure_fn); } else if eat_word(p, "unsafe") { expect_word(p, "fn"); ret parse_item_native_fn(p, attrs, ast::unsafe_fn); |
