mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
Add a symbol __curPos that expands to the current source location
I.e. an attribute set { file = <string>; line = <int>; column = <int>; }.
This commit is contained in:
parent
90b5e69284
commit
fc33fd86b7
7 changed files with 43 additions and 2 deletions
|
@ -355,7 +355,12 @@ expr_select
|
|||
;
|
||||
|
||||
expr_simple
|
||||
: ID { $$ = new ExprVar(CUR_POS, data->symbols.create($1)); }
|
||||
: ID {
|
||||
if (strcmp($1, "__curPos") == 0)
|
||||
$$ = new ExprPos(CUR_POS);
|
||||
else
|
||||
$$ = new ExprVar(CUR_POS, data->symbols.create($1));
|
||||
}
|
||||
| INT { $$ = new ExprInt($1); }
|
||||
| '"' string_parts '"' {
|
||||
/* For efficiency, and to simplify parse trees a bit. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue