diff --git a/Cargo.lock b/Cargo.lock index 7258db4b..de384ef5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,26 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -19,9 +34,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "ascii-canvas" @@ -34,9 +49,9 @@ dependencies = [ [[package]] name = "assert_matches" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "atty" @@ -57,52 +72,45 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad235dabf00f36301792cfe82499880ba54c6486be094d1047b02bacb67c14e8" -dependencies = [ - "backtrace-sys", - "cfg-if", - "libc", - "rustc-demangle", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.34" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca797db0057bae1a7aa2eef3283a874695455cecf08a43bfb8507ee0ebc1ed69" +checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" dependencies = [ + "addr2line", "cc", + "cfg-if 1.0.0", "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] [[package]] name = "base64" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bit-set" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.5.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" @@ -112,9 +120,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "blake2b_simd" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", "arrayvec", @@ -144,9 +152,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.11" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502ae1441a0a5adb8fbd38a5955a6416b9493e92b465de5e4a9bde6a539c2c48" +checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" dependencies = [ "lazy_static", "memchr", @@ -156,9 +164,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.2.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "byte-tools" @@ -168,24 +176,24 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cast" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" dependencies = [ "rustc_version", ] [[package]] name = "cc" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" +checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" [[package]] name = "cfg-if" @@ -193,28 +201,47 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" -version = "0.4.11" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", "num-traits", "time", + "winapi", ] [[package]] name = "clap" -version = "2.33.0" +version = "2.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ "bitflags", "textwrap", "unicode-width", ] +[[package]] +name = "clipboard-win" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4ea1881992efc993e4dc50a324cdbd03216e41bdc8385720ff47efc9bd2ca8" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -232,16 +259,16 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "criterion" -version = "0.3.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc755679c12bda8e5523a71e4d654b6bf2e14bd838dfc48cde6559a05caf7d1" +checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "itertools", + "itertools 0.10.1", "lazy_static", "num-traits", "oorandom", @@ -249,6 +276,7 @@ dependencies = [ "rayon", "regex", "serde", + "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -257,66 +285,63 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545" +checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" dependencies = [ "cast", - "itertools", + "itertools 0.10.1", ] [[package]] -name = "crossbeam-deque" -version = "0.7.3" +name = "crossbeam-channel" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "crossbeam-epoch", + "cfg-if 1.0.0", "crossbeam-utils", - "maybe-uninit", ] [[package]] -name = "crossbeam-epoch" -version = "0.8.2" +name = "crossbeam-deque" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "cfg-if 1.0.0", + "crossbeam-epoch", "crossbeam-utils", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", ] [[package]] -name = "crossbeam-queue" -version = "0.2.1" +name = "crossbeam-epoch" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "cfg-if 1.0.0", "lazy_static", ] [[package]] name = "csv" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", @@ -336,11 +361,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.1.4" +version = "3.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4ba686dff9fa4c1c9636ce1010b0cf98ceb421361b0bb3d6faeec43bd217a7" +checksum = "232295399409a8b7ae41276757b5a1cc21032848d42bff2352261f958b3ca29a" dependencies = [ - "nix", + "nix 0.20.0", "winapi", ] @@ -366,7 +391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", "winapi", ] @@ -376,27 +401,47 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" -version = "0.3.4" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users 0.4.0", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ - "cfg-if", "libc", - "redox_users", + "redox_users 0.4.0", "winapi", ] [[package]] name = "docopt" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f525a586d310c87df72ebcd98009e57f1cc030c8c268305287a476beb653969" +checksum = "7f3f119846c823f9eafcf953a8f6ffb6ed69bf6240883261a7f13b634579a51f" dependencies = [ "lazy_static", "regex", @@ -406,9 +451,9 @@ dependencies = [ [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "ena" @@ -419,11 +464,27 @@ dependencies = [ "log", ] +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "error-code" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5115567ac25674e0043e472be13d14e537f37ea8aa4bdc4aef0c89add1db1ff" +dependencies = [ + "libc", + "str-buf", +] + [[package]] name = "failure" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" dependencies = [ "backtrace", "failure_derive", @@ -431,9 +492,9 @@ dependencies = [ [[package]] name = "failure_derive" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", @@ -447,6 +508,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fd-lock" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0010f02effd88c702318c5dde0463206be67495d0b4d906ba7c0a8f166cc7f06" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "fixedbitset" version = "0.1.9" @@ -461,29 +532,52 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.10.2+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" + +[[package]] +name = "half" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" + [[package]] name = "hermit-abi" -version = "0.1.8" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -497,17 +591,26 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" -version = "0.3.36" +version = "0.3.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752" dependencies = [ "wasm-bindgen", ] @@ -524,7 +627,7 @@ dependencies = [ "diff", "docopt", "ena", - "itertools", + "itertools 0.8.2", "lalrpop-util", "petgraph", "regex", @@ -551,38 +654,42 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.67" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" +checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "log" -version = "0.4.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "memchr" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] -name = "memchr" -version = "2.3.3" +name = "memoffset" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +dependencies = [ + "autocfg 1.0.1", +] [[package]] -name = "memoffset" -version = "0.5.3" +name = "miniz_oxide" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "rustc_version", + "adler", + "autocfg 1.0.1", ] [[package]] @@ -591,6 +698,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + [[package]] name = "nix" version = "0.17.0" @@ -599,35 +715,47 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", "libc", "void", ] +[[package]] +name = "nix" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "num-integer" -version = "0.1.42" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] name = "num_cpus" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ "hermit-abi", "libc", @@ -639,11 +767,20 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" +[[package]] +name = "object" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386" +dependencies = [ + "memchr", +] + [[package]] name = "oorandom" -version = "11.1.0" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcec7c9c2a95cacc7cd0ecb89d8a8454eca13906f6deb55258ffff0adeb9405" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "opaque-debug" @@ -659,7 +796,7 @@ checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" [[package]] name = "oursh" -version = "0.4.1" +version = "0.4.2" dependencies = [ "assert_matches", "chrono", @@ -669,9 +806,10 @@ dependencies = [ "docopt", "lalrpop", "lalrpop-util", - "nix", + "nix 0.17.0", "pwd", "retain_mut", + "rustyline", "termion", ] @@ -706,16 +844,32 @@ dependencies = [ [[package]] name = "plotters" -version = "0.2.12" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3bb8da247d27ae212529352020f3e5ee16e83c0c258061d27b08ab92675eeb" +checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" dependencies = [ - "js-sys", "num-traits", + "plotters-backend", + "plotters-svg", "wasm-bindgen", "web-sys", ] +[[package]] +name = "plotters-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" + +[[package]] +name = "plotters-svg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +dependencies = [ + "plotters-backend", +] + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -724,18 +878,18 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro2" -version = "1.0.9" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" dependencies = [ "unicode-xid", ] [[package]] name = "pwd" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd32d8bece608e144ca20251e714ed107cdecdabb20c2d383cfc687825106a5" +checksum = "f9ca0304857594109dca88140120427c7a65027be6b77d86a5938588e79cb07b" dependencies = [ "failure", "libc", @@ -743,13 +897,23 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.3" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + [[package]] name = "rand" version = "0.6.5" @@ -858,10 +1022,11 @@ dependencies = [ [[package]] name = "rayon" -version = "1.3.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ + "autocfg 1.0.1", "crossbeam-deque", "either", "rayon-core", @@ -869,12 +1034,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.7.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ + "crossbeam-channel", "crossbeam-deque", - "crossbeam-queue", "crossbeam-utils", "lazy_static", "num_cpus", @@ -891,56 +1056,71 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] [[package]] name = "redox_termios" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" dependencies = [ - "redox_syscall", + "redox_syscall 0.2.10", ] [[package]] name = "redox_users" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", - "redox_syscall", + "getrandom 0.1.16", + "redox_syscall 0.1.57", "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.3", + "redox_syscall 0.2.10", +] + [[package]] name = "regex" -version = "1.3.4" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" -dependencies = [ - "byteorder", -] +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.16" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "retain_mut" @@ -950,9 +1130,9 @@ checksum = "e9c17925a9027d298a4603d286befe3f9dc0e8ed02523141914eb628798d6e5b" [[package]] name = "rust-argon2" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ "base64", "blake2b_simd", @@ -962,24 +1142,48 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" [[package]] name = "rustc_version" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] +[[package]] +name = "rustyline" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd4eaf7a7738f76c98e4f0395253ae853be3eb018f7b0bb57fe1b6c17e31874" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "clipboard-win", + "dirs-next", + "fd-lock", + "libc", + "log", + "memchr", + "nix 0.20.0", + "radix_trie", + "scopeguard", + "smallvec", + "unicode-segmentation", + "unicode-width", + "utf8parse", + "winapi", +] + [[package]] name = "ryu" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "same-file" @@ -998,33 +1202,34 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" [[package]] -name = "semver-parser" -version = "0.7.0" +name = "serde" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +dependencies = [ + "serde_derive", +] [[package]] -name = "serde" -version = "1.0.104" +name = "serde_cbor" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" dependencies = [ - "serde_derive", + "half", + "serde", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" dependencies = [ "proc-macro2", "quote", @@ -1033,9 +1238,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.48" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" +checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" dependencies = [ "itoa", "ryu", @@ -1044,9 +1249,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ "block-buffer", "digest", @@ -1060,6 +1265,18 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +[[package]] +name = "smallvec" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" + +[[package]] +name = "str-buf" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" + [[package]] name = "string_cache" version = "0.7.5" @@ -1096,15 +1313,15 @@ checksum = "b1884d1bc09741d466d9b14e6d37ac89d6909cbcac41dd9ae982d4d063bbedfc" [[package]] name = "strsim" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.16" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" +checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" dependencies = [ "proc-macro2", "quote", @@ -1113,9 +1330,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" dependencies = [ "proc-macro2", "quote", @@ -1136,13 +1353,13 @@ dependencies = [ [[package]] name = "termion" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22cec9d8978d906be5ac94bceb5a010d885c626c4c8855721a4dbd20e3ac905" +checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" dependencies = [ "libc", "numtoa", - "redox_syscall", + "redox_syscall 0.2.10", "redox_termios", ] @@ -1155,31 +1372,21 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - [[package]] name = "time" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "redox_syscall", "winapi", ] [[package]] name = "tinytemplate" -version = "1.0.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", @@ -1187,21 +1394,33 @@ dependencies = [ [[package]] name = "typenum" -version = "1.11.2" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" + +[[package]] +name = "unicode-segmentation" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "utf8parse" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" [[package]] name = "void" @@ -1211,9 +1430,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "walkdir" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", "winapi", @@ -1226,21 +1445,27 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" -version = "0.2.59" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" +checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.59" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" +checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f" dependencies = [ "bumpalo", "lazy_static", @@ -1253,9 +1478,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.59" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" +checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1263,9 +1488,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.59" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" +checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f" dependencies = [ "proc-macro2", "quote", @@ -1276,15 +1501,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.59" +version = "0.2.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" +checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2" [[package]] name = "web-sys" -version = "0.3.36" +version = "0.3.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" +checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696" dependencies = [ "js-sys", "wasm-bindgen", @@ -1292,9 +1517,9 @@ dependencies = [ [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -1308,9 +1533,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi", ] diff --git a/Cargo.toml b/Cargo.toml index ba4a64e3..61c7fc05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oursh" -version = "0.4.1" +version = "0.4.2" edition = "2018" authors = ["Nathan Lilienthal "] description = "Modern, fast POSIX compatible shell" @@ -52,6 +52,7 @@ ctrlc = "3.1" #termios = "*" # Option 2: http://ticki.github.io/blog/making-terminal-applications-in-rust-with-termion/ termion = "1.5" +rustyline = "*" retain_mut = "0.1" diff --git a/src/lib.rs b/src/lib.rs index 2263d7fd..c3fd2cc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -192,7 +192,7 @@ macro_rules! debug { pub mod process; pub mod program; -pub mod repl; +// pub mod repl; #[macro_use] diff --git a/src/main.rs b/src/main.rs index 227ea4c1..6d9127c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ extern crate termion; extern crate dirs; use std::{ - env, + env::{self, var}, process::Termination, fs::File, io::{self, Read}, @@ -15,19 +15,22 @@ use std::{ rc::Rc, }; use nix::sys::wait::WaitStatus; -use nix::unistd::Pid; +use nix::unistd::{gethostname, Pid}; +use dirs::home_dir; use docopt::{Docopt, Value}; use termion::is_tty; -use dirs::home_dir; +use rustyline::{ + Editor, + error::ReadlineError, +}; use oursh::{ - repl::{ - self, - Prompt, - }, program::{parse_and_run, Result, Error}, process::{Jobs, IO}, }; +pub const NAME: &'static str = "oursh"; +pub const VERSION: &'static str = env!("CARGO_PKG_VERSION"); + // Write the Docopt usage string. const USAGE: &'static str = " Usage: @@ -48,7 +51,7 @@ Options: // fn main() -> MainResult { // Parse argv and exit the program with an error message if it fails. - let mut args = Docopt::new(USAGE) + let args = Docopt::new(USAGE) .and_then(|d| d.argv(env::args().into_iter()).parse()) .unwrap_or_else(|e| e.exit()); @@ -56,7 +59,7 @@ fn main() -> MainResult { let mut jobs: Jobs = Rc::new(RefCell::new(vec![])); // Default inputs and outputs. - let mut io = IO::default(); + let io = IO::default(); // Run the profile before anything else. // TODO: @@ -69,7 +72,7 @@ fn main() -> MainResult { if let Ok(mut file) = File::open(path) { let mut contents = String::new(); if let Ok(_) = file.read_to_string(&mut contents) { - if let Err(e) = parse_and_run(&contents, io, &mut jobs, &args) { + if let Err(e) = parse_and_run(&contents, io, &mut jobs, &args, None) { eprintln!("failed to source profile: {:?}", e); } } @@ -78,7 +81,7 @@ fn main() -> MainResult { } if let Some(Value::Plain(Some(ref c))) = args.find("") { - MainResult(parse_and_run(c, io, &mut jobs, &args)) + MainResult(parse_and_run(c, io, &mut jobs, &args, None)) } else if let Some(Value::Plain(Some(ref filename))) = args.find("") { let mut file = File::open(filename) .expect(&format!("error opening file: {}", filename)); @@ -89,7 +92,7 @@ fn main() -> MainResult { .expect("error reading file"); // Run the program. - MainResult(parse_and_run(&text, io, &mut jobs, &args)) + MainResult(parse_and_run(&text, io, &mut jobs, &args, None)) } else { // Standard input file descriptor (0), used for user input from the // user of the shell. @@ -102,29 +105,86 @@ fn main() -> MainResult { // Process text in raw mode style if we're attached to a tty. if is_tty(&stdin) { - // Standard output file descriptor (1), used to display program output - // to the user of the shell. - let stdout = io::stdout(); + // // Standard output file descriptor (1), used to display program output + // // to the user of the shell. + // let stdout = io::stdout(); + + + let home = env::var("HOME").expect("HOME variable not set."); + let history_path = format!("{}/.oursh_history", home); + + let mut rl = Editor::<()>::new(); + if rl.load_history(&history_path).is_err() { + println!("No previous history."); + } // Trap SIGINT. - ctrlc::set_handler(move || { - // noop for now. - }).unwrap(); - - // Start a program running repl. - // A styled static (for now) prompt. - let prompt = Prompt::sh_style(); - repl::start(prompt, stdin, stdout, &mut io, &mut jobs, &mut args); - MainResult(Ok(WaitStatus::Exited(Pid::this(), 0))) + ctrlc::set_handler(move || println!()).unwrap(); + + let code; + loop { + let prompt = expand_prompt(env::var("PS1").unwrap_or("\\s-\\v\\$ ".into())); + let readline = rl.readline(&prompt); + match readline { + Ok(line) => { + parse_and_run(&line, io, &mut jobs, &args, Some(&mut rl)).unwrap(); + }, + Err(ReadlineError::Interrupted) => { + println!("^C"); + continue; + }, + Err(ReadlineError::Eof) => { + println!("exit"); + code = 0; + break; + }, + Err(err) => { + println!("error: {:?}", err); + code = 130; + break; + } + } + } + + rl.save_history(&history_path).unwrap(); + MainResult(Ok(WaitStatus::Exited(Pid::this(), code))) } else { // Fill a string buffer from STDIN. let mut text = String::new(); stdin.lock().read_to_string(&mut text).unwrap(); // Run the program. - MainResult(parse_and_run(&text, io, &mut jobs, &args)) + MainResult(parse_and_run(&text, io, &mut jobs, &args, None)) + } + } +} + +fn expand_prompt(prompt: String) -> String { + let mut result = String::new(); + let mut command = false; + for c in prompt.chars() { + if command { + // TODO: https://ss64.com/bash/syntax-prompt.html + result += &match c { + 'h' => { + let mut buf = [0u8; 64]; + let cstr = gethostname(&mut buf).expect("error getting hostname"); + cstr.to_str().expect("error invalid UTF-8").into() + } + 'u' => var("USER").unwrap_or("".into()), + 'w' => var("PWD").unwrap_or("".into()), + 's' => NAME.into(), + 'v' => VERSION[0..(VERSION.len() - 2)].into(), + '\\' => "".into(), + c => c.into(), + }; + } else if c == '\\' { + command = true; + } else { + result.push(c); } } + result } #[derive(Debug)] diff --git a/src/program.rs b/src/program.rs index 5bac54ec..4cc4db83 100644 --- a/src/program.rs +++ b/src/program.rs @@ -69,6 +69,7 @@ use nix::{ sys::wait::WaitStatus, }; use docopt::ArgvMap; +use rustyline::Editor; use crate::{ process::{retain_alive_jobs, IO, Jobs}, }; @@ -209,7 +210,7 @@ pub mod posix; pub use self::posix::Program as PosixProgram; // TODO: Replace program::Result -pub fn parse_and_run<'a>(text: &str, io: IO, jobs: &'a mut Jobs, args: &'a ArgvMap) +pub fn parse_and_run<'a>(text: &str, io: IO, jobs: &'a mut Jobs, args: &'a ArgvMap, rl: Option<&'a mut Editor<()>>) -> crate::program::Result { let result = if text.is_empty() { @@ -224,6 +225,8 @@ pub fn parse_and_run<'a>(text: &str, io: IO, jobs: &'a mut Jobs, args: &'a ArgvM } }; + if let Some(editor) = rl { editor.add_history_entry(text); } + // Print the program if the flag is given. if args.get_bool("--ast") { eprintln!("{:#?}", program); diff --git a/src/program/posix.lalrpop b/src/program/posix.lalrpop index 483940eb..b1865abb 100644 --- a/src/program/posix.lalrpop +++ b/src/program/posix.lalrpop @@ -20,7 +20,6 @@ extern { "`" => lex::Token::Backtick, "!" => lex::Token::Bang, "|" => lex::Token::Pipe, - "$" => lex::Token::Dollar, "=" => lex::Token::Equals, "\\" => lex::Token::Backslash, "\"" => lex::Token::DoubleQuote, @@ -41,6 +40,7 @@ extern { "else" => lex::Token::Else, "elif" => lex::Token::Elif, "fi" => lex::Token::Fi, + "export" => lex::Token::Export, "WORD" => lex::Token::Word(<&'input str>), "IO_NUMBER" => lex::Token::IoNumber(), "{#" => lex::Token::HashLang(<&'input str>), @@ -161,6 +161,11 @@ Simple: ast::Command = { ast::Word(w.to_string()) }).collect(), redirects) }, + + // Export support. + "export" => { + ast::Command::Simple(assignments, vec![], vec![]) + }, } Redirect: ast::Redirect = { @@ -226,7 +231,12 @@ File: ast::Redirect = { // }, // } +// pub Word: ast::Word = { +// => ast::Word(w.into()), +// "$" => ast::Word(var(v).unwrap_or(format!("${}", v))), +// } + Assignment: ast::Assignment = { // TODO: Variable expansion. - "=" => ast::Assignment(n.into(), v.into()), + "=" => ast::Assignment(k.into(), v.into()), } diff --git a/src/program/posix.rs b/src/program/posix.rs index 7374926e..f0768de5 100644 --- a/src/program/posix.rs +++ b/src/program/posix.rs @@ -120,13 +120,14 @@ use std::{ process::{self, Stdio}, fs::File, os::unix::io::IntoRawFd, - env::set_var, + env::{var, set_var} }; use lalrpop_util::ParseError; use nix::{ sys::wait::WaitStatus, unistd::Pid, }; +use dirs::home_dir; use crate::{ process::{ProcessGroup, Process, Jobs}, program::{Result, Error, IO}, @@ -213,7 +214,7 @@ impl super::Run for Command { match *self { Command::Simple(ref assignments, ref words, ref redirects) => { for Assignment(name, value) in assignments { - set_var(name, value); + set_var(name, expand_vars(value)); } for r in redirects { @@ -249,8 +250,12 @@ impl super::Run for Command { }; } - let argv: Vec = words.iter().map(|w| { - CString::new(&w.0 as &str) + // expand order: variables then home + // $ FOO=~ + // $ echo $FOO + // /home/nixpulvis + let argv: Vec = words.iter().map(|word| { + CString::new(&expand_home(&expand_vars(&word.0)) as &str) .expect("error in word UTF-8") }).collect(); @@ -259,6 +264,7 @@ impl super::Run for Command { // TODO: IO for builtins. ":" => builtin::Null::run(argv, jobs), "exit" => builtin::Exit::run(argv, jobs), + "export" => builtin::Export::run(argv, jobs), "cd" => builtin::Cd::run(argv, jobs), "jobs" => builtin::Jobs::run(argv, jobs), _ => { @@ -279,12 +285,14 @@ impl super::Run for Command { Ok(WaitStatus::Exited(Pid::this(), 0)) } }, + // { sleep 3; date; }& + // { sleep 3; date; }& ls Command::Compound(ref commands) => { - // TODO: Need a way to run a set of commands as one in the - // background. Kinda like a subshell. + // TODO: Need a way to run a set of commands as one in the background. Kinda like a + // subshell. For now we just run them both as background as needed. let mut last = WaitStatus::Exited(Pid::this(), 0); for command in commands.iter() { - last = command.run(false, io, jobs)?; + last = command.run(background, io, jobs)?; } Ok(last) }, @@ -419,6 +427,60 @@ impl super::Run for Command { } } } +fn expand_home(word: &str) -> String { + if word.starts_with("~") { + if let Some(path) = home_dir() { + format!("{}{}", &path.to_str().expect("error: home not set"), + &word[1..]) + } else { + "~".into() + } + } else { + word.into() + } + +} + +// "$" => "$" +// "$ " => "$ " +// "$USER" => "nixpulvis" +fn expand_vars(string: &str) -> String { + let mut result = String::new(); + let mut variable = String::new(); + let mut variable_start = -1; + for (i, c) in string.char_indices() { + if c == '$' || c == ' ' { + // It's not possible for these to be vars. + if variable.is_empty() { + result.push(c); + } else { + result += &var(&variable).unwrap_or("".into()); + } + variable.clear(); + variable_start = -1; + } + + if c == '$' { + variable_start = i as i32; + } else if c == ' ' { + variable_start = -1; + } else if c == '@' || c == ':' { + result += &var(&variable).unwrap_or("".into()); + variable.clear(); + variable_start = -1; + result.push(c); + } else if variable_start > -1 { + if variable.is_empty() { + result.pop(); // remove the leading '$'. + } + variable.push(c); + } else { + result.push(c); + } + } + result += &var(&variable).unwrap_or("".into()); + result +} // Builtin functions for the POSIX language, like `exit` and `cd`. pub mod builtin; diff --git a/src/program/posix/builtin.rs b/src/program/posix/builtin.rs index a7205116..e94b6862 100644 --- a/src/program/posix/builtin.rs +++ b/src/program/posix/builtin.rs @@ -4,7 +4,7 @@ //! These commands take precedence over any executables with the same name //! in the `$PATH`. use std::{ - env, + env::{self, set_var}, process, ffi::CString, }; @@ -52,6 +52,30 @@ impl Builtin for Exit { } } +/// Export builtin, used to set global variables. +pub struct Export; + +impl Builtin for Export { + fn run(argv: Vec, _: &mut JobsRef) -> Result { + match argv.len() { + 0 => unreachable!(), + 1 => { + // TODO: Print all env vars. + unimplemented!(); + } + n => { + for assignment in argv[1..n].iter() { + let mut split = assignment.to_str().unwrap().splitn(2, '='); + if let (Some(key), Some(value)) = (split.next(), split.next()) { + env::set_var(key, value); + } + } + Ok(WaitStatus::Exited(Pid::this(), 0)) + }, + } + } +} + /// Change directory (`cd`) builtin. pub struct Cd; @@ -66,12 +90,19 @@ impl Builtin for Cd { Ok(path) => path, Err(_) => return Err(Error::Runtime), }; - chdir(home.as_str()).map(|_| WaitStatus::Exited(Pid::this(), 0)) + let dst = home.as_str(); + chdir(dst).map(|_| { + set_var("PWD", &dst); + WaitStatus::Exited(Pid::this(), 0) + }) .map_err(|_| Error::Runtime) }, 2 => { - chdir(&*argv[1].to_string_lossy().as_ref()) - .map(|_| WaitStatus::Exited(Pid::this(), 1)) + let dst = argv[1].to_string_lossy(); + chdir(dst.as_ref()).map(|_| { + set_var("PWD", dst.as_ref()); + WaitStatus::Exited(Pid::this(), 0) + }) .map_err(|_| Error::Runtime) }, _ => { diff --git a/src/program/posix/lex.rs b/src/program/posix/lex.rs index 7909f654..c31e8459 100644 --- a/src/program/posix/lex.rs +++ b/src/program/posix/lex.rs @@ -35,7 +35,6 @@ pub enum Token<'input> { Backtick, Bang, Pipe, - Dollar, Equals, Backslash, DoubleQuote, @@ -56,6 +55,7 @@ pub enum Token<'input> { Else, Elif, Fi, + Export, Do, Done, Case, @@ -134,7 +134,6 @@ impl<'input> Iterator for Lexer<'input> { '(' => Some(Ok((s, Token::LParen, e))), '`' => Some(Ok((s, Token::Backtick, e))), '!' => Some(Ok((s, Token::Bang, e))), - '$' => Some(Ok((s, Token::Dollar, e))), '=' => Some(Ok((s, Token::Equals, e))), '\\' => Some(Ok((s, Token::Backslash, e))), '\'' => Some(self.single_quote(s, e)), @@ -258,14 +257,14 @@ impl<'input> Lexer<'input> { } // TODO: Escapes - // TODO: Should we expand $ variables here? + // TODO: Honestly, I think this needs to be handled in the .lalrpop file. fn double_quote(&mut self, start: usize, end: usize) -> Result<(usize, Token<'input>, usize), Error> { // TODO: This quitely stops at EOF. - let (_, end) = self.take_while(start, end, |c| c != '"'); + let (input, end) = self.take_while(start, end, |c| c != '"'); self.advance(); // Consume the ending double quote. - Ok((start, Token::Word(&self.input[start+1..end]), end)) + Ok((start, Token::Word(&input[1..]), end)) } fn word(&mut self, start: usize, end: usize) @@ -273,21 +272,21 @@ impl<'input> Lexer<'input> { { let (word, end) = self.take_while(start, end, is_word_continue); let tok = match word { - "if" => Token::If, - "then" => Token::Then, - "else" => Token::Else, - "elif" => Token::Elif, - "fi" => Token::Fi, - "do" => Token::Do, - "done" => Token::Done, - "case" => Token::Case, - "esac" => Token::Esac, - "while" => Token::While, - "until" => Token::Until, - "for" => Token::For, - word => self.io_number(word), + "if" => Token::If, + "then" => Token::Then, + "else" => Token::Else, + "elif" => Token::Elif, + "fi" => Token::Fi, + "export" => Token::Export, + "do" => Token::Do, + "done" => Token::Done, + "case" => Token::Case, + "esac" => Token::Esac, + "while" => Token::While, + "until" => Token::Until, + "for" => Token::For, + word => self.io_number(word), }; - Ok((start, tok, end)) } @@ -358,11 +357,9 @@ fn is_word_continue(ch: char) -> bool { match ch { // List of syntax from above. // TODO: Make this list generated. - ';' | ')' | '(' | '`' | '!' | - '$' | '=' | '\\' | '\'' | '"' | - '>' | '<' | '&' | '|' | '{' | '}' | - '*' => false, - + ';' | ')' | '(' | '`' | '!' | '=' | '\\' | '\'' | '"' + | '>' | '<' | '&' | '|' | '{' | '}' | '*' + => false, _ => !ch.is_whitespace() } } @@ -402,6 +399,9 @@ mod tests { let mut lexer = Lexer::new("123"); assert_matches!(lexer.next(), Some(Ok((_, Token::Word("123"), _)))); + let mut lexer = Lexer::new("$PATH"); + assert_matches!(lexer.next(), + Some(Ok((_, Token::Word("$PATH"), _)))); } #[test] diff --git a/src/repl.rs b/src/repl/mod.rs similarity index 100% rename from src/repl.rs rename to src/repl/mod.rs diff --git a/tests/common/mod.rs b/tests/common/mod.rs index d60661b6..4c236e04 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -89,7 +89,6 @@ macro_rules! assert_oursh { let stdout = String::from_utf8_lossy(&stdout); let stderr = String::from_utf8_lossy(&stderr); println!("stdout: {}\nstderr: {}", stdout, stderr); - dbg!($text, status); assert!(status.success()); assert_eq!($stdout, stdout); }}; diff --git a/tests/piped.rs b/tests/piped.rs index 36f48811..b94a7a18 100644 --- a/tests/piped.rs +++ b/tests/piped.rs @@ -119,9 +119,13 @@ fn assignment_command() { } #[test] -#[ignore] fn variable_command() { assert_oursh!("X=1; echo $X", "1\n"); + assert_oursh!("export FOO=1 BAR=$FOO; echo $BAR", "1\n"); + assert_oursh!("echo $BAR", "\n"); + assert_oursh!("echo $", "$\n"); + assert_oursh!("echo ' $ '", " $ \n"); + assert_oursh!("echo \" $$ $ \"", " $$ $ \n"); } #[test]