nixd
Loading...
Searching...
No Matches
AST.h File Reference

This file declares some common analysis (tree walk) on the AST. More...

#include "nixd/Protocol/AttrSet.h"
#include <nixf/Basic/Nodes/Expr.h>
#include <nixf/Sema/ParentMap.h>
#include <nixf/Sema/VariableLookup.h>
#include <exception>

Go to the source code of this file.

Classes

struct  nixd::idioms::IdiomException
struct  nixd::idioms::IdiomSelectorException
 Exceptions scoped in nixd::mkIdiomSelector. More...
struct  nixd::idioms::NotAnIdiomException
 The pattern of this variable cannot be recognized by known idioms. More...
struct  nixd::idioms::VLAException
struct  nixd::idioms::NoLocationForBuiltinVariable
struct  nixd::idioms::NoSuchVarException
 No such variable. More...
struct  nixd::idioms::UndefinedVarException
struct  nixd::idioms::DynamicNameException
 The attrpath has a dynamic name, thus it cannot be trivially transformed to "static" selector. More...
struct  nixd::idioms::NotVariableSelect

Namespaces

namespace  nixd
namespace  nixd::idioms

Enumerations

enum class  nixd::FindAttrPathResult { nixd::OK , nixd::Inherit , nixd::NotAttrPath , nixd::WithDynamic }

Functions

Selector nixd::idioms::mkVarSelector (const nixf::ExprVar &Var, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM)
 Construct a nixd::Selector from Var.
Selector nixd::idioms::mkSelector (const nixf::AttrPath &AP, Selector BaseSelector)
 Construct a nixd::Selector from AP.
Selector nixd::idioms::mkSelector (const nixf::ExprSelect &Select, Selector BaseSelector)
 Construct a nixd::Selector from Select.
Selector nixd::idioms::mkSelector (const nixf::ExprSelect &Select, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM)
 Construct a nixd::Selector from Select.
const nixf::EnvNodenixd::upEnv (const nixf::Node &Desc, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM)
 Search up until there are some node associated with "EnvNode".
bool nixd::havePackageScope (const nixf::Node &N, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM)
 Determine whether or not some node has enclosed "with pkgs; [ ]".
std::pair< std::vector< std::string >, std::string > nixd::getScopeAndPrefix (const nixf::Node &N, const nixf::ParentMapAnalysis &PM)
 get variable scope, and it's prefix name.
FindAttrPathResult nixd::findAttrPath (const nixf::Node &N, const nixf::ParentMapAnalysis &PM, std::vector< std::string > &Path)
 Heuristically find attrpath suitable for "attrpath" completion.
FindAttrPathResult nixd::findAttrPathForOptions (const nixf::Node &N, const nixf::ParentMapAnalysis &PM, std::vector< std::string > &Path)
 Heuristically find attrpath suitable for "attrpath" completion. Strips "config." from the start to support config sections in NixOS modules.

Variables

constexpr std::string_view nixd::idioms::Pkgs = "pkgs"
 Hardcoded name for "pkgs.xxx", or "with pkgs;".
constexpr std::string_view nixd::idioms::Lib = "lib"
 Hardcoded name for nixpkgs "lib".

Detailed Description

This file declares some common analysis (tree walk) on the AST.

Definition in file AST.h.