diff options
| author | Kevin Atkinson <kevina@cs.utah.edu> | 2012-02-01 00:20:31 -0700 |
|---|---|---|
| committer | Kevin Atkinson <kevina@cs.utah.edu> | 2012-02-03 20:41:48 -0700 |
| commit | da74a7f9ca774cd8addcb00a361bb230facc3b31 (patch) | |
| tree | 56a6c60c5d6825a02e59c8934deba409334f70e0 /src/comp/syntax/ext/base.rs | |
| parent | 5ea04c65c151708272b92d00c8448156239affb2 (diff) | |
| download | rust-da74a7f9ca774cd8addcb00a361bb230facc3b31.tar.gz rust-da74a7f9ca774cd8addcb00a361bb230facc3b31.zip | |
Make macro arg optional in syntax, again untested.
Diffstat (limited to 'src/comp/syntax/ext/base.rs')
| -rw-r--r-- | src/comp/syntax/ext/base.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/comp/syntax/ext/base.rs b/src/comp/syntax/ext/base.rs index 824931a759b..415c6cb5d9b 100644 --- a/src/comp/syntax/ext/base.rs +++ b/src/comp/syntax/ext/base.rs @@ -118,6 +118,13 @@ fn make_new_lit(cx: ext_ctxt, sp: codemap::span, lit: ast::lit_) -> ret @{id: cx.next_id(), node: ast::expr_lit(sp_lit), span: sp}; } +fn get_mac_arg(cx: ext_ctxt, sp: span, arg: ast::mac_arg) -> @ast::expr { + alt (arg) { + some(expr) {expr} + none {cx.span_fatal(sp, "missing macro args")} + } +} + fn get_mac_body(cx: ext_ctxt, sp: span, args: ast::mac_body) -> ast::mac_body_ { |
