tilde paths: construct the entire path at parse time

This commit is contained in:
Shea Levy 2015-02-19 08:51:21 -05:00
parent 4b7c9f834c
commit e3e38a048e

View file

@ -376,12 +376,7 @@ expr_simple
$$ = stripIndentation(CUR_POS, data->symbols, *$2); $$ = stripIndentation(CUR_POS, data->symbols, *$2);
} }
| PATH { $$ = new ExprPath(absPath($1, data->basePath)); } | PATH { $$ = new ExprPath(absPath($1, data->basePath)); }
| HPATH { | HPATH { $$ = new ExprPath(getEnv("HOME", "/") + string{$1 + 1}); }
auto path = string{$1 + 1};
$$ = new ExprConcatStrings(CUR_POS, false, new vector<Expr *>{
new ExprPath(getEnv("HOME", "/")),
new ExprString(data->symbols.create(path))});
}
| SPATH { | SPATH {
string path($1 + 1, strlen($1) - 2); string path($1 + 1, strlen($1) - 2);
$$ = new ExprApp(CUR_POS, $$ = new ExprApp(CUR_POS,