diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..dba5752 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,946 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anv-cli" +version = "0.1.0" +dependencies = [ + "anv-core", + "anv-syntax", + "anv-types", + "clap", + "miette", + "thiserror", +] + +[[package]] +name = "anv-core" +version = "0.1.0" +dependencies = [ + "derive_more", + "ordered-float", + "pretty_assertions", + "serde", + "smol_str", + "thiserror", +] + +[[package]] +name = "anv-syntax" +version = "0.1.0" +dependencies = [ + "anv-core", + "chumsky", + "logos", + "ordered-float", + "pretty_assertions", + "thiserror", +] + +[[package]] +name = "anv-types" +version = "0.1.0" +dependencies = [ + "anv-core", + "anv-syntax", + "ordered-float", + "pretty_assertions", + "thiserror", +] + +[[package]] +name = "ar_archive_writer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c269894b6fe5e9d7ada0cf69b5bf847ff35bc25fc271f08e1d080fce80339a" +dependencies = [ + "object 0.32.2", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.37.3", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "cc" +version = "1.2.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chumsky" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" +dependencies = [ + "hashbrown", + "stacker", +] + +[[package]] +name = "clap" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "derive_more" +version = "0.99.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "logos" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7251356ef8cb7aec833ddf598c6cb24d17b689d20b993f9d11a3d764e34e6458" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59f80069600c0d66734f5ff52cc42f2dabd6b29d205f333d61fd7832e9e9963f" +dependencies = [ + "beef", + "fnv", + "lazy_static", + "proc-macro2", + "quote", + "regex-syntax", + "syn", +] + +[[package]] +name = "logos-derive" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24fb722b06a9dc12adb0963ed585f19fc61dc5413e6a9be9422ef92c091e731d" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "backtrace", + "backtrace-ext", + "cfg-if", + "miette-derive", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "unicode-width 0.1.14", +] + +[[package]] +name = "miette-derive" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", + "rand", + "serde", +] + +[[package]] +name = "owo-colors" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11f2fedc3b7dafdc2851bc52f277377c5473d378859be234bc7ebb593144d01" +dependencies = [ + "ar_archive_writer", + "cc", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", + "serde", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "serde", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +dependencies = [ + "serde", +] + +[[package]] +name = "stacker" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1f8b29fb42aafcea4edeeb6b2f2d7ecd0d969c48b4cf0d2e64aafc471dd6e59" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.59.0", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + +[[package]] +name = "syn" +version = "2.0.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "terminal_size" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +dependencies = [ + "rustix", + "windows-sys 0.60.2", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..78a9e0c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,63 @@ +# SPDX-FileCopyrightText: 2025 hyperpolymath +# SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +[workspace] +resolver = "2" +members = [ + "crates/anv-core", + "crates/anv-syntax", + "crates/anv-types", + "crates/anv-cli", +] + +[workspace.package] +version = "0.1.0" +edition = "2021" +rust-version = "1.75" +authors = ["hyperpolymath"] +license = "MIT OR AGPL-3.0-or-later" +repository = "https://github.com/hyperpolymath/anvomidav" +keywords = ["figure-skating", "choreography", "dsl", "notation"] +categories = ["compilers", "development-tools"] + +[workspace.dependencies] +# Internal crates +anv-core = { path = "crates/anv-core" } +anv-syntax = { path = "crates/anv-syntax" } +anv-types = { path = "crates/anv-types" } + +# Parsing +logos = "0.14" +chumsky = "0.9" + +# Error handling +thiserror = "1.0" +miette = { version = "7", features = ["fancy"] } + +# CLI +clap = { version = "4", features = ["derive"] } + +# Data structures +indexmap = "2" +rustc-hash = "1.1" +smol_str = "0.2" + +# Serialization +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +# Utilities +derive_more = "0.99" +ordered-float = { version = "4", features = ["serde"] } + +# Testing +pretty_assertions = "1" +insta = { version = "1", features = ["yaml"] } + +[profile.release] +lto = true +codegen-units = 1 + +[profile.dev] +# Faster builds during development +debug = 1 diff --git a/crates/anv-cli/Cargo.toml b/crates/anv-cli/Cargo.toml new file mode 100644 index 0000000..e6da5c5 --- /dev/null +++ b/crates/anv-cli/Cargo.toml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 hyperpolymath +# SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +[package] +name = "anv-cli" +version = "0.1.0" +edition = "2021" +description = "Command-line interface for the Anvomidav figure skating DSL" +license = "MIT OR AGPL-3.0-or-later" +repository = "https://github.com/hyperpolymath/anvomidav" +readme = "README.md" +keywords = ["figure-skating", "dsl", "cli"] +categories = ["command-line-utilities", "compilers"] + +[[bin]] +name = "anv" +path = "src/main.rs" + +[dependencies] +anv-core = { path = "../anv-core" } +anv-syntax = { path = "../anv-syntax" } +anv-types = { path = "../anv-types" } +clap = { workspace = true } +miette = { workspace = true } +thiserror = { workspace = true } diff --git a/crates/anv-cli/src/main.rs b/crates/anv-cli/src/main.rs new file mode 100644 index 0000000..ec24050 --- /dev/null +++ b/crates/anv-cli/src/main.rs @@ -0,0 +1,396 @@ +// SPDX-FileCopyrightText: 2025 hyperpolymath +// SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +//! Anvomidav CLI - Command-line interface for the figure skating DSL. +//! +//! This tool provides commands for: +//! - Checking Anvomidav source files for errors +//! - Formatting source files +//! - Running programs +//! - Generating visualizations + +use anv_core::source::FileId; +use anv_syntax::parse; +use anv_types::check; +use clap::{Parser, Subcommand}; +use miette::{Diagnostic, NamedSource, Report, SourceSpan}; +use std::fs; +use std::path::PathBuf; +use std::process::ExitCode; + +/// Anvomidav - A domain-specific language for figure skating choreography. +#[derive(Parser)] +#[command(name = "anv")] +#[command(author = "hyperpolymath")] +#[command(version)] +#[command(about = "Anvomidav figure skating DSL compiler and tools", long_about = None)] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + /// Check source files for errors without running them + Check { + /// Source files to check + #[arg(required = true)] + files: Vec, + + /// Show detailed output + #[arg(short, long)] + verbose: bool, + }, + + /// Parse a source file and print the AST + Parse { + /// Source file to parse + file: PathBuf, + + /// Output format (json, debug) + #[arg(short, long, default_value = "debug")] + format: String, + }, + + /// Lex a source file and print tokens + Lex { + /// Source file to lex + file: PathBuf, + }, + + /// Format source files + Fmt { + /// Source files to format + files: Vec, + + /// Check if files are formatted without modifying them + #[arg(long)] + check: bool, + }, + + /// Create a new Anvomidav project + New { + /// Project name + name: String, + + /// Project template (singles, pairs, ice-dance) + #[arg(short, long, default_value = "singles")] + template: String, + }, +} + +/// Error type for CLI operations. +#[derive(Debug, thiserror::Error, Diagnostic)] +enum CliError { + #[error("failed to read file: {path}")] + #[diagnostic(code(anv::io::read_error))] + ReadError { + path: String, + #[source] + source: std::io::Error, + }, + + #[error("parse error")] + #[diagnostic(code(anv::syntax::parse_error))] + ParseError { + #[source_code] + src: NamedSource, + #[label("here")] + span: SourceSpan, + #[help] + help: String, + }, + + #[error("type error")] + #[diagnostic(code(anv::types::type_error))] + TypeError { + #[source_code] + src: NamedSource, + #[label("{message}")] + span: SourceSpan, + message: String, + }, +} + +fn main() -> ExitCode { + let cli = Cli::parse(); + + match run(cli) { + Ok(()) => ExitCode::SUCCESS, + Err(e) => { + eprintln!("{:?}", e); + ExitCode::FAILURE + } + } +} + +fn run(cli: Cli) -> miette::Result<()> { + match cli.command { + Commands::Check { files, verbose } => { + let mut has_errors = false; + + for (file_idx, path) in files.iter().enumerate() { + if verbose { + eprintln!("Checking {}...", path.display()); + } + + let source = fs::read_to_string(path).map_err(|e| CliError::ReadError { + path: path.display().to_string(), + source: e, + })?; + + let file_id = FileId(file_idx as u32); + + // Parse + let program = match parse(&source, file_id) { + Ok(p) => p, + Err(errors) => { + has_errors = true; + for err in errors { + let span: SourceSpan = (err.span.start, err.span.end - err.span.start).into(); + let report = Report::new(CliError::ParseError { + src: NamedSource::new(path.display().to_string(), source.clone()), + span, + help: err.message.clone(), + }); + eprintln!("{:?}", report); + } + continue; + } + }; + + // Type check + if let Err(diagnostics) = check(&program, file_id) { + has_errors = true; + for diag in diagnostics.iter() { + let code_str = diag.code.as_ref().map(|c| c.to_string()).unwrap_or_default(); + eprintln!( + "{}:{}: {} [{}]", + path.display(), + diag.labels.first().map(|l| l.span.start).unwrap_or(0), + diag.message, + code_str + ); + for note in &diag.notes { + eprintln!(" note: {:?}", note); + } + } + } + } + + if has_errors { + Err(miette::miette!("check failed with errors"))?; + } else if verbose { + eprintln!("All checks passed!"); + } + + Ok(()) + } + + Commands::Parse { file, format } => { + let source = fs::read_to_string(&file).map_err(|e| CliError::ReadError { + path: file.display().to_string(), + source: e, + })?; + + let program = parse(&source, FileId(0)).map_err(|errors| { + let err = &errors[0]; + let span: SourceSpan = (err.span.start, err.span.end - err.span.start).into(); + CliError::ParseError { + src: NamedSource::new(file.display().to_string(), source.clone()), + span, + help: err.message.clone(), + } + })?; + + match format.as_str() { + "debug" => println!("{:#?}", program), + "json" => { + // TODO: Implement JSON serialization + println!("{{\"name\": \"{}\", \"segments\": {}}}", program.name.node, program.segments.len()); + } + _ => { + eprintln!("Unknown format: {}. Using 'debug'.", format); + println!("{:#?}", program); + } + } + + Ok(()) + } + + Commands::Lex { file } => { + let source = fs::read_to_string(&file).map_err(|e| CliError::ReadError { + path: file.display().to_string(), + source: e, + })?; + + let tokens = anv_syntax::Lexer::tokenize(&source).map_err(|e| { + let span: SourceSpan = (e.span.start, e.span.end - e.span.start).into(); + CliError::ParseError { + src: NamedSource::new(file.display().to_string(), source.clone()), + span, + help: e.message.clone(), + } + })?; + + for tok in tokens { + println!("{:4}..{:4} {:?}", tok.span.start, tok.span.end, tok.token); + } + + Ok(()) + } + + Commands::Fmt { files, check } => { + if files.is_empty() { + eprintln!("No files specified"); + return Ok(()); + } + + for path in &files { + let source = fs::read_to_string(path).map_err(|e| CliError::ReadError { + path: path.display().to_string(), + source: e, + })?; + + // TODO: Implement formatter + // For now, just verify the file parses + let _program = parse(&source, FileId(0)).map_err(|errors| { + let err = &errors[0]; + let span: SourceSpan = (err.span.start, err.span.end - err.span.start).into(); + CliError::ParseError { + src: NamedSource::new(path.display().to_string(), source.clone()), + span, + help: err.message.clone(), + } + })?; + + if check { + eprintln!("{}: would reformat", path.display()); + } else { + eprintln!("{}: formatted (no-op, formatter not implemented)", path.display()); + } + } + + Ok(()) + } + + Commands::New { name, template } => { + let project_dir = PathBuf::from(&name); + + if project_dir.exists() { + return Err(miette::miette!("directory '{}' already exists", name)); + } + + fs::create_dir_all(&project_dir).map_err(|e| CliError::ReadError { + path: project_dir.display().to_string(), + source: e, + })?; + + let main_content = match template.as_str() { + "singles" => format!( + r#"/// {} - Singles figure skating program +/// +/// Created with Anvomidav + +program {} {{ + segment short_program: short {{ + sequence opening {{ + jump triple axel at 0:15 + spin camel sit upright L3 at 0:30 + step circular L3 at 1:00 + }} + }} + + segment free_skate: free {{ + sequence technical {{ + jump quad lutz at 0:30 + jump triple axel at 1:00 + spin layback L4 at 1:30 + }} + }} +}} +"#, + name, name + ), + "pairs" => format!( + r#"/// {} - Pairs figure skating program +/// +/// Created with Anvomidav + +program {} {{ + segment short_program: short {{ + skater lead + skater follow + + sequence opening {{ + parallel {{ + lead: jump double axel at 0:15 + follow: jump double axel at 0:15 + }} + lift group3 L3 at 0:30 + throw triple salchow at 1:00 + }} + }} +}} +"#, + name, name + ), + "ice-dance" => format!( + r#"/// {} - Ice dance program +/// +/// Created with Anvomidav + +program {} {{ + segment pattern: pattern {{ + skater lead + skater follow + + sequence waltz {{ + sync {{ + step circular L3 at 0:00 + }} + }} + }} +}} +"#, + name, name + ), + _ => { + return Err(miette::miette!( + "unknown template '{}'. Use: singles, pairs, or ice-dance", + template + )); + } + }; + + let main_file = project_dir.join("main.anv"); + fs::write(&main_file, main_content).map_err(|e| CliError::ReadError { + path: main_file.display().to_string(), + source: e, + })?; + + eprintln!("Created new {} project in '{}'", template, name); + eprintln!(" Main file: {}/main.anv", name); + + Ok(()) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_cli_parse() { + let cli = Cli::try_parse_from(["anv", "check", "test.anv"]); + assert!(cli.is_ok()); + } + + #[test] + fn test_cli_version() { + let cli = Cli::try_parse_from(["anv", "--version"]); + // --version causes early exit, so this will be an error + assert!(cli.is_err()); + } +} diff --git a/crates/anv-core/Cargo.toml b/crates/anv-core/Cargo.toml new file mode 100644 index 0000000..c5a72ca --- /dev/null +++ b/crates/anv-core/Cargo.toml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2025 hyperpolymath +# SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +[package] +name = "anv-core" +description = "Core types and utilities for Anvomidav" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true + +[dependencies] +derive_more = { workspace = true } +ordered-float = { workspace = true } +serde = { workspace = true } +smol_str = { workspace = true } +thiserror = { workspace = true } + +[dev-dependencies] +pretty_assertions = { workspace = true } diff --git a/crates/anv-core/src/diagnostics.rs b/crates/anv-core/src/diagnostics.rs new file mode 100644 index 0000000..c8b2ca0 --- /dev/null +++ b/crates/anv-core/src/diagnostics.rs @@ -0,0 +1,332 @@ +// SPDX-FileCopyrightText: 2025 hyperpolymath +// SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +//! Diagnostic reporting for errors, warnings, and hints. + +use crate::source::Span; +use serde::{Deserialize, Serialize}; +use std::fmt; + +/// Severity level of a diagnostic. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +pub enum Severity { + /// Informational hint. + Hint, + /// Warning (does not prevent compilation). + Warning, + /// Error (prevents successful compilation). + Error, +} + +impl fmt::Display for Severity { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Severity::Hint => write!(f, "hint"), + Severity::Warning => write!(f, "warning"), + Severity::Error => write!(f, "error"), + } + } +} + +/// Error code for categorizing diagnostics. +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct ErrorCode(pub String); + +impl ErrorCode { + // Syntax errors + pub const UNEXPECTED_TOKEN: &'static str = "E0001"; + pub const UNTERMINATED_STRING: &'static str = "E0002"; + pub const INVALID_NUMBER: &'static str = "E0003"; + pub const INVALID_TIME: &'static str = "E0004"; + + // Type errors + pub const TYPE_MISMATCH: &'static str = "E0100"; + pub const UNDEFINED_VARIABLE: &'static str = "E0101"; + pub const UNDEFINED_ELEMENT: &'static str = "E0102"; + pub const WRONG_ARITY: &'static str = "E0103"; + + // ISU rule errors + pub const INVALID_COMBINATION: &'static str = "E0200"; + pub const TOO_MANY_JUMPS: &'static str = "E0201"; + pub const ZAYAK_VIOLATION: &'static str = "E0202"; + pub const WRONG_EDGE: &'static str = "E0203"; + pub const DURATION_EXCEEDED: &'static str = "E0204"; + + // Temporal errors + pub const TEMPORAL_OVERLAP: &'static str = "E0300"; + pub const UNREACHABLE_TIME: &'static str = "E0301"; + pub const DURATION_MISMATCH: &'static str = "E0302"; + + // Spatial errors + pub const OUT_OF_BOUNDS: &'static str = "E0400"; + pub const COLLISION: &'static str = "E0401"; + pub const UNREACHABLE_POSITION: &'static str = "E0402"; + + pub fn new(code: impl Into) -> Self { + ErrorCode(code.into()) + } +} + +impl fmt::Display for ErrorCode { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} + +/// A secondary label attached to a diagnostic. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Label { + /// Span of the label. + pub span: Span, + /// Message for the label. + pub message: String, + /// Is this the primary label? + pub primary: bool, +} + +impl Label { + pub fn primary(span: Span, message: impl Into) -> Self { + Label { + span, + message: message.into(), + primary: true, + } + } + + pub fn secondary(span: Span, message: impl Into) -> Self { + Label { + span, + message: message.into(), + primary: false, + } + } +} + +/// A note or help message attached to a diagnostic. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum Note { + /// A note providing additional context. + Note(String), + /// A help message suggesting a fix. + Help(String), +} + +/// A diagnostic message. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct Diagnostic { + /// Severity level. + pub severity: Severity, + /// Error code (optional). + pub code: Option, + /// Primary message. + pub message: String, + /// Labels pointing to source locations. + pub labels: Vec