aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/parser.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-11 15:49:48 -0800
committerGraydon Hoare <[email protected]>2011-03-11 15:49:56 -0800
commitec7e84ae0d9d04c52a8456c16dd846efe6390340 (patch)
treecac83fdde3f379554aae7fcf133b66fe4149742e /src/comp/front/parser.rs
parentRemove redundant entry from Makefile (diff)
downloadrust-ec7e84ae0d9d04c52a8456c16dd846efe6390340.tar.xz
rust-ec7e84ae0d9d04c52a8456c16dd846efe6390340.zip
Preserve crate directives in the parsed crate.
Diffstat (limited to 'src/comp/front/parser.rs')
-rw-r--r--src/comp/front/parser.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index cdd65539..45cec0c0 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -2244,7 +2244,9 @@ impure fn parse_crate_from_source_file(parser p) -> @ast.crate {
auto lo = p.get_span();
auto hi = lo;
auto m = parse_mod_items(p, token.EOF);
- ret @spanned(lo, hi, rec(module=m));
+ let vec[@ast.crate_directive] cdirs = vec();
+ ret @spanned(lo, hi, rec(directives=cdirs,
+ module=m));
}
// Logic for parsing crate files (.rc)
@@ -2259,8 +2261,6 @@ impure fn parse_crate_directive(parser p) -> ast.crate_directive
auto hi = lo;
alt (p.peek()) {
case (token.AUTH) {
- // FIXME: currently dropping auth clauses on the floor,
- // as there is no effect-checking pass.
p.bump();
auto n = parse_path(p, GREEDY);
expect(p, token.EQ);
@@ -2271,8 +2271,6 @@ impure fn parse_crate_directive(parser p) -> ast.crate_directive
}
case (token.META) {
- // FIXME: currently dropping meta clauses on the floor,
- // as there is no crate metadata system
p.bump();
auto mis = parse_meta(p);
hi = p.get_span();
@@ -2381,7 +2379,8 @@ impure fn parse_crate_from_crate_file(parser p) -> @ast.crate {
cdirs, prefix);
hi = p.get_span();
expect(p, token.EOF);
- ret @spanned(lo, hi, rec(module=m));
+ ret @spanned(lo, hi, rec(directives=cdirs,
+ module=m));
}