mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 07:16:17 +02:00
6526d1676b
Pos objects are somewhat wasteful as they duplicate the origin file name and input type for each object. on files that produce more than one Pos when parsed this a sizeable waste of memory (one pointer per Pos). the same goes for ptr<Pos> on 64 bit machines: parsing enough source to require 8 bytes to locate a position would need at least 8GB of input and 64GB of expression memory. it's not likely that we'll hit that any time soon, so we can use a uint32_t index to locate positions instead.
24 lines
547 B
C++
24 lines
547 B
C++
#pragma once
|
|
|
|
#include "eval.hh"
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
namespace nix {
|
|
|
|
MakeError(AttrPathNotFound, Error);
|
|
MakeError(NoPositionInfo, Error);
|
|
|
|
std::pair<Value *, PosIdx> findAlongAttrPath(
|
|
EvalState & state,
|
|
const std::string & attrPath,
|
|
Bindings & autoArgs,
|
|
Value & vIn);
|
|
|
|
/* Heuristic to find the filename and lineno or a nix value. */
|
|
std::pair<std::string, uint32_t> findPackageFilename(EvalState & state, Value & v, std::string what);
|
|
|
|
std::vector<Symbol> parseAttrPath(EvalState & state, std::string_view s);
|
|
|
|
}
|