Skip to content

Commit a69b66c

Browse files
committed
---
yaml --- r: 2922 b: refs/heads/master c: 18b6386 h: refs/heads/master v: v3
1 parent 6da5f95 commit a69b66c

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 07667d29aa24ef0189d3a340219f32bbbb1c9dee
2+
refs/heads/master: 18b63865ce35901d9beaf7ea94f4b1408defd7ad

trunk/src/comp/front/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ tag ty_ {
323323
ty_str;
324324
ty_box(mt);
325325
ty_vec(mt);
326+
ty_ptr(mt);
326327
ty_task;
327328
ty_port(@ty);
328329
ty_chan(@ty);

trunk/src/comp/front/parser.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ fn parse_ty(&parser p) -> @ast::ty {
511511
auto mt = parse_mt(p);
512512
hi = mt.ty.span.hi;
513513
t = ast::ty_box(mt);
514+
} else if (p.peek() == token::BINOP(token::STAR)) {
515+
p.bump();
516+
auto mt = parse_mt(p);
517+
hi = mt.ty.span.hi;
518+
t = ast::ty_ptr(mt);
514519
} else if (eat_word(p, "vec")) {
515520
expect(p, token::LBRACKET);
516521
t = ast::ty_vec(parse_mt(p));

trunk/src/test/run-pass/type-ptr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn f(*int a) {
2+
}
3+
4+
fn main(vec[str] args) {
5+
ret;
6+
}

0 commit comments

Comments
 (0)