mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Use a symbol table to represent identifiers and attribute names
efficiently. The symbol table ensures that there is only one copy of each symbol, thus allowing symbols to be compared efficiently using a pointer equality test.
This commit is contained in:
parent
10e8b1fd15
commit
ac1e8f40d4
15 changed files with 228 additions and 101 deletions
|
@ -54,7 +54,7 @@ void ExprAttrs::show(std::ostream & str)
|
|||
{
|
||||
if (recursive) str << "rec ";
|
||||
str << "{ ";
|
||||
foreach (list<string>::iterator, i, inherited)
|
||||
foreach (list<Symbol>::iterator, i, inherited)
|
||||
str << "inherit " << *i << "; ";
|
||||
foreach (Attrs::iterator, i, attrs)
|
||||
str << i->first << " = " << *i->second << "; ";
|
||||
|
@ -81,9 +81,9 @@ void ExprLambda::show(std::ostream & str)
|
|||
if (i->def) str << " ? " << *i->def;
|
||||
}
|
||||
str << " }";
|
||||
if (arg != "") str << " @ ";
|
||||
if (!arg.empty()) str << " @ ";
|
||||
}
|
||||
if (arg != "") str << arg;
|
||||
if (!arg.empty()) str << arg;
|
||||
str << ": " << *body << ")";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue