diff options
| author | Graydon Hoare <[email protected]> | 2011-05-04 19:05:16 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-04 19:05:32 -0700 |
| commit | d55fa2a9a3aa00a723f224eda764580a0492abd9 (patch) | |
| tree | a4c337c74adfa68fb33547e19550b2b24a86c801 /src/comp/front/parser.rs | |
| parent | Re-snapshot to pick up fixed crasher bugs in resolve and performance improvem... (diff) | |
| download | rust-d55fa2a9a3aa00a723f224eda764580a0492abd9.tar.xz rust-d55fa2a9a3aa00a723f224eda764580a0492abd9.zip | |
Add #env syntax extension for plucking strings out of the compilation environment.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index e7a86d6e..a7e355af 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -949,6 +949,13 @@ fn expand_syntax_ext(parser p, ast.span sp, ast.ann_none); ret newexpr; + } else if (_str.eq(extname, "env")) { + auto expanded = extenv.expand_syntax_ext(p, sp, args, body); + auto newexpr = ast.expr_ext(path, args, body, + expanded, + ast.ann_none); + + ret newexpr; } else { p.err("unknown syntax extension"); fail; |