Add #env syntax extension for plucking strings out of the compilation environment.
This commit is contained in:
@@ -948,6 +948,13 @@ fn expand_syntax_ext(parser p, ast.span sp,
|
||||
expanded,
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user