Skip to content

Commit eb4c090

Browse files
committed
---
yaml --- r: 527 b: refs/heads/master c: 102ec16 h: refs/heads/master i: 525: 9aec340 523: ffda1b5 519: ef255ee 511: 4630b74 v: v3
1 parent 3780444 commit eb4c090

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
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: 9db70bfc42702e32bac09394e55bd756664aadf8
2+
refs/heads/master: 102ec1687700d51b5367bd68c43ce146bb8c9b74

trunk/src/comp/fe/ast.rs

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
1-
type crate = rec( str filename );
1+
2+
import std.util.option;
3+
import std.map.hashmap;
4+
5+
type ident = str;
6+
7+
type crate = rec( str filename,
8+
_mod module);
9+
10+
type block = vec[stmt];
11+
12+
type stmt = tag( stmt_block(block),
13+
stmt_decl(@decl),
14+
stmt_ret(option[@lval]) );
15+
16+
type decl = tag( decl_local(ident, option[ty]),
17+
decl_item(ident, @item) );
18+
19+
type lval = tag( lval_ident(ident),
20+
lval_ext(@lval, ident),
21+
lval_idx(@lval, @atom) );
22+
23+
type atom = tag( atom_lit(lit));
24+
25+
type lit = tag( lit_char(char),
26+
lit_int(int),
27+
lit_nil(),
28+
lit_bool(bool) );
29+
30+
type ty = tag( ty_nil(),
31+
ty_bool(),
32+
ty_int(),
33+
ty_char() );
34+
35+
type mode = tag( local(), alias() );
36+
37+
type slot = rec(ty ty, mode mode);
38+
39+
type _fn = rec(vec[rec(slot slot, ident ident)] inputs,
40+
slot output,
41+
block body);
42+
43+
type _mod = hashmap[ident,item];
44+
45+
type item = tag( item_fn(@_fn),
46+
item_mod(@_mod) );
47+
248

349
//
450
// Local Variables:

0 commit comments

Comments
 (0)