diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 46d15fb..891386a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,6 +19,11 @@ jobs: with: apt: libpango1.0-dev libgtk-4-dev + - uses: leafo/gh-actions-lua@v10 + with: + luaVersion: "5.4" + run: echo ".lua/bin" >> $GITHUB_ENV + - uses: KyleMayes/install-llvm-action@v1 with: version: "17.0" diff --git a/Cargo.lock b/Cargo.lock index 9d6487c..31e91a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f90148830dac590fac7ccfe78ec4a8ea404c60f75a24e16407a71f0f40de775" +checksum = "2e53b0a3d5760cd2ba9b787ae0c6440ad18ee294ff71b05e3381c900a7d16cfd" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arboard" @@ -193,7 +193,7 @@ checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" dependencies = [ "clipboard-win", "log", - "objc2 0.5.1", + "objc2 0.5.2", "objc2-app-kit", "objc2-foundation", "parking_lot", @@ -248,13 +248,12 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.1", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite", ] @@ -267,7 +266,7 @@ checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-lite 2.3.0", "slab", ] @@ -317,7 +316,7 @@ dependencies = [ "futures-lite 2.3.0", "parking", "polling 3.7.0", - "rustix 0.38.32", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -362,7 +361,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -374,7 +373,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -389,7 +388,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.32", + "rustix 0.38.34", "signal-hook-registry", "slab", "windows-sys 0.52.0", @@ -403,13 +402,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -485,14 +484,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -566,7 +565,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ - "objc-sys 0.3.3", + "objc-sys 0.3.5", ] [[package]] @@ -591,11 +590,11 @@ dependencies = [ [[package]] name = "block2" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ff7d91d3c1d568065b06c899777d1e48dcf76103a672a0adbc238a7f247f1e" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2 0.5.1", + "objc2 0.5.2", ] [[package]] @@ -614,15 +613,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" dependencies = [ "bytemuck_derive", ] @@ -635,7 +634,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -652,9 +651,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cairo-rs" -version = "0.19.2" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2650f66005301bd33cc486dec076e1293c4cecf768bc7ba9bf5d2b1be339b99c" +checksum = "b2ac2a4d0e69036cf0062976f6efcba1aaee3e448594e6514bb2ddf87acce562" dependencies = [ "bitflags 2.5.0", "cairo-sys-rs", @@ -683,7 +682,7 @@ dependencies = [ "bitflags 2.5.0", "log", "polling 3.7.0", - "rustix 0.38.32", + "rustix 0.38.34", "slab", "thiserror", ] @@ -695,7 +694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ "calloop", - "rustix 0.38.32", + "rustix 0.38.34", "wayland-backend", "wayland-client", ] @@ -721,12 +720,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -737,9 +737,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", @@ -768,16 +768,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -902,9 +902,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -960,9 +960,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -975,18 +975,18 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1017,7 +1017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1128,7 +1128,7 @@ dependencies = [ "parking_lot", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "static_assertions", "thiserror", "wasm-bindgen", @@ -1181,7 +1181,7 @@ dependencies = [ "arboard", "egui", "log", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "smithay-clipboard", "web-time", "webbrowser", @@ -1220,9 +1220,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "emath" @@ -1236,9 +1236,9 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -1261,7 +1261,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -1282,7 +1282,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -1293,7 +1293,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -1334,9 +1334,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1378,9 +1378,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", @@ -1399,11 +1399,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.2.0", + "event-listener 5.3.0", "pin-project-lite", ] @@ -1418,9 +1418,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -1475,7 +1475,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -1561,7 +1561,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1576,7 +1576,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -1623,9 +1623,9 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcbd04c1b2c4834cc008b4828bc917d062483b88d26effde6342e5622028f96" +checksum = "1fdbf021f8b9d19e30fb9ea6d6e5f2b6a712fe4645417c69f86f6ff1e1444a8f" dependencies = [ "gio-sys", "glib-sys", @@ -1636,9 +1636,9 @@ dependencies = [ [[package]] name = "gdk4" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9100b25604183f2fd97f55ef087fae96ab4934d7215118a35303e422688e6e4b" +checksum = "db265c9dd42d6a371e09e52deab3a84808427198b86ac792d75fd35c07990a07" dependencies = [ "cairo-rs", "gdk-pixbuf", @@ -1651,9 +1651,9 @@ dependencies = [ [[package]] name = "gdk4-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b76874c40bb8d1c7d03a7231e23ac75fa577a456cd53af32ec17ec8f121626" +checksum = "c9418fb4e8a67074919fe7604429c45aa74eb9df82e7ca529767c6d4e9dc66dd" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1688,9 +1688,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1705,9 +1705,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gio" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64947d08d7fbb03bf8ad1f25a8ac6cf4329bc772c9b7e5abe7bf9493c81194f" +checksum = "be548be810e45dd31d3bbb89c6210980bb7af9bca3ea1292b5f16b75f8e394a7" dependencies = [ "futures-channel", "futures-core", @@ -1723,9 +1723,9 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf8e1d9219bb294636753d307b030c1e8a032062cba74f493c431a5c8b81ce4" +checksum = "d4bdbef451b0f0361e7f762987cc6bebd5facab1d535e85a3cf1115dfb08db40" dependencies = [ "glib-sys", "gobject-sys", @@ -1747,9 +1747,9 @@ dependencies = [ [[package]] name = "glib" -version = "0.19.3" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e191cc1af1f35b9699213107068cd3fe05d9816275ac118dc785a0dd8faebf" +checksum = "e52355166df21c7ed16b6a01f615669c7911ed74e27ef60eba339c0d2da12490" dependencies = [ "bitflags 2.5.0", "futures-channel", @@ -1769,22 +1769,22 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.19.3" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9972bb91643d589c889654693a4f1d07697fdcb5d104b5c44fb68649ba1bf68d" +checksum = "70025dbfa1275cf7d0531c3317ba6270dae15d87e63342229d638246ff45202e" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "glib-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630f097773d7c7a0bb3258df4e8157b47dc98bbfa0e60ad9ab56174813feced4" +checksum = "767d23ead9bbdfcbb1c2242c155c8128a7d13dde7bf69c176f809546135e2282" dependencies = [ "libc", "system-deps", @@ -1869,9 +1869,9 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e2b1080b9418dd0c58b498da3a5c826030343e0ef07bde6a955d28de54979" +checksum = "c3787b0bfacca12bb25f8f822b0dbee9f7e4a86e6469a29976d332d2c14c945b" dependencies = [ "glib-sys", "libc", @@ -1918,7 +1918,7 @@ checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ "bitflags 2.5.0", "gpu-descriptor-types", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1943,9 +1943,9 @@ dependencies = [ [[package]] name = "graphene-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236ed66cc9b18d8adf233716f75de803d0bf6fc806f60d14d948974a12e240d0" +checksum = "2a60e7381afdd7be43bd10a89d3b6741d162aabbca3a8db73505afb6a3aea59d" dependencies = [ "glib-sys", "libc", @@ -1955,9 +1955,9 @@ dependencies = [ [[package]] name = "gsk4" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65036fc8f99579e8cb37b12487969b707ab23ec8ab953682ff347cbd15d396e" +checksum = "7563884bf6939f4468e5d94654945bdd9afcaf8c3ba4c5dd17b5342b747221be" dependencies = [ "cairo-rs", "gdk4", @@ -1970,9 +1970,9 @@ dependencies = [ [[package]] name = "gsk4-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd24c814379f9c3199dc53e52253ee8d0f657eae389ab282c330505289d24738" +checksum = "23024bf2636c38bbd1f822f58acc9d1c25b28da896ff0f291a1a232d4272b3dc" dependencies = [ "cairo-sys-rs", "gdk4-sys", @@ -1986,9 +1986,9 @@ dependencies = [ [[package]] name = "gtk4" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa82753b8c26277e4af1446c70e35b19aad4fb794a7b143859e7eeb9a4025d83" +checksum = "b04e11319b08af11358ab543105a9e49b0c491faca35e2b8e7e36bfba8b671ab" dependencies = [ "cairo-rs", "field-offset", @@ -2007,23 +2007,21 @@ dependencies = [ [[package]] name = "gtk4-macros" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40300bf071d2fcd4c94eacc09e84ec6fe73129d2ceb635cf7e55b026b5443567" +checksum = "ec655a7ef88d8ce9592899deb8b2d0fa50bab1e6dd69182deb764e643c522408" dependencies = [ - "anyhow", "proc-macro-crate 3.1.0", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] name = "gtk4-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db1b104138f087ccdc81d2c332de5dd049b89de3d384437cc1093b17cd2da18" +checksum = "8c8aa86b7f85ea71d66ea88c1d4bae1cfacf51ca4856274565133838d77e57b5" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -2046,9 +2044,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -2203,7 +2201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2228,14 +2226,14 @@ checksum = "4fa4d8d74483041a882adaa9a29f633253a66dde85055f0495c121620ac484b2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -2373,9 +2371,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -2394,7 +2392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -2426,9 +2424,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litrs" @@ -2452,9 +2450,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2581,9 +2579,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", "simd-adler32", @@ -2632,7 +2630,7 @@ dependencies = [ "ndk-sys", "num_enum", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "thiserror", ] @@ -2687,9 +2685,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2722,7 +2720,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -2743,9 +2741,9 @@ checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" [[package]] name = "objc-sys" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" @@ -2764,43 +2762,60 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "objc-sys 0.3.3", + "objc-sys 0.3.5", "objc2-encode 3.0.0", ] [[package]] name = "objc2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b25e1034d0e636cd84707ccdaa9f81243d399196b8a773946dcffec0401659" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ - "objc-sys 0.3.3", - "objc2-encode 4.0.1", + "objc-sys 0.3.5", + "objc2-encode 4.0.3", ] [[package]] name = "objc2-app-kit" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb79768a710a9a1798848179edb186d1af7e8a8679f369e4b8d201dd2a034047" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", + "bitflags 2.5.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", "objc2-core-data", + "objc2-core-image", "objc2-foundation", + "objc2-quartz-core", ] [[package]] name = "objc2-core-data" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e092bc42eaf30a08844e6a076938c60751225ec81431ab89f5d1ccd9f958d6c" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", "objc2-foundation", ] +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" +dependencies = [ + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", +] + [[package]] name = "objc2-encode" version = "2.0.0-pre.2" @@ -2818,18 +2833,45 @@ checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" [[package]] name = "objc2-encode" -version = "4.0.1" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88658da63e4cc2c8adb1262902cd6af51094df0488b760d6fd27194269c0950a" +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" [[package]] name = "objc2-foundation" -version = "0.2.0" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "libc", + "objc2 0.5.2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaefe14254871ea16c7d88968c0ff14ba554712a20d76421eec52f0a7fb8904" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "block2 0.5.0", - "objc2 0.5.1", + "bitflags 2.5.0", + "block2 0.5.1", + "objc2 0.5.2", + "objc2-foundation", + "objc2-metal", ] [[package]] @@ -2889,18 +2931,18 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +checksum = "6b41438d2fc63c46c74a2203bf5ccd82c41ba04347b2fcf5754f230b167067d5" dependencies = [ "ttf-parser", ] [[package]] name = "pango" -version = "0.19.3" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1264d13deb823cc652f26cfe59afb1ec4b9db2a5bd27c41b738c879cc1bfaa1" +checksum = "504ce6e805439ea2c6791168fe7ef8e3da0c1b2ef82c44bc450dbc330592920d" dependencies = [ "gio", "glib", @@ -2910,9 +2952,9 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.19.0" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52ef6a881c19fbfe3b1484df5cad411acaaba29dbec843941c3110d19f340ea" +checksum = "e4829555bdbb83692ddeaf5a6927fb2d025c8131e5ecaa4f7619fff6985d3505" dependencies = [ "glib-sys", "gobject-sys", @@ -2928,9 +2970,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2938,22 +2980,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2963,9 +3005,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -3003,7 +3045,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -3020,12 +3062,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-io", ] @@ -3074,7 +3116,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.3.9", "pin-project-lite", - "rustix 0.38.32", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] @@ -3126,35 +3168,11 @@ dependencies = [ "toml_edit 0.21.1", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] @@ -3177,9 +3195,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3222,9 +3240,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "raw-window-handle" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc3bcbdb1ddfc11e700e62968e6b4cc9c75bb466464ad28fb61c5b2c964418b" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "redox_syscall" @@ -3244,6 +3262,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -3313,9 +3340,9 @@ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3348,28 +3375,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3407,35 +3434,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3444,20 +3471,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -3549,7 +3576,7 @@ dependencies = [ "libc", "log", "memmap2", - "rustix 0.38.32", + "rustix 0.38.34", "thiserror", "wayland-backend", "wayland-client", @@ -3574,9 +3601,9 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ "serde", ] @@ -3593,9 +3620,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3635,6 +3662,7 @@ dependencies = [ "regex", "smallmap", "smallvec", + "tempfile", "uuid", ] @@ -3679,7 +3707,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -3695,9 +3723,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3713,7 +3741,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.12", + "toml 0.8.13", "version-compare", ] @@ -3730,8 +3758,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -3763,22 +3791,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -3852,7 +3880,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -3865,21 +3893,20 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -3893,21 +3920,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -3936,15 +3963,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow 0.6.8", ] [[package]] @@ -3998,7 +4025,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -4026,7 +4053,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -4070,9 +4097,9 @@ dependencies = [ [[package]] name = "ttf-parser" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "type-map" @@ -4180,7 +4207,7 @@ checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] @@ -4233,9 +4260,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -4274,7 +4301,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -4308,7 +4335,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4327,7 +4354,7 @@ checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "rustix 0.38.32", + "rustix 0.38.34", "scoped-tls", "smallvec", "wayland-sys", @@ -4340,7 +4367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ "bitflags 2.5.0", - "rustix 0.38.32", + "rustix 0.38.34", "wayland-backend", "wayland-scanner", ] @@ -4362,7 +4389,7 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", "wayland-client", "xcursor", ] @@ -4478,7 +4505,7 @@ dependencies = [ "log", "parking_lot", "profiling", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -4506,7 +4533,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "rustc-hash", "smallvec", "thiserror", @@ -4545,7 +4572,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "renderdoc-sys", "rustc-hash", "smallvec", @@ -4591,11 +4618,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4622,7 +4649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4631,7 +4658,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4680,7 +4707,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4715,17 +4742,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4742,9 +4770,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4760,9 +4788,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4778,9 +4806,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4796,9 +4830,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4814,9 +4848,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4832,9 +4866,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4850,9 +4884,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" @@ -4882,9 +4916,9 @@ dependencies = [ "orbclient", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.1", + "raw-window-handle 0.6.2", "redox_syscall 0.3.5", - "rustix 0.38.32", + "rustix 0.38.34", "sctk-adwaita", "smithay-client-toolkit", "smol_str", @@ -4914,9 +4948,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -4943,7 +4977,7 @@ dependencies = [ "libc", "libloading 0.8.3", "once_cell", - "rustix 0.38.32", + "rustix 0.38.34", "x11rb-protocol", ] @@ -5062,22 +5096,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.66", ] [[package]] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 67fa91a..9c7ffae 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -29,6 +29,9 @@ byteorder = "*" uuid = { version = "*", features = ["v4", "fast-rng", "macro-diagnostics", "serde"] } inkwell = { version = "*", optional = true, features = ["llvm17-0-no-llvm-linking"] } +[dev-dependencies] +tempfile = "*" + [build-dependencies] cbindgen = "*" lalrpop = { version = "*", optional = true } diff --git a/lib/src/backend/lua/bytecode.rs b/lib/src/backend/lua/bytecode.rs index 083610a..9c0cf59 100644 --- a/lib/src/backend/lua/bytecode.rs +++ b/lib/src/backend/lua/bytecode.rs @@ -1,12 +1,11 @@ -use indexmap::IndexSet; -use smallvec::SmallVec; +use indexmap::{IndexMap, IndexSet}; use std::fmt::{Display, Formatter, Write}; use std::hash::{Hash, Hasher}; use crate::parser::StString; -use super::register::Register; -use super::{ConstantIndex, LuaType}; +use super::register::{Register, RK}; +use super::{ConstantIndex, LuaType, LuaVarKind, UpValueIndex}; macro_rules! excess_k { ($v: expr, $k: expr) => { @@ -160,12 +159,21 @@ impl LuaConstants { } } -#[derive(Debug, Clone, Default)] +#[derive(Debug, Clone, Copy)] pub struct LuaUpValue { - pub name: Option, pub stack: u8, pub index: u8, - pub kind: u8, + pub kind: LuaVarKind, +} + +impl Default for LuaUpValue { + fn default() -> Self { + Self { + stack: 0, + index: 0, + kind: LuaVarKind::VDKREG, + } + } } impl Eq for LuaConstants {} @@ -203,9 +211,9 @@ pub enum LuaByteCode { LoadK(Register, ConstantIndex), /// A B C: R[A] := UpValue[B][K[C]:string] - GetTabUp(Register, u8, u8), + GetTabUp(Register, u8, ConstantIndex), /// A B C: UpValue[A][K[B]:string] := RK(C) - SetTabUp(u8, u8, u8), + SetTabUp(Register, UpValueIndex, RK), /// A B C: R[A] := R[B] + R[C] Add(Register, Register, Register), @@ -273,12 +281,25 @@ impl LuaByteCode { // A B k LuaByteCode::Eq(a, b, k) => (k as u32) << 17 | (b.num() as u32) << 9 | a.num() as u32, // A sB k - LuaByteCode::GetTabUp(a, sb, c) | LuaByteCode::Gei(a, sb, c) | LuaByteCode::Gti(a, sb, c) | LuaByteCode::Call(a, sb, c) => (c as u32) << 17 | (sb as u32) << 9 | a.num() as u32, + // A B K + LuaByteCode::GetTabUp(a, upv, k) => { + (k as u32) << 17 | (upv as u32) << 9 | a.num() as u32 + } + // A B RK + LuaByteCode::SetTabUp(a, upv, rk) => { + let c = match rk { + RK::R(Register::RealRegister(r)) => r as u32, + RK::K(k) => (k as u32) << 17 | 1u32 << 8, + _ => unreachable!(), + }; + + c | (upv as u32) << 9 | a.num() as u32 + }, // A B C all literal - LuaByteCode::Return(a, b, c) | LuaByteCode::SetTabUp(a, b, c) => { + LuaByteCode::Return(a, b, c) => { (c as u32) << 17 | (b as u32) << 9 | a as u32 } // ABx @@ -300,7 +321,7 @@ impl LuaByteCode { pub struct LuaCompiledCode { pub byte_codes: Vec, pub constants: IndexSet, - pub upvalues: SmallVec<[LuaUpValue; 32]>, + pub upvalues: IndexMap, } impl LuaCompiledCode { @@ -330,14 +351,26 @@ impl LuaCompiledCode { write!(s, "R{} R{} {k}", a.num(), b.num()).unwrap(); } // A sB k - LuaByteCode::GetTabUp(a, b, c) - | LuaByteCode::Gti(a, b, c) + LuaByteCode::Gti(a, b, c) | LuaByteCode::Gei(a, b, c) | LuaByteCode::Call(a, b, c) => { write!(s, "R{} {b} {c}", a.num()).unwrap(); } + // Reg, Upv, K + LuaByteCode::GetTabUp(reg, upv, k) => { + write!(s, "R{} {upv} {k}", reg.num()).unwrap(); + } + // Reg, Upv, RK + LuaByteCode::SetTabUp(reg, upv, rk) => { + write!(s, "R{} {upv} ", reg.num()).unwrap(); + + match rk { + RK::R(r) => write!(s, "{}", r.num()), + RK::K(k) => write!(s, "{}k", k), + }.unwrap(); + }, // ABC with k - LuaByteCode::SetTabUp(a, b, c) | LuaByteCode::Return(a, b, c) => { + LuaByteCode::Return(a, b, c) => { write!(s, "{a} {b} {c}").unwrap(); } // ABx @@ -362,8 +395,9 @@ impl LuaCompiledCode { LuaByteCode::LoadK(a, bx) => { write!(s, " ; K[{}] = {}", bx, self.constants[*bx as usize]).unwrap(); } - LuaByteCode::GetTabUp(a, b, c) => { - write!(s, " ; _ENV \"{}\"", self.constants[*c as usize]).unwrap(); + LuaByteCode::GetTabUp(a, b, k) => { + let (name, _upv) = self.upvalues.get_index(*k as usize).unwrap(); + write!(s, " ; _ENV \"{}\"", name).unwrap() } LuaByteCode::Call(a, b, c) => { if *b == 0 { diff --git a/lib/src/backend/lua/dump.rs b/lib/src/backend/lua/dump.rs index bc57bc4..a810a69 100644 --- a/lib/src/backend/lua/dump.rs +++ b/lib/src/backend/lua/dump.rs @@ -109,8 +109,8 @@ fn lua_dump_function( lua_dump_size(w, lua_code.upvalues.len() as u64)?; // Dump UpValues - for upv in lua_code.upvalues.as_ref() { - w.write_all(&[upv.stack, upv.index, upv.kind])?; + for (_, upv) in &lua_code.upvalues { + w.write_all(&[upv.stack, upv.index, upv.kind.bits()])?; } // Dump size of Protos diff --git a/lib/src/backend/lua/mod.rs b/lib/src/backend/lua/mod.rs index b5d83bf..1d69efb 100644 --- a/lib/src/backend/lua/mod.rs +++ b/lib/src/backend/lua/mod.rs @@ -4,6 +4,8 @@ use bytecode::*; mod dump; mod register; +#[cfg(test)] +mod test; mod utils; mod vm; @@ -15,11 +17,12 @@ use self::dump::lua_dump_module; use self::register::*; use self::utils::*; -use indexmap::IndexSet; +use indexmap::{IndexMap, IndexSet}; use log::*; use smallvec::{smallvec, SmallVec}; use std::mem; use std::rc::Rc; +use crate::backend::lua::register::Register::RealRegister; type ConstantIndex = u8; type UpValueIndex = u8; @@ -41,10 +44,26 @@ bitflags! { } } +bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] + pub struct LuaVarKind: u8 { + // regular + const VDKREG = 0; + // constant + const RDKCONST = 1; + // to-be-closed + const RDKTOCLOSE = 2; + // compile-time constant + const RDKCTC = 3; + } +} + #[derive(Debug, Clone, Copy)] enum LuaAccessMode { None, Call(usize), + ReadUpValue, + WriteRegister, // Read value into register or literal LoadNewRegister, // Read value into register only @@ -59,6 +78,7 @@ pub struct LuaBackendStates { variable: Option>, registers: SmallVec8, constant_index: Option, + upvalue: Option<(u8, LuaUpValue)>, scope: Option, error: bool, access_mode: LuaAccessMode, @@ -71,6 +91,7 @@ impl Default for LuaBackendStates { registers: smallvec![], scope: None, error: false, + upvalue: None, access_mode: LuaAccessMode::None, constant_index: None, } @@ -87,15 +108,19 @@ pub struct LuaBackend { reg_mgr: RegisterManager, // tmp values for generating function - upvalues: SmallVec<[LuaUpValue; 32]>, + upvalue_table: IndexMap, constants: IndexSet, } impl LuaBackend { #[inline] - fn push_code(&mut self, code: LuaByteCode) { - debug!("LuaBackend: Push Code {:?}", code); - self.byte_codes.push(code) + fn code_gettabup(&mut self, dst: Register, k: ConstantIndex) { + self.push_code(LuaByteCode::GetTabUp(dst, 0, k)); + } + + #[inline] + fn code_settabup(&mut self, up_idx: u8, rk: RK) { + self.push_code(LuaByteCode::SetTabUp(RealRegister(0), up_idx, rk)); } #[inline] @@ -119,6 +144,22 @@ impl LuaBackend { self.push_code(LuaByteCode::LoadK(r, k)) } + #[inline] + fn push_code(&mut self, code: LuaByteCode) { + debug!("LuaBackend: Push Code {:?}", code); + self.byte_codes.push(code) + } + + fn lookup_symbol(&mut self, sym: &StString) -> Option<(u8, LuaUpValue)> { + if !self.upvalue_table.contains_key(sym) { + let constant = self.add_constant(&LiteralValue::String(sym.origin_string().clone())); + self.upvalue_table.insert_full(sym.clone(), LuaUpValue { stack: 0, index: constant, kind: LuaVarKind::RDKCONST }); + } + + let (idx, _key, val) = self.upvalue_table.get_full(sym).unwrap(); + Some((idx as u8, *val)) + } + #[inline] fn add_constant(&mut self, v: &LiteralValue) -> ConstantIndex { match v { @@ -216,8 +257,8 @@ impl CodeGenBackend for LuaBackend { local_function: None, local_proto: None, constants: IndexSet::new(), + upvalue_table: IndexMap::new(), reg_mgr: RegisterManager::new(), - upvalues: smallvec![], } } @@ -244,11 +285,16 @@ impl CodeGenBackend for LuaBackend { } // create upvalue table - self.upvalues.push(LuaUpValue { - name: None, + // self.upvalues.push(LuaUpValue { + // name: None, + // stack: 1, + // index: 0, + // kind: 0, + // }); + self.upvalue_table.insert(StString::empty(), LuaUpValue { stack: 1, index: 0, - kind: 0, + kind: LuaVarKind::VDKREG, }); let mut fun = f.write(); @@ -261,7 +307,7 @@ impl CodeGenBackend for LuaBackend { let byte_codes = mem::take(&mut self.byte_codes); let constants = mem::replace(&mut self.constants, IndexSet::new()); - let upvalues = mem::replace(&mut self.upvalues, smallvec![]); + let upvalues = mem::replace(&mut self.upvalue_table, IndexMap::new()); // reset RegMan and check register is balance assert!(self.reg_mgr.check_and_reset()); @@ -332,8 +378,18 @@ impl AstVisitorMut for LuaBackend { let arg_regs = self.reg_mgr.alloc_hard_batch(arg_cnt); self.top_attribute().registers = arg_regs.into(); - self.top_attribute().constant_index = - Some(self.add_string_constant(var_expr.org_name())); + self.top_attribute().upvalue = self.lookup_symbol(var_expr.name()); + // self.top_attribute().constant_index = + // Some(self.add_string_constant(var_expr.org_name())); + } + // Read UpValue + LuaAccessMode::ReadUpValue => { + self.top_attribute().upvalue = self.lookup_symbol(var_expr.name()); + } + LuaAccessMode::WriteRegister => { + let dst = self.top_attribute().registers[0]; + let upv = self.lookup_symbol(var_expr.name()); + self.code_gettabup(dst, upv.unwrap().0); } // Write register into stack LuaAccessMode::Write => {} @@ -374,14 +430,14 @@ impl AstVisitorMut for LuaBackend { let callee_reg = arg_regs[0]; // TODO: - self.push_code(LuaByteCode::GetTabUp(callee_reg, 0, 1)); + self.push_code(LuaByteCode::GetTabUp(callee_reg, 0, callee_attr.upvalue.unwrap().0)); // visit all arguments for (idx, arg) in call.arguments_mut().iter_mut().enumerate() { - self.push_access_attribute(LuaAccessMode::LoadExistRegister); + self.push_access_attribute(LuaAccessMode::WriteRegister); self.top_attribute().registers = smallvec![arg_regs[idx + 1]]; self.visit_expression_mut(arg); - let arg_attr = self.pop_attribute(); + self.pop_attribute(); } // free registers @@ -468,23 +524,21 @@ impl AstVisitorMut for LuaBackend { let rhs = self.pop_attribute(); // Get lhs register - self.push_access_attribute(LuaAccessMode::LoadNewRegister); + self.push_access_attribute(LuaAccessMode::ReadUpValue); assign.left_mut().accept_mut(self); - let lhs_reg = self.pop_attribute().registers[0]; + let lhs_upv = self.pop_attribute().upvalue.unwrap(); + // let lhs_reg = self.pop_attribute().registers[0]; if let Some(constant_index) = rhs.constant_index { assert_eq!(rhs.registers.len(), 0); - self.code_load_constant(lhs_reg, constant_index) + // self.code_load_constant(lhs_reg, constant_index) + self.code_settabup(lhs_upv.0, RK::K(constant_index)); } else { assert_eq!(1, rhs.registers.len()); - assert_ne!(lhs_reg, rhs.registers[0]); + // assert_ne!(lhs_reg, rhs.registers[0]); self.reg_mgr.free(&rhs.registers[0]); - self.code_move(rhs.registers[0], lhs_reg); + // self.code_move(rhs.registers[0], lhs_reg); } - - // TODO: keep register? - // self.top_attribute().register = Some(lhs_reg); - self.reg_mgr.free(&lhs_reg); } } diff --git a/lib/src/backend/lua/register.rs b/lib/src/backend/lua/register.rs index a656c3f..d3f4a00 100644 --- a/lib/src/backend/lua/register.rs +++ b/lib/src/backend/lua/register.rs @@ -6,16 +6,22 @@ use crate::parser::StString; const MAX_REGISTER_ID: u8 = 255; +#[derive(PartialEq, Eq, Clone, Debug, Copy, Hash)] +pub enum RK { + R(Register), + K(u8), +} + #[derive(PartialEq, Eq, Clone, Debug, Copy, Hash)] pub enum Register { VirtualRegister(usize), - LuaRegister(u8), + RealRegister(u8), } impl Register { pub fn num(&self) -> u8 { match *self { - Self::LuaRegister(x) => x, + Self::RealRegister(x) => x, Self::VirtualRegister(..) => panic!("Can't get number for virtual register"), } } @@ -27,7 +33,7 @@ impl Register { // for unit test #[cfg(test)] pub fn from_raw(n: u8) -> Self { - Self::LuaRegister(n) + Self::RealRegister(n) } } @@ -72,7 +78,7 @@ impl RegisterManager { pub fn check_and_reset(&mut self) -> bool { // free all local variable registers for (r, _) in self.local_variable_register_reverse.iter() { - if let Register::LuaRegister(x) = r { + if let Register::RealRegister(x) = r { self.used_real_registers.remove(x); } } @@ -104,7 +110,7 @@ impl RegisterManager { loop { if self.used_real_registers.insert(self.real_register_cursor) { - return Register::LuaRegister(self.real_register_cursor); + return Register::RealRegister(self.real_register_cursor); } self.real_register_cursor += 1; @@ -122,7 +128,7 @@ impl RegisterManager { let mut r = Vec::with_capacity(count); for x in cursor..=cursor + count { - r.push(Register::LuaRegister(x as u8)); + r.push(Register::RealRegister(x as u8)); self.used_real_registers.insert(x as u8); } @@ -137,7 +143,7 @@ impl RegisterManager { } match *reg { - Register::LuaRegister(x) => { + Register::RealRegister(x) => { self.used_real_registers.remove(&x); } Register::VirtualRegister(_) => {} diff --git a/lib/src/backend/lua/test.rs b/lib/src/backend/lua/test.rs new file mode 100644 index 0000000..e6a227c --- /dev/null +++ b/lib/src/backend/lua/test.rs @@ -0,0 +1,85 @@ +use std::{fs, io::Write, process::Command}; + +use tempfile::tempdir; + +use crate::{ + analysis::TypeAnalyzer, + backend::{CodeGenBackend, CodeGenDriver, LuaBackend}, + parser::*, + prelude::*, +}; + +fn eval_string, S2: AsRef>(decl: S1, body: S2) -> String { + let mgr = UnitsManager::new(); + let ctx = ModuleContext::new(ModuleContextScope::Application); + let lexer = StLexerBuilder::new().build_str(decl.as_ref()); + let decl = StDeclarationParser::new().parse(lexer).unwrap(); + let fun_id = ctx.write().add_declaration(decl, Uuid::nil()); + + let lexer = StLexerBuilder::new().build_str(body.as_ref()); + let body = StFunctionParser::new().parse(lexer).unwrap(); + ctx.write().add_function(fun_id, body); + + mgr.write().add_context(ctx.clone()); + mgr.write().set_active_application(Some(ctx.read().id())); + + // Type analyze + let ctx_id = ctx.read().id(); + let ctx_read = ctx.read(); + let mut type_analyzer = TypeAnalyzer::new(); + for proto in ctx_read.declarations() { + let proto_read = proto.read().unwrap(); + let proto_id = proto_read.id(); + let fun = ctx_read.get_function(proto_read.id()); + + if let Some(f) = fun { + let mut f = f.write(); + + let scope = Scope::new(Some(mgr.clone()), Some(ctx_id), Some(proto_id)); + type_analyzer.analyze_statement(f.parse_tree_mut(), scope); + } + } + + // Build + let mut code_gen: CodeGenDriver = CodeGenDriver::new(mgr.clone(), ctx_id).unwrap(); + code_gen.build_application().expect("build app failed"); + + let mut buf = vec![0u8; 0]; + code_gen + .backend() + .get_module_bytes(&mut buf) + .expect("get module bytes failed"); + + // Write to temporary file + let dir = tempdir().unwrap(); + let fp = dir.path().join("test.o"); + let mut f = fs::OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&fp) + .unwrap(); + f.write_all(&buf).unwrap(); + + // execute + let lua_cmd = "lua5.4"; + let output = Command::new(lua_cmd) + .arg(fp) + .output() + .expect("lua exec failed"); + + // get outputs + let s = String::from_utf8_lossy(&output.stdout).to_string(); + drop(f); + + s +} + +#[test] +fn test_print() { + let r = eval_string( + "PROGRAM main: VAR a: int; END_VAR END_PROGRAM", + "a := 1; print(a);", + ); + assert_eq!(r, "1\n"); +} diff --git a/viewer/test_projects/example1/test_proj.xml b/viewer/test_projects/example1/test_proj.xml index 76d3864..32c6457 100644 --- a/viewer/test_projects/example1/test_proj.xml +++ b/viewer/test_projects/example1/test_proj.xml @@ -22,7 +22,7 @@ end_program ]]> - a := 1.234; + a := 1; print(a);