aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-07 10:14:25 -0700
committerPatrick Walton <[email protected]>2011-04-07 10:14:25 -0700
commit2a894cabc237f32484dd9fb4265790c60eefd661 (patch)
tree3d3b128ae9670f7b425d6cd68936482f603ca656 /src/comp/front
parentMerge branch 'master' of github.com:graydon/rust (diff)
parentRun optimizations. (diff)
downloadrust-2a894cabc237f32484dd9fb4265790c60eefd661.tar.xz
rust-2a894cabc237f32484dd9fb4265790c60eefd661.zip
Merge branch 'master' of github.com:graydon/rust
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs6
-rw-r--r--src/comp/front/parser.rs15
2 files changed, 11 insertions, 10 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index d41e6d60..cf4145a5 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -215,8 +215,8 @@ tag mode {
type stmt = spanned[stmt_];
tag stmt_ {
- stmt_decl(@decl);
- stmt_expr(@expr);
+ stmt_decl(@decl, option.t[@ts_ann]);
+ stmt_expr(@expr, option.t[@ts_ann]);
// These only exist in crate-level blocks.
stmt_crate_directive(@crate_directive);
}
@@ -495,7 +495,7 @@ fn index_native_view_item(native_mod_index index, @view_item it) {
fn index_stmt(block_index index, @stmt s) {
alt (s.node) {
- case (ast.stmt_decl(?d)) {
+ case (ast.stmt_decl(?d,_)) {
alt (d.node) {
case (ast.decl_local(?loc)) {
index.insert(loc.ident, ast.bie_local(loc));
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index 27fdc7fe..7d1323cb 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -11,6 +11,7 @@ import util.common;
import util.common.filename;
import util.common.span;
import util.common.new_str_hash;
+import util.typestate_ann.ts_ann;
tag restriction {
UNRESTRICTED;
@@ -1555,13 +1556,13 @@ impure fn parse_source_stmt(parser p) -> @ast.stmt {
case (token.LET) {
auto decl = parse_let(p);
auto hi = p.get_span();
- ret @spanned(lo, hi, ast.stmt_decl(decl));
+ ret @spanned(lo, hi, ast.stmt_decl(decl, none[@ts_ann]));
}
case (token.AUTO) {
auto decl = parse_auto(p);
auto hi = p.get_span();
- ret @spanned(lo, hi, ast.stmt_decl(decl));
+ ret @spanned(lo, hi, ast.stmt_decl(decl, none[@ts_ann]));
}
case (_) {
@@ -1570,13 +1571,13 @@ impure fn parse_source_stmt(parser p) -> @ast.stmt {
auto i = parse_item(p);
auto hi = i.span;
auto decl = @spanned(lo, hi, ast.decl_item(i));
- ret @spanned(lo, hi, ast.stmt_decl(decl));
+ ret @spanned(lo, hi, ast.stmt_decl(decl, none[@ts_ann]));
} else {
// Remainder are line-expr stmts.
auto e = parse_expr(p);
auto hi = p.get_span();
- ret @spanned(lo, hi, ast.stmt_expr(e));
+ ret @spanned(lo, hi, ast.stmt_expr(e, none[@ts_ann]));
}
}
}
@@ -1613,7 +1614,7 @@ fn index_arm(@ast.pat pat) -> hashmap[ast.ident,ast.def_id] {
fn stmt_to_expr(@ast.stmt stmt) -> option.t[@ast.expr] {
alt (stmt.node) {
- case (ast.stmt_expr(?e)) { ret some[@ast.expr](e); }
+ case (ast.stmt_expr(?e,_)) { ret some[@ast.expr](e); }
case (_) { /* fall through */ }
}
ret none[@ast.expr];
@@ -1621,13 +1622,13 @@ fn stmt_to_expr(@ast.stmt stmt) -> option.t[@ast.expr] {
fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
alt (stmt.node) {
- case (ast.stmt_decl(?d)) {
+ case (ast.stmt_decl(?d,_)) {
alt (d.node) {
case (ast.decl_local(_)) { ret true; }
case (ast.decl_item(_)) { ret false; }
}
}
- case (ast.stmt_expr(?e)) {
+ case (ast.stmt_expr(?e,_)) {
alt (e.node) {
case (ast.expr_vec(_,_,_)) { ret true; }
case (ast.expr_tup(_,_)) { ret true; }