about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr/parser.y')
-rw-r--r--third_party/nix/src/libexpr/parser.y55
1 files changed, 1 insertions, 54 deletions
diff --git a/third_party/nix/src/libexpr/parser.y b/third_party/nix/src/libexpr/parser.y
index 2ea84fea66..9df9b3081a 100644
--- a/third_party/nix/src/libexpr/parser.y
+++ b/third_party/nix/src/libexpr/parser.y
@@ -11,44 +11,7 @@
 %expect 1
 %expect-rr 1
 
-%code requires {
-
-#ifndef BISON_HEADER
-#define BISON_HEADER
-
-#include <optional>
-#include <variant>
-#include "libutil/util.hh"
-#include "libexpr/nixexpr.hh"
-#include "libexpr/eval.hh"
-#include <glog/logging.h>
-
-namespace nix {
-
-    struct ParseData
-    {
-        EvalState & state;
-        SymbolTable & symbols;
-        Expr* result;
-        Path basePath;
-        std::optional<Symbol> path;
-        std::string error;
-        Symbol sLetBody;
-        ParseData(EvalState & state)
-            : state(state)
-            , symbols(state.symbols)
-            , sLetBody(symbols.Create("<let-body>"))
-            { };
-    };
-
-}
-
-#define YY_DECL int yylex \
-    (YYSTYPE * yylval_param, YYLTYPE * yylloc_param, yyscan_t yyscanner, nix::ParseData * data)
-
-#endif
-
-}
+%code requires { #include "libexpr/parser.hh" }
 
 %{
 
@@ -59,24 +22,8 @@ YY_DECL;
 
 using namespace nix;
 
-
 namespace nix {
 
-
-static void dupAttr(const AttrPath & attrPath, const Pos & pos, const Pos & prevPos)
-{
-    throw ParseError(format("attribute '%1%' at %2% already defined at %3%")
-        % showAttrPath(attrPath) % pos % prevPos);
-}
-
-
-static void dupAttr(Symbol attr, const Pos & pos, const Pos & prevPos)
-{
-    throw ParseError(format("attribute '%1%' at %2% already defined at %3%")
-        % attr % pos % prevPos);
-}
-
-
 static void addAttr(ExprAttrs * attrs, AttrPath & attrPath,
     Expr * e, const Pos & pos)
 {