diff options
author | Vincent Ambo <mail@tazj.in> | 2020-07-16T19·28+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2020-07-16T19·53+0000 |
commit | 5ae2a2b847f94e39932c7abd06662d990773649a (patch) | |
tree | 0d2b45c6fb629d81a6e3fdd20f1796f3669d3335 /third_party/nix/src/libexpr/parser.hh | |
parent | d579ceb7830406ae743aa3da274017d5e8a7bfa7 (diff) |
refactor(3p/nix/libexpr): Extract static helpers out of parser.y r/1322
Moves several of the static helper functions into a new parser.cc file. Once the rest of the code is usefully extracted, these will be moved to a private namespace. Change-Id: I0d7b53dcefe31bb5c6bad3ad7f5fcb48276bf799 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1218 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
Diffstat (limited to 'third_party/nix/src/libexpr/parser.hh')
-rw-r--r-- | third_party/nix/src/libexpr/parser.hh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/nix/src/libexpr/parser.hh b/third_party/nix/src/libexpr/parser.hh index ae0e932147f5..3de8280bf5f0 100644 --- a/third_party/nix/src/libexpr/parser.hh +++ b/third_party/nix/src/libexpr/parser.hh @@ -15,6 +15,8 @@ int yylex(YYSTYPE* yylval_param, YYLTYPE* yylloc_param, yyscan_t yyscanner, \ nix::ParseData* data) +#define CUR_POS makeCurPos(*yylocp, data) + namespace nix { struct ParseData { @@ -44,4 +46,12 @@ static void dupAttr(Symbol attr, const Pos& pos, const Pos& prevPos) { attr % pos % prevPos); } +void addAttr(ExprAttrs* attrs, AttrPath& attrPath, Expr* e, const Pos& pos); + +void addFormal(const Pos& pos, Formals* formals, const Formal& formal); + +Expr* stripIndentation(const Pos& pos, SymbolTable& symbols, + std::vector<Expr*>& es); + + } // namespace nix |