diff options
author | Nicolas Mattia <nicolas@nmattia.com> | 2021-12-20 21:39:37 +0100 |
---|---|---|
committer | Nicolas Mattia <nicolas@nmattia.com> | 2021-12-20 21:39:37 +0100 |
commit | 9dea5768ef0e3d11725926a96eeadac81c0e2543 (patch) | |
tree | 505bb7564cf258dea2a8d84e7c589c8e4184d501 /src/libexpr/primops/fromTOML.cc | |
parent | 5d06836b9f8b675bdbaa1ce2497d704cfe5e2456 (diff) |
Clean up toml parsing code
Diffstat (limited to 'src/libexpr/primops/fromTOML.cc')
-rw-r--r-- | src/libexpr/primops/fromTOML.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libexpr/primops/fromTOML.cc b/src/libexpr/primops/fromTOML.cc index 4ec64daf2..bfea1ce34 100644 --- a/src/libexpr/primops/fromTOML.cc +++ b/src/libexpr/primops/fromTOML.cc @@ -29,8 +29,6 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va for(auto & elem: table) { auto & v2 = *state.allocAttr(v, state.symbols.create(elem.first)); - - // TODO: note about creating children here in old code visit(v2, elem.second); } } @@ -61,7 +59,7 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va case toml::value_t::offset_datetime: case toml::value_t::local_date: case toml::value_t::local_time: - // TODO: convert to string? + // We fail since Nix doesn't have date and time types throw std::runtime_error("Dates and times are not supported"); break;; case toml::value_t::empty: @@ -72,7 +70,7 @@ static void prim_fromTOML(EvalState & state, const Pos & pos, Value * * args, Va }; try { - visit(val, toml::parse(tomlStream)); // TODO give filename + visit(val, toml::parse(tomlStream, "fromTOML" /* the "filename" */)); } catch (std::exception & e) { // TODO: toml::syntax_error throw EvalError({ .msg = hintfmt("while parsing a TOML string: %s", e.what()), |