From e0b05c0fa6562bc7d3c87a66c6557ad74fdbbd8f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 24 Jan 2023 15:54:29 +0100 Subject: feat(tvix/eval): implement builtins.fromTOML This allows parsing TOML from Tvix. We can enable the eval-okay-fromTOML testcase from nix_tests. It uses the `toml` crate, and the serde integration it brings with it. Change-Id: Ic6f95aacf2aeb890116629b409752deac49dd655 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7920 Autosubmit: flokli Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/Cargo.toml | 7 +- tvix/eval/src/builtins/mod.rs | 7 + tvix/eval/src/errors.rs | 15 ++ .../src/tests/nix_tests/eval-okay-fromTOML.exp | 1 + .../src/tests/nix_tests/eval-okay-fromTOML.nix | 208 +++++++++++++++++++++ .../nix_tests/notyetpassing/eval-okay-fromTOML.exp | 1 - .../nix_tests/notyetpassing/eval-okay-fromTOML.nix | 208 --------------------- 7 files changed, 235 insertions(+), 212 deletions(-) create mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp create mode 100644 tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix delete mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp delete mode 100644 tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix (limited to 'tvix/eval') diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml index d47ad8c39737..cf46d4bbd464 100644 --- a/tvix/eval/Cargo.toml +++ b/tvix/eval/Cargo.toml @@ -27,6 +27,7 @@ serde_json = "1.0" smol_str = "0.1" tabwriter = "1.2" test-strategy = { version = "0.2.1", optional = true } +toml = "0.6.0" xml-rs = "0.8.4" [dev-dependencies] @@ -42,7 +43,7 @@ git = "https://github.com/JamesGuthrie/test-generator.git" rev = "82e799979980962aec1aa324ec6e0e4cad781f41" [features] -default = [ "impure", "arbitrary", "nix_tests", "backtrace_overflow" ] +default = ["impure", "arbitrary", "nix_tests", "backtrace_overflow"] # Enables running the Nix language test suite from the original C++ # Nix implementation (at version 2.3) against Tvix. @@ -52,10 +53,10 @@ nix_tests = [] impure = [] # Enables Arbitrary impls for internal types (required to run tests) -arbitrary = [ "proptest", "test-strategy", "imbl/proptest" ] +arbitrary = ["proptest", "test-strategy", "imbl/proptest"] # For debugging use only; not appropriate for production use. -backtrace_overflow = [ "backtrace-on-stack-overflow" ] +backtrace_overflow = ["backtrace-on-stack-overflow"] [[bench]] name = "eval" diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index b1ea408a8ca4..4f3c93ec1451 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -355,6 +355,13 @@ mod pure_builtins { Ok(json_str.into()) } + #[builtin("fromTOML")] + fn builtin_from_toml(_: &mut VM, toml: Value) -> Result { + let toml_str = toml.to_str()?; + + toml::from_str(&toml_str).map_err(|err| err.into()) + } + #[builtin("genericClosure")] fn builtin_generic_closure(vm: &mut VM, input: Value) -> Result { let attrs = input.to_attrs()?; diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index ccc2d8976440..8c0d6124201e 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -134,6 +134,9 @@ pub enum ErrorKind { /// Errors converting JSON to a value FromJsonError(String), + /// Errors converting TOML to a value + FromTomlError(String), + /// An unexpected argument was supplied to a function that takes formal parameters UnexpectedArgument { arg: NixString, @@ -246,6 +249,12 @@ impl From for ErrorKind { } } +impl From for ErrorKind { + fn from(err: toml::de::Error) -> Self { + Self::FromTomlError(format!("error in TOML serialization: {err}")) + } +} + #[derive(Clone, Debug)] pub struct Error { kind: ErrorKind, @@ -434,6 +443,10 @@ to a missing value in the attribute set(s) included via `with`."#, write!(f, "Error converting JSON to a Nix value: {msg}") } + ErrorKind::FromTomlError(msg) => { + write!(f, "Error converting TOML to a Nix value: {msg}") + } + ErrorKind::UnexpectedArgument { arg, .. } => { write!( f, @@ -749,6 +762,7 @@ impl Error { | ErrorKind::ImportCompilerError { .. } | ErrorKind::IO { .. } | ErrorKind::FromJsonError(_) + | ErrorKind::FromTomlError(_) | ErrorKind::Xml(_) | ErrorKind::TvixError(_) | ErrorKind::TvixBug { .. } @@ -795,6 +809,7 @@ impl Error { ErrorKind::RelativePathResolution(_) => "E032", ErrorKind::DivisionByZero => "E033", ErrorKind::Xml(_) => "E034", + ErrorKind::FromTomlError(_) => "E035", // Special error code for errors from other Tvix // components. We may want to introduce a code namespacing diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp new file mode 100644 index 000000000000..d0dd3af2c814 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.exp @@ -0,0 +1 @@ +[ { clients = { data = [ [ "gamma" "delta" ] [ 1 2 ] ]; hosts = [ "alpha" "omega" ]; }; database = { connection_max = 5000; enabled = true; ports = [ 8001 8001 8002 ]; server = "192.168.1.1"; }; owner = { name = "Tom Preston-Werner"; }; servers = { alpha = { dc = "eqdc10"; ip = "10.0.0.1"; }; beta = { dc = "eqdc10"; ip = "10.0.0.2"; }; }; title = "TOML Example"; } { "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; name = "Orange"; oct1 = 342391; oct2 = 493; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; } { metadata = { "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"; "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"; "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"; "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"; }; package = [ { dependencies = [ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "aho-corasick"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.6.4"; } { name = "ansi_term"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.9.0"; } { dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "atty"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.2.10"; } ]; } { a = [ [ { b = true; } ] ]; c = [ [ { d = true; } ] ]; e = [ [ 123 ] ]; } ] diff --git a/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix new file mode 100644 index 000000000000..963932689942 --- /dev/null +++ b/tvix/eval/src/tests/nix_tests/eval-okay-fromTOML.nix @@ -0,0 +1,208 @@ +[ + + (builtins.fromTOML '' + # This is a TOML document. + + title = "TOML Example" + + [owner] + name = "Tom Preston-Werner" + #dob = 1979-05-27T07:32:00-08:00 # First class dates + + [database] + server = "192.168.1.1" + ports = [ 8001, 8001, 8002 ] + connection_max = 5000 + enabled = true + + [servers] + + # Indentation (tabs and/or spaces) is allowed but not required + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + + [clients] + data = [ ["gamma", "delta"], [1, 2] ] + + # Line breaks are OK when inside arrays + hosts = [ + "alpha", + "omega" + ] + '') + + (builtins.fromTOML '' + key = "value" + bare_key = "value" + bare-key = "value" + 1234 = "value" + + "127.0.0.1" = "value" + "character encoding" = "value" + "ʎǝʞ" = "value" + 'key2' = "value" + 'quoted "value"' = "value" + + name = "Orange" + + physical.color = "orange" + physical.shape = "round" + site."google.com" = true + + # This is legal according to the spec, but cpptoml doesn't handle it. + #a.b.c = 1 + #a.d = 2 + + str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." + + int1 = +99 + int2 = 42 + int3 = 0 + int4 = -17 + int5 = 1_000 + int6 = 5_349_221 + int7 = 1_2_3_4_5 + + hex1 = 0xDEADBEEF + hex2 = 0xdeadbeef + hex3 = 0xdead_beef + + oct1 = 0o01234567 + oct2 = 0o755 + + bin1 = 0b11010110 + + flt1 = +1.0 + flt2 = 3.1415 + flt3 = -0.01 + flt4 = 5e+22 + flt5 = 1e6 + flt6 = -2E-2 + flt7 = 6.626e-34 + flt8 = 9_224_617.445_991_228_313 + + bool1 = true + bool2 = false + + # FIXME: not supported because Nix doesn't have a date/time type. + #odt1 = 1979-05-27T07:32:00Z + #odt2 = 1979-05-27T00:32:00-07:00 + #odt3 = 1979-05-27T00:32:00.999999-07:00 + #odt4 = 1979-05-27 07:32:00Z + #ldt1 = 1979-05-27T07:32:00 + #ldt2 = 1979-05-27T00:32:00.999999 + #ld1 = 1979-05-27 + #lt1 = 07:32:00 + #lt2 = 00:32:00.999999 + + arr1 = [ 1, 2, 3 ] + arr2 = [ "red", "yellow", "green" ] + arr3 = [ [ 1, 2 ], [3, 4, 5] ] + arr4 = [ "all", 'strings', """are the same""", ''''type''''] + arr5 = [ [ 1, 2 ], ["a", "b", "c"] ] + + arr7 = [ + 1, 2, 3 + ] + + arr8 = [ + 1, + 2, # this is ok + ] + + [table-1] + key1 = "some string" + key2 = 123 + + + [table-2] + key1 = "another string" + key2 = 456 + + [dog."tater.man"] + type.name = "pug" + + [a.b.c] + [ d.e.f ] + [ g . h . i ] + [ j . "ʞ" . 'l' ] + [x.y.z.w] + + name = { first = "Tom", last = "Preston-Werner" } + point = { x = 1, y = 2 } + animal = { type.name = "pug" } + + [[products]] + name = "Hammer" + sku = 738594937 + + [[products]] + + [[products]] + name = "Nail" + sku = 284758393 + color = "gray" + + [[fruit]] + name = "apple" + + [fruit.physical] + color = "red" + shape = "round" + + [[fruit.variety]] + name = "red delicious" + + [[fruit.variety]] + name = "granny smith" + + [[fruit]] + name = "banana" + + [[fruit.variety]] + name = "plantain" + '') + + (builtins.fromTOML '' + [[package]] + name = "aho-corasick" + version = "0.6.4" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [[package]] + name = "ansi_term" + version = "0.9.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + + [[package]] + name = "atty" + version = "0.2.10" + source = "registry+https://github.com/rust-lang/crates.io-index" + dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + ] + + [metadata] + "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" + "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" + "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" + "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" + '') + + (builtins.fromTOML '' + a = [[{ b = true }]] + c = [ [ { d = true } ] ] + e = [[123]] + '') + +] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp deleted file mode 100644 index d0dd3af2c814..000000000000 --- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.exp +++ /dev/null @@ -1 +0,0 @@ -[ { clients = { data = [ [ "gamma" "delta" ] [ 1 2 ] ]; hosts = [ "alpha" "omega" ]; }; database = { connection_max = 5000; enabled = true; ports = [ 8001 8001 8002 ]; server = "192.168.1.1"; }; owner = { name = "Tom Preston-Werner"; }; servers = { alpha = { dc = "eqdc10"; ip = "10.0.0.1"; }; beta = { dc = "eqdc10"; ip = "10.0.0.2"; }; }; title = "TOML Example"; } { "1234" = "value"; "127.0.0.1" = "value"; a = { b = { c = { }; }; }; arr1 = [ 1 2 3 ]; arr2 = [ "red" "yellow" "green" ]; arr3 = [ [ 1 2 ] [ 3 4 5 ] ]; arr4 = [ "all" "strings" "are the same" "type" ]; arr5 = [ [ 1 2 ] [ "a" "b" "c" ] ]; arr7 = [ 1 2 3 ]; arr8 = [ 1 2 ]; bare-key = "value"; bare_key = "value"; bin1 = 214; bool1 = true; bool2 = false; "character encoding" = "value"; d = { e = { f = { }; }; }; dog = { "tater.man" = { type = { name = "pug"; }; }; }; flt1 = 1; flt2 = 3.1415; flt3 = -0.01; flt4 = 5e+22; flt5 = 1e+06; flt6 = -0.02; flt7 = 6.626e-34; flt8 = 9.22462e+06; fruit = [ { name = "apple"; physical = { color = "red"; shape = "round"; }; variety = [ { name = "red delicious"; } { name = "granny smith"; } ]; } { name = "banana"; variety = [ { name = "plantain"; } ]; } ]; g = { h = { i = { }; }; }; hex1 = 3735928559; hex2 = 3735928559; hex3 = 3735928559; int1 = 99; int2 = 42; int3 = 0; int4 = -17; int5 = 1000; int6 = 5349221; int7 = 12345; j = { "ʞ" = { l = { }; }; }; key = "value"; key2 = "value"; name = "Orange"; oct1 = 342391; oct2 = 493; physical = { color = "orange"; shape = "round"; }; products = [ { name = "Hammer"; sku = 738594937; } { } { color = "gray"; name = "Nail"; sku = 284758393; } ]; "quoted \"value\"" = "value"; site = { "google.com" = true; }; str = "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."; table-1 = { key1 = "some string"; key2 = 123; }; table-2 = { key1 = "another string"; key2 = 456; }; x = { y = { z = { w = { animal = { type = { name = "pug"; }; }; name = { first = "Tom"; last = "Preston-Werner"; }; point = { x = 1; y = 2; }; }; }; }; }; "ʎǝʞ" = "value"; } { metadata = { "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"; "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"; "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"; "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"; }; package = [ { dependencies = [ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "aho-corasick"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.6.4"; } { name = "ansi_term"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.9.0"; } { dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" ]; name = "atty"; source = "registry+https://github.com/rust-lang/crates.io-index"; version = "0.2.10"; } ]; } { a = [ [ { b = true; } ] ]; c = [ [ { d = true; } ] ]; e = [ [ 123 ] ]; } ] diff --git a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix b/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix deleted file mode 100644 index 963932689942..000000000000 --- a/tvix/eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML.nix +++ /dev/null @@ -1,208 +0,0 @@ -[ - - (builtins.fromTOML '' - # This is a TOML document. - - title = "TOML Example" - - [owner] - name = "Tom Preston-Werner" - #dob = 1979-05-27T07:32:00-08:00 # First class dates - - [database] - server = "192.168.1.1" - ports = [ 8001, 8001, 8002 ] - connection_max = 5000 - enabled = true - - [servers] - - # Indentation (tabs and/or spaces) is allowed but not required - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - - [clients] - data = [ ["gamma", "delta"], [1, 2] ] - - # Line breaks are OK when inside arrays - hosts = [ - "alpha", - "omega" - ] - '') - - (builtins.fromTOML '' - key = "value" - bare_key = "value" - bare-key = "value" - 1234 = "value" - - "127.0.0.1" = "value" - "character encoding" = "value" - "ʎǝʞ" = "value" - 'key2' = "value" - 'quoted "value"' = "value" - - name = "Orange" - - physical.color = "orange" - physical.shape = "round" - site."google.com" = true - - # This is legal according to the spec, but cpptoml doesn't handle it. - #a.b.c = 1 - #a.d = 2 - - str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF." - - int1 = +99 - int2 = 42 - int3 = 0 - int4 = -17 - int5 = 1_000 - int6 = 5_349_221 - int7 = 1_2_3_4_5 - - hex1 = 0xDEADBEEF - hex2 = 0xdeadbeef - hex3 = 0xdead_beef - - oct1 = 0o01234567 - oct2 = 0o755 - - bin1 = 0b11010110 - - flt1 = +1.0 - flt2 = 3.1415 - flt3 = -0.01 - flt4 = 5e+22 - flt5 = 1e6 - flt6 = -2E-2 - flt7 = 6.626e-34 - flt8 = 9_224_617.445_991_228_313 - - bool1 = true - bool2 = false - - # FIXME: not supported because Nix doesn't have a date/time type. - #odt1 = 1979-05-27T07:32:00Z - #odt2 = 1979-05-27T00:32:00-07:00 - #odt3 = 1979-05-27T00:32:00.999999-07:00 - #odt4 = 1979-05-27 07:32:00Z - #ldt1 = 1979-05-27T07:32:00 - #ldt2 = 1979-05-27T00:32:00.999999 - #ld1 = 1979-05-27 - #lt1 = 07:32:00 - #lt2 = 00:32:00.999999 - - arr1 = [ 1, 2, 3 ] - arr2 = [ "red", "yellow", "green" ] - arr3 = [ [ 1, 2 ], [3, 4, 5] ] - arr4 = [ "all", 'strings', """are the same""", ''''type''''] - arr5 = [ [ 1, 2 ], ["a", "b", "c"] ] - - arr7 = [ - 1, 2, 3 - ] - - arr8 = [ - 1, - 2, # this is ok - ] - - [table-1] - key1 = "some string" - key2 = 123 - - - [table-2] - key1 = "another string" - key2 = 456 - - [dog."tater.man"] - type.name = "pug" - - [a.b.c] - [ d.e.f ] - [ g . h . i ] - [ j . "ʞ" . 'l' ] - [x.y.z.w] - - name = { first = "Tom", last = "Preston-Werner" } - point = { x = 1, y = 2 } - animal = { type.name = "pug" } - - [[products]] - name = "Hammer" - sku = 738594937 - - [[products]] - - [[products]] - name = "Nail" - sku = 284758393 - color = "gray" - - [[fruit]] - name = "apple" - - [fruit.physical] - color = "red" - shape = "round" - - [[fruit.variety]] - name = "red delicious" - - [[fruit.variety]] - name = "granny smith" - - [[fruit]] - name = "banana" - - [[fruit.variety]] - name = "plantain" - '') - - (builtins.fromTOML '' - [[package]] - name = "aho-corasick" - version = "0.6.4" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [[package]] - name = "ansi_term" - version = "0.9.0" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] - name = "atty" - version = "0.2.10" - source = "registry+https://github.com/rust-lang/crates.io-index" - dependencies = [ - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - ] - - [metadata] - "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" - "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" - "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" - "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" - '') - - (builtins.fromTOML '' - a = [[{ b = true }]] - c = [ [ { d = true } ] ] - e = [[123]] - '') - -] -- cgit 1.4.1