diff --git a/MODULE.bazel b/MODULE.bazel
index 9d646e8..b682568 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -13,7 +13,7 @@ pip.parse(
use_repo(pip, "pypi")
# https://registry.bazel.build/modules/abseil-cpp
-bazel_dep(name = "abseil-cpp", version = "20250512.1")
+bazel_dep(name = "abseil-cpp", version = "20250814.1")
# https://registry.bazel.build/modules/nlohmann_json
bazel_dep(name = "nlohmann_json", version = "3.11.3")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index 67761e0..72c05ba 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -1,5 +1,5 @@
{
- "lockFileVersion": 11,
+ "lockFileVersion": 18,
"registryFileHashes": {
"https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497",
"https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2",
@@ -7,27 +7,29 @@
"https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16",
- "https://bcr.bazel.build/modules/abseil-cpp/20240116.0/MODULE.bazel": "98dc378d64c12a4e4741ad3362f87fb737ee6a0886b2d90c3cdbb4d93ea3e0bf",
+ "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16",
- "https://bcr.bazel.build/modules/abseil-cpp/20240116.2/source.json": "750d5e29326fb59cbe61116a7b803c8a1d0a7090a9c8ed89888d188e3c473fc7",
- "https://bcr.bazel.build/modules/apple_support/1.13.0/MODULE.bazel": "7c8cdea7e031b7f9f67f0b497adf6d2c6a2675e9304ca93a9af6ed84eef5a524",
+ "https://bcr.bazel.build/modules/abseil-cpp/20250127.0/MODULE.bazel": "d1086e248cda6576862b4b3fe9ad76a214e08c189af5b42557a6e1888812c5d5",
+ "https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1",
+ "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2",
+ "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c",
+ "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896",
"https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85",
"https://bcr.bazel.build/modules/apple_support/1.15.1/source.json": "517f2b77430084c541bc9be2db63fdcbb7102938c5f64c17ee60ffda2e5cf07b",
- "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel": "50341a62efbc483e8a2a6aec30994a58749bd7b885e18dd96aa8c33031e558ef",
- "https://bcr.bazel.build/modules/aspect_bazel_lib/1.31.2/MODULE.bazel": "7bee702b4862612f29333590f4b658a5832d433d6f8e4395f090e8f4e85d442f",
- "https://bcr.bazel.build/modules/aspect_bazel_lib/1.38.0/MODULE.bazel": "6307fec451ba9962c1c969eb516ebfe1e46528f7fa92e1c9ac8646bef4cdaa3f",
- "https://bcr.bazel.build/modules/aspect_bazel_lib/1.40.3/MODULE.bazel": "668e6bcb4d957fc0e284316dba546b705c8d43c857f87119619ee83c4555b859",
- "https://bcr.bazel.build/modules/aspect_bazel_lib/1.40.3/source.json": "f5a28b1320e5f444e798b4afc1465c8b720bfaec7522cca38a23583dffe85e6d",
- "https://bcr.bazel.build/modules/aspect_rules_js/1.33.1/MODULE.bazel": "db3e7f16e471cf6827059d03af7c21859e7a0d2bc65429a3a11f005d46fc501b",
- "https://bcr.bazel.build/modules/aspect_rules_js/1.39.0/MODULE.bazel": "aece421d479e3c31dc3e5f6d49a12acc2700457c03c556650ec7a0ff23fc0d95",
- "https://bcr.bazel.build/modules/aspect_rules_js/1.39.0/source.json": "a8f93e4ad8843e8aa407fa5fd7c8b63a63846c0ce255371ff23384582813b13d",
- "https://bcr.bazel.build/modules/aspect_rules_lint/0.12.0/MODULE.bazel": "e767c5dbfeb254ec03275a7701b5cfde2c4d2873676804bc7cb27ddff3728fed",
- "https://bcr.bazel.build/modules/aspect_rules_lint/0.12.0/source.json": "9a3668e1ee219170e22c0e7f3ab959724c6198fdd12cd503fa10b1c6923a2559",
- "https://bcr.bazel.build/modules/bazel_features/0.1.0/MODULE.bazel": "47011d645b0f949f42ee67f2e8775188a9cf4a0a1528aa2fa4952f2fd00906fd",
"https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd",
"https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
- "https://bcr.bazel.build/modules/bazel_features/1.11.0/source.json": "c9320aa53cd1c441d24bd6b716da087ad7e4ff0d9742a9884587596edfe53015",
+ "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d",
+ "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d",
+ "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a",
+ "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58",
+ "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b",
+ "https://bcr.bazel.build/modules/bazel_features/1.23.0/MODULE.bazel": "fd1ac84bc4e97a5a0816b7fd7d4d4f6d837b0047cf4cbd81652d616af3a6591a",
+ "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d",
+ "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9",
+ "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87",
+ "https://bcr.bazel.build/modules/bazel_features/1.30.0/source.json": "b07e17f067fe4f69f90b03b36ef1e08fe0d1f3cac254c1241a1818773e3423bc",
+ "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7",
"https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a",
"https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8",
"https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e",
@@ -38,101 +40,248 @@
"https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651",
"https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138",
"https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917",
- "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6",
+ "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/source.json": "7ebaefba0b03efe59cac88ed5bbc67bcf59a3eff33af937345ede2a38b2d368a",
"https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84",
"https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8",
- "https://bcr.bazel.build/modules/gazelle/0.27.0/MODULE.bazel": "3446abd608295de6d90b4a8a118ed64a9ce11dcb3dda2dc3290a22056bd20996",
- "https://bcr.bazel.build/modules/gazelle/0.30.0/MODULE.bazel": "f888a1effe338491f35f0e0e85003b47bb9d8295ccba73c37e07702d8d31c65b",
- "https://bcr.bazel.build/modules/gazelle/0.30.0/source.json": "7af0779f99120aafc73be127615d224f26da2fc5a606b52bdffb221fd9efb737",
"https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb",
"https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4",
"https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6",
"https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f",
"https://bcr.bazel.build/modules/googletest/1.15.0/MODULE.bazel": "c4515ecca65378b9035bb6ccee496c1a362b31311c2380ca7740a73bfdaccb51",
- "https://bcr.bazel.build/modules/googletest/1.15.0/source.json": "c235880d343a5758da581c839653abeebb5f5cd9d987ff879ca68bf08a59f879",
+ "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108",
+ "https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46",
+ "https://bcr.bazel.build/modules/googletest/1.17.0/source.json": "38e4454b25fc30f15439c0378e57909ab1fd0a443158aa35aec685da727cd713",
"https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075",
- "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d",
+ "https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0",
+ "https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000",
"https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902",
"https://bcr.bazel.build/modules/nlohmann_json/3.11.3/MODULE.bazel": "87023db2f55fc3a9949c7b08dc711fae4d4be339a80a99d04453c4bb3998eefc",
"https://bcr.bazel.build/modules/nlohmann_json/3.11.3/source.json": "296c63a90c6813e53b3812d24245711981fc7e563d98fe15625f55181494488a",
+ "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74",
"https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5",
- "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5",
+ "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f",
"https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee",
"https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37",
"https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615",
"https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814",
"https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d",
"https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc",
+ "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580",
+ "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96",
"https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
- "https://bcr.bazel.build/modules/protobuf/28.2/MODULE.bazel": "c0c8e51757df486d0314fa290e174d707bad4a6c2aa5ccb08a4b4abd76a23e90",
- "https://bcr.bazel.build/modules/protobuf/28.2/source.json": "31a22dd0dd25b579257b0c5821b527a9bc987b7c16cf111fbf31704c2786651b",
+ "https://bcr.bazel.build/modules/protobuf/23.1/MODULE.bazel": "88b393b3eb4101d18129e5db51847cd40a5517a53e81216144a8c32dfeeca52a",
+ "https://bcr.bazel.build/modules/protobuf/24.4/MODULE.bazel": "7bc7ce5f2abf36b3b7b7c8218d3acdebb9426aeb35c2257c96445756f970eb12",
+ "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
+ "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
+ "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df",
+ "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92",
+ "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e",
"https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
- "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573",
- "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858",
+ "https://bcr.bazel.build/modules/protobuf/31.1/MODULE.bazel": "379a389bb330b7b8c1cdf331cc90bf3e13de5614799b3b52cdb7c6f389f6b38e",
+ "https://bcr.bazel.build/modules/protobuf/31.1/source.json": "25af5d0219da0c0fc4d1191a24ce438e6ca7f49d2e1a94f354efeba6ef10426f",
"https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e",
"https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34",
"https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680",
"https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206",
+ "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a",
+ "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4",
"https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa",
- "https://bcr.bazel.build/modules/re2/2024-07-02/source.json": "547d0111a9d4f362db32196fef805abbf3676e8d6afbe44d395d87816c1130ca",
- "https://bcr.bazel.build/modules/rules_buf/0.1.1/MODULE.bazel": "6189aec18a4f7caff599ad41b851ab7645d4f1e114aa6431acf9b0666eb92162",
- "https://bcr.bazel.build/modules/rules_buf/0.1.1/source.json": "021363d254f7438f3f10725355969c974bb2c67e0c28667782ade31a9cdb747f",
+ "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8",
+ "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e",
+ "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a",
+ "https://bcr.bazel.build/modules/rules_apple/3.16.0/source.json": "d8b5fe461272018cc07cfafce11fe369c7525330804c37eec5a82f84cd475366",
"https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87",
+ "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a",
"https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c",
"https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f",
"https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
"https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
- "https://bcr.bazel.build/modules/rules_cc/0.0.9/source.json": "1f1ba6fea244b616de4a554a0f4983c91a9301640c8fe0dd1d410254115c8430",
+ "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513",
+ "https://bcr.bazel.build/modules/rules_cc/0.1.4/MODULE.bazel": "bb03a452a7527ac25a7518fb86a946ef63df860b9657d8323a0c50f8504fb0b9",
+ "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c",
+ "https://bcr.bazel.build/modules/rules_cc/0.2.0/source.json": "5f7f4e578e950adbf194217d4b607237a8197fc53ba46c367b3d61a86ecf35c2",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
- "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e",
- "https://bcr.bazel.build/modules/rules_go/0.33.0/MODULE.bazel": "a2b11b64cd24bf94f57454f53288a5dacfe6cb86453eee7761b7637728c1910c",
- "https://bcr.bazel.build/modules/rules_go/0.38.1/MODULE.bazel": "fb8e73dd3b6fc4ff9d260ceacd830114891d49904f5bda1c16bc147bcc254f71",
- "https://bcr.bazel.build/modules/rules_go/0.39.1/MODULE.bazel": "d34fb2a249403a5f4339c754f1e63dc9e5ad70b47c5e97faee1441fc6636cd61",
- "https://bcr.bazel.build/modules/rules_go/0.39.1/source.json": "f21e042154010ae2c944ab230d572b17d71cdb27c5255806d61df6ccaed4354c",
"https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74",
"https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86",
+ "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39",
+ "https://bcr.bazel.build/modules/rules_java/6.3.0/MODULE.bazel": "a97c7678c19f236a956ad260d59c86e10a463badb7eb2eda787490f4c969b963",
+ "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6",
"https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31",
- "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1",
- "https://bcr.bazel.build/modules/rules_java/7.6.5/source.json": "a805b889531d1690e3c72a7a7e47a870d00323186a9904b36af83aa3d053ee8d",
+ "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel": "30d9135a2b6561c761bd67bd4990da591e6bdc128790ce3e7afd6a3558b2fb64",
+ "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a",
+ "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6",
+ "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab",
+ "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2",
+ "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
+ "https://bcr.bazel.build/modules/rules_java/8.12.0/MODULE.bazel": "8e6590b961f2defdfc2811c089c75716cb2f06c8a4edeb9a8d85eaa64ee2a761",
+ "https://bcr.bazel.build/modules/rules_java/8.12.0/source.json": "cbd5d55d9d38d4008a7d00bee5b5a5a4b6031fcd4a56515c9accbcd42c7be2ba",
+ "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017",
+ "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939",
+ "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2",
"https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
"https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909",
- "https://bcr.bazel.build/modules/rules_jvm_external/5.1/source.json": "5abb45cc9beb27b77aec6a65a11855ef2b55d95dfdc358e9f312b78ae0ba32d5",
+ "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036",
+ "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d",
+ "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4",
+ "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0",
+ "https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd",
+ "https://bcr.bazel.build/modules/rules_jvm_external/6.7/source.json": "5426f412d0a7fc6b611643376c7e4a82dec991491b9ce5cb1cfdd25fe2e92be4",
+ "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59",
+ "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3",
+ "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5",
"https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
"https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d",
- "https://bcr.bazel.build/modules/rules_license/0.0.8/MODULE.bazel": "5669c6fe49b5134dbf534db681ad3d67a2d49cfc197e4a95f1ca2fd7f3aebe96",
- "https://bcr.bazel.build/modules/rules_license/0.0.8/source.json": "ccfd3964cd0cd1739202efb8dbf9a06baab490e61e174b2ad4790f9c4e610beb",
- "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/MODULE.bazel": "6bc03c8f37f69401b888023bf511cb6ee4781433b0cb56236b2e55a21e3a026a",
- "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/source.json": "6e82cf5753d835ea18308200bc79b9c2e782efe2e2a4edc004a9162ca93382ca",
+ "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c",
+ "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb",
"https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc",
- "https://bcr.bazel.build/modules/rules_pkg/0.7.0/source.json": "c2557066e0c0342223ba592510ad3d812d4963b9024831f7f66fd0584dd8c66c",
+ "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff",
+ "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a",
"https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06",
"https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7",
"https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483",
- "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/source.json": "8d8448e71706df7450ced227ca6b3812407ff5e2ccad74a43a9fbe79c84e34e0",
+ "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73",
+ "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2",
+ "https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1",
"https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f",
- "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel": "26114f0c0b5e93018c0c066d6673f1a2c3737c7e90af95eff30cfee38d0bbac7",
+ "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300",
"https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382",
"https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed",
"https://bcr.bazel.build/modules/rules_python/0.29.0/MODULE.bazel": "2ac8cd70524b4b9ec49a0b8284c79e4cd86199296f82f6e0d5da3f783d660c82",
"https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58",
"https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937",
- "https://bcr.bazel.build/modules/rules_python/0.33.2/source.json": "e539592cd3aae4492032cecea510e46ca16eeb972271560b922cae9893944e2f",
+ "https://bcr.bazel.build/modules/rules_python/0.38.0/MODULE.bazel": "ee75c9510a481eb92c7c04e432f84023065bbc8dcf6e49b7399e7c660624acdd",
"https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
- "https://bcr.bazel.build/modules/rules_rust/0.45.1/MODULE.bazel": "a69d0db3a958fab2c6520961e1b2287afcc8b36690fd31bbc4f6f7391397150d",
- "https://bcr.bazel.build/modules/rules_rust/0.45.1/source.json": "28a181c6bc9d037bd2a8f2875908d821027def05f87af51b79277395c7b50c71",
- "https://bcr.bazel.build/modules/stardoc/0.5.0/MODULE.bazel": "f9f1f46ba8d9c3362648eea571c6f9100680efc44913618811b58cc9c02cd678",
+ "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7",
+ "https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43",
+ "https://bcr.bazel.build/modules/rules_python/1.0.0/source.json": "b0162a65c6312e45e7912e39abd1a7f8856c2c7e41ecc9b6dc688a6f6400a917",
+ "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
+ "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
+ "https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3",
+ "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca",
+ "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046",
+ "https://bcr.bazel.build/modules/rules_swift/2.1.1/source.json": "40fc69dfaac64deddbb75bd99cdac55f4427d9ca0afbe408576a65428427a186",
"https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
"https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c",
- "https://bcr.bazel.build/modules/stardoc/0.5.4/MODULE.bazel": "6569966df04610b8520957cb8e97cf2e9faac2c0309657c537ab51c16c18a2a4",
- "https://bcr.bazel.build/modules/stardoc/0.5.4/source.json": "a961f58a71e735aa9dcb2d79b288e06b0a2d860ba730302c8f11be411b76631e",
+ "https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef",
+ "https://bcr.bazel.build/modules/stardoc/0.6.2/MODULE.bazel": "7060193196395f5dd668eda046ccbeacebfd98efc77fed418dbe2b82ffaa39fd",
+ "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c",
+ "https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7",
+ "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5",
+ "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216",
+ "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91",
+ "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/source.json": "32bd87e5f4d7acc57c5b2ff7c325ae3061d5e242c0c4c214ae87e0f1c13e54cb",
"https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
+ "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9",
"https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
- "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
- "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/MODULE.bazel": "af322bc08976524477c79d1e45e241b6efbeb918c497e8840b8ab116802dda79",
- "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.3/source.json": "2be409ac3c7601245958cd4fcdff4288be79ed23bd690b4b951f500d54ee6e7d",
+ "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca",
+ "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
},
"selectedYankedVersions": {},
- "moduleExtensions": {}
+ "moduleExtensions": {
+ "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": {
+ "general": {
+ "bzlTransitiveDigest": "E970FlMbwpgJPdPUQzatKh6BMfeE0ZpWABvwshh7Tmg=",
+ "usagesDigest": "EJfdUgbJdIRboG70S9dz8HhGVkL2/s3qFQ9xht8y2Rs=",
+ "recordedFileInputs": {},
+ "recordedDirentsInputs": {},
+ "envVariables": {},
+ "generatedRepoSpecs": {
+ "local_config_apple_cc_toolchains": {
+ "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf_toolchains",
+ "attributes": {}
+ },
+ "local_config_apple_cc": {
+ "repoRuleId": "@@apple_support+//crosstool:setup.bzl%_apple_cc_autoconf",
+ "attributes": {}
+ }
+ },
+ "recordedRepoMappingEntries": [
+ [
+ "apple_support+",
+ "bazel_tools",
+ "bazel_tools"
+ ],
+ [
+ "bazel_tools",
+ "rules_cc",
+ "rules_cc+"
+ ]
+ ]
+ }
+ },
+ "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
+ "general": {
+ "bzlTransitiveDigest": "hUTp2w+RUVdL7ma5esCXZJAFnX7vLbVfLd7FwnQI6bU=",
+ "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=",
+ "recordedFileInputs": {},
+ "recordedDirentsInputs": {},
+ "envVariables": {},
+ "generatedRepoSpecs": {
+ "com_github_jetbrains_kotlin_git": {
+ "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository",
+ "attributes": {
+ "urls": [
+ "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip"
+ ],
+ "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88"
+ }
+ },
+ "com_github_jetbrains_kotlin": {
+ "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository",
+ "attributes": {
+ "git_repository_name": "com_github_jetbrains_kotlin_git",
+ "compiler_version": "1.9.23"
+ }
+ },
+ "com_github_google_ksp": {
+ "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository",
+ "attributes": {
+ "urls": [
+ "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip"
+ ],
+ "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
+ "strip_version": "1.9.23-1.0.20"
+ }
+ },
+ "com_github_pinterest_ktlint": {
+ "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file",
+ "attributes": {
+ "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985",
+ "urls": [
+ "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint"
+ ],
+ "executable": true
+ }
+ },
+ "rules_android": {
+ "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
+ "attributes": {
+ "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
+ "strip_prefix": "rules_android-0.1.1",
+ "urls": [
+ "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"
+ ]
+ }
+ }
+ },
+ "recordedRepoMappingEntries": [
+ [
+ "rules_kotlin+",
+ "bazel_tools",
+ "bazel_tools"
+ ]
+ ]
+ }
+ }
+ }
}
diff --git a/README.md b/README.md
index 729a122..e19c136 100644
--- a/README.md
+++ b/README.md
@@ -49,18 +49,7 @@ JSIR needs to achieve two seemingly conflicting goals:
* It needs to be **low-level** enough to facilitate dataflow analysis, in
order to support taint analysis, constant propagation, etc..
-To achieve these goals, JSIR defines two dialects:
-
-* **JSHIR:**
-
- This is a high-level IR that uses MLIR regions to accurately model control
- flow structures.
-
-* **JSLIR:**
-
- This is a low-level IR that uses CFGs to represent branching behaviors.
- JSLIR adds extra operations to annotate the kind of original control flow
- structures. This allows JSLIR to be fully converted back to JSHIR.
+To achieve these goals, JSIR defines a high level IR that uses MLIR regions to accurately model control flow structures.
See
[intermediate_representation_design.md](docs/intermediate_representation_design.md)
diff --git a/docs/intermediate_representation_design.md b/docs/intermediate_representation_design.md
index 14fa326..341fd7b 100644
--- a/docs/intermediate_representation_design.md
+++ b/docs/intermediate_representation_design.md
@@ -2,55 +2,49 @@
## Overview
-JSIR is a next-generation JavaScript analysis tool from Google. At its core
+JSIR is a next-generation JavaScript analysis tooling from Google. At its core
is an [MLIR](https://mlir.llvm.org)-based high-level intermediate representation
(IR). More specifically:
* JSIR **retains all information** from the ([Babel](https://babeljs.io))
abstract syntax tree (AST), including original control flow structures,
- source ranges, comments, etc.. As a result, **JSIR can be fully lifted back
+ source ranges, comments, etc. As a result, **JSIR can be fully lifted back
to the AST**, and therefore back to the source, making it suitable for
source-to-source transformation.
* JSIR provides a standard **dataflow analysis API**, built on top of the
- upstream [MLIR API](https://mlir.llvm.org/docs/Tutorials/DataFlowAnalysis),
+ built-in [MLIR API](https://mlir.llvm.org/docs/Tutorials/DataFlowAnalysis),
with ease-of-use improvements.
This design was driven by the diverse needs at Google for malicious JavaScript
-analysis and detection. For example, taint analysis is a dataflow analysis which
-requires a CFG; decompilation requires lifting low-level representations to
-source code; deobfuscation is a source-to-source transformation.
+analysis and detection. For example, taint analysis is a dataflow analysis;
+decompilation requires lifting low-level representations to source code;
+deobfuscation is a source-to-source transformation.
-To achieve the design goals, JSIR defines two MLIR dialects:
-
-* **JSHIR:** A high-level IR that has a nearly one-to-one mapping with the
- abstract syntax tree (AST). JSHIR models control flow structures using MLIR
- [regions](https://mlir.llvm.org/docs/LangRef/#regions).
-
-* **JSLIR:** A low-level IR that uses Control Flow Graphs (CFGs) to represent
- branching behaviors. JSLIR adds extra annotations to the CFGs, to preserve
- information about original control flow structures and enable full
- conversion back to the JSHIR.
+To achieve these design goals, JSIR is designed as a high-level IR that has a
+nearly one-to-one mapping with the abstract syntax tree (AST), and models
+control flow structures using MLIR
+[regions](https://mlir.llvm.org/docs/LangRef/#regions).
## Achieving AST ↔ IR Roundtrip
-A critical goal of this project is to ensure an accurate lift of the IR back to
-the AST. This "reversible" IR design enables source-to-source transformations -
-we perform IR transformations then lift the transformed IR to source.
+A critical goal of JSIR is to ensure an accurate lift of the IR back to the AST.
+This "reversible" IR design enables source-to-source transformations - we
+perform IR transformations then lift the transformed IR to source.
-Internal evaluations on billions of JavaScript samples showed that, AST - IR
+Internal evaluations on billions of JavaScript samples showed that AST - IR
round-trips achieved 99.9%+ success resulting in the same source.
In the following sections, we will describe important design decisions that
-achieve this perfect round-trip.
+achieve this high-fidelity round-trip.
## Post-order traversal of AST
-Let’s start from the simplest case - straightline code, i.e. a list of
+Let’s start from the simplest case - straight-line code, i.e. a list of
statements with no control flow structures like `if`-statements.
-Each of these simple expression / statement AST node is mapped to a
-corresponding JSIR operation. Therefore, JSIR for straightline code is
+Each of these simple expression / statement AST nodes is mapped to a
+corresponding JSIR operation. Therefore, JSIR for straight-line code is
equivalent to a post-order traversal dump of the AST.
For example, for the following JavaScript statements:
@@ -71,16 +65,16 @@ for the full AST):
op: '+',
left: BinaryExpression {
op: '+',
- left: NumericLiteral { value: 1 }
+ left: NumericLiteral { value: 1 },
right: NumericLiteral { value: 2 }
- }
+ },
right: NumericLiteral { value: 3 }
}
},
ExpressionStatement {
expression: BinaryExpression {
op: '*',
- left: NumericLiteral { value: 4 }
+ left: NumericLiteral { value: 4 },
right: NumericLiteral { value: 5 }
}
},
@@ -102,6 +96,22 @@ jsir.expression_statement (%1_plus_2_plus_3)
jsir.expression_statement (%4_mult_5)
```
+Perhaps the one-to-one mapping from AST nodes to JSIR operations is more obvious
+if we add some indentations:
+
+```mlir
+ %1 = jsir.numeric_literal {1}
+ %2 = jsir.numeric_literal {2}
+ %1_plus_2 = jsir.binary_expression {'+'} (%1, %2)
+ %3 = jsir.numeric_literal {3}
+ %1_plus_2_plus_3 = jsir.binary_expression {'+'} (%1_plus_2, %3)
+jsir.expression_statement (%1_plus_2_plus_3)
+ %4 = jsir.numeric_literal {4}
+ %5 = jsir.numeric_literal {5}
+ %4_mult_5 = jsir.binary_expression {'*'} (%4, %5)
+jsir.expression_statement (%4_mult_5)
+```
+
To lift this IR back to the AST, we **cannot** treat each op as a separate
statement, because that would cause every SSA value (e.g. `%1`) to become a
local variable:
@@ -125,18 +135,18 @@ However, we can detect the two statement-level ops (i.e. the two
```js {.good}
1 + 2 + 3 ;
-// ~ %1 = jsir.numeric_literal {1}
-// ~ %2 = jsir.numeric_literal {2}
-// ~~~~~ %1_plus_2 = jsir.binary_expression {'+'} (%1, %2)
-// ~ %3 = jsir.numeric_literal {3}
-// ~~~~~~~~~ %1_plus_2_plus_3 = jsir.binary_expression {'+'} (%1_plus_2, %3)
+// ~ %1 = jsir.numeric_literal {1}
+// ~ %2 = jsir.numeric_literal {2}
+// ~~~~~ %1_plus_2 = jsir.binary_expression {'+'} (%1, %2)
+// ~ %3 = jsir.numeric_literal {3}
+// ~~~~~~~~~ %1_plus_2_plus_3 = jsir.binary_expression {'+'} (%1_plus_2, %3)
// ~~~~~~~~~~~ jsir.expression_statement (%1_plus_2_plus_3)
4 * 5 ;
-// ~ %4 = jsir.numeric_literal {4}
-// ~ %5 = jsir.numeric_literal {5}
-// ~~~~~ %4_mult_5 = jsir.binary_expression {'*'} (%4, %5)
-// ~~~~~~~ jsir.expression_statement (%4_mult_5)
+// ~ %4 = jsir.numeric_literal {4}
+// ~ %5 = jsir.numeric_literal {5}
+// ~~~~~ %4_mult_5 = jsir.binary_expression {'*'} (%4, %5)
+// ~~~~~~~ jsir.expression_statement (%4_mult_5)
```
When we try to lift a basic block (`mlir::Block`) of JSIR ops we always know
@@ -159,21 +169,21 @@ ahead of time what "kind" of content it holds:
## Symbols, l-values and r-values
-We distinguish between lvalues and rvalues in JSIR. For example, consider the
+We distinguish between l-values and r-values in JSIR. For example, consider the
following assignment:
```js
a = b;
```
-`a` is an lvalue, and `b` is an rvalue.
+`a` is an l-value, and `b` is an r-value.
-L-values ane r-values are represented in the **same** way in the AST:
+L-values and r-values are represented in the **same** way in the AST:
```c++
ExpressionStatement {
expression: AssignmentExpression {
- left: Identifier {"a"}
+ left: Identifier {"a"},
right: Identifier {"b"}
}
}
@@ -182,8 +192,8 @@ ExpressionStatement {
However, they are represented **differently** in the IR:
```c++
-%a_ref = jsir.identifier_ref {"a"} // lvalue
-%b = jsir.identifier {"b"} // rvalue
+%a_ref = jsir.identifier_ref {"a"} // l-value
+%b = jsir.identifier {"b"} // r-value
%assign = jsir.assignment_expression (%a_ref, %b)
jsir.expression_statement (%assign)
```
@@ -193,17 +203,21 @@ semantic meanings:
* An l-value is a reference to some object / some memory location;
-* An rvalue is some value.
+* An r-value is some value.
-## Representing control flows: JSHIR
+> **NOTE:** We will likely revisit how we represent symbols.
-As mentioned above, JSHIR seeks to have a nearly one-to-one mapping from the
+## Representing control flows
+
+As mentioned above, JSIR seeks to have a nearly one-to-one mapping from the
AST. Therefore, to preserve all information about the original control flow
structures, we define a separate op for each control flow structure (e.g.
`jshir.if_statement`, `jshir.while_statement`, etc.). The nested code blocks are
represented as MLIR [regions](https://mlir.llvm.org/docs/LangRef/#regions).
-For example, consider the following `if`-statement:
+### Example: `if`-statement
+
+Consider the following `if`-statement:
```js
if (cond)
@@ -212,21 +226,22 @@ else
b;
```
-Its corresponding AST is as follows:
+Its corresponding AST is as follows
+([astexplorer](https://astexplorer.net/#/gist/58e3ca121e8bc97d9d1987766f4df96a/37b0de0e94073d24f40aede05b14e1c480b7b39a)):
```c++
IfStatement {
- test: Identifier {"cond"}
+ test: Identifier { name: "cond" },
consequent: ExpressionStatement {
- expression: Identifier {"a"}
- }
+ expression: Identifier { name: "a" }
+ },
alternate: ExpressionStatement {
- expression: Identifier {"b"}
+ expression: Identifier { name: "b" }
}
}
```
-And, its corresponding JSHIR is as follows:
+And, its corresponding JSIR is as follows:
```mlir
%cond = jsir.identifier {"cond"}
@@ -239,143 +254,92 @@ jshir.if_statement (%cond) ({
})
```
-Since nested structure is fully preserved, lifting JSHIR back to the AST is
+Since nested structure is fully preserved, lifting JSIR back to the AST is
achieved by a standard recursive traversal.
-## Representing control flows: JSLIR
+### Example: `while`-statement
-### Control flow graph
+Consider the following `while`-statement:
-The region-based nested structure of JSHIR, though intuitive and readable, does
-not provide enough control flow information to facilitate
-[dataflow analysis](https://en.wikipedia.org/wiki/Data-flow_analysis).
+```js
+while (cond())
+ x++;
+```
-Dataflow analysis traverses the IR as a graph, which requires knowing the "next
-op" of each op. Ironically, a program with only `goto`-statements but no
-structured control flow would satisfy this requirement. IRs typically lower
-structured control flow to branch ops which are essentially `goto`-statements.
-This is also what JSLIR does.
+Its corresponding AST is as follows ([astexplorer](https://astexplorer.net/#/gist/58e3ca121e8bc97d9d1987766f4df96a/6ce08d84210afbacdf99732366e04eafcd6b3ab5)):
+
+```c++
+WhileStatement {
+ test: CallExpression {
+ callee: Identifier { name: "cond" },
+ arguments: []
+ },
+ body: ExpressionStatement {
+ expression: UpdateExpression {
+ operator: "++",
+ prefix: false,
+ argument: Identifier { name: "x" }
+ }
+ }
+}
+```
-For example, for the following JSHIR:
+Its corresponding JSIR is as follows:
```mlir
-%cond = jsir.identifier {"cond"}
-jshir.if_statement (%cond) ({
- %a = jsir.identifier {"a"}
- jsir.expression_statement (%a)
+jshir.while_statement ({
+ %cond_id = jsir.identifier {"cond"}
+ %cond_call = jsir.call_expression (%cond_id)
+ jsir.expr_region_end (%cond_call)
}, {
- %b = jsir.identifier {"b"}
- jsir.expression_statement (%b)
+ %x_ref = jsir.identifier_ref {"x"}
+ %update = jsir.update_expression {"++"} (%x_ref)
+ jsir.expression_statement (%update)
})
```
-We lower the `jshir.if_statement` into the following CFG with branch ops:
-
-
%cond = jsir.identifier {"cond"}
- // if %cond goto ^bb_true else goto ^bb_false
- cf.cond_br (%cond) [^bb_true, ^bb_false]
+Note that unlike `jshir.if_statement`, the condition in a
+`jshir.while_statement` is represented as a region rather than a normal SSA
+value (`%cond`). This is because the condition is evaluated in each iteration
+**within** the `while`-statement, whereas the condition is evaluated only once
+**before** the `if`-statement.
-^bb_true:
- %a = jsir.identifier {"a"}
- jsir.expression_statement (%a)
- // goto ^bb_end
- cf.br [^bb_end]
+### Example: logical expression
-^bb_false:
- %b = jsir.identifier {"b"}
- jsir.expression_statement (%b)
- // goto ^bb_end
- cf.br [^bb_end]
-
-^bb_end:
- ...
-
-
-In particular:
-
-* We flatten the nested structure into blocks (e.g. `^bb_true`);
-
-* Each block contains a list of ops;
-
-* We explicitly represent branch behaviors with `cf.cond_br`
- ("control_flow.conditional_branch") and `cf.br` ("control_flow.branch") ops.
- In particular, at the entry of the `if`-statement, we branch into either
- `bb_true` or `bb_false` based on the condition `%cond`; and at the end of
- both blocks we branch and merge to the same block `bb_end`.
-
-### Challenge: lift back to AST
-
-However, this IR would lose the explicit information that these blocks represent
-an `if`-statement, which makes it hard to lift back the AST.
-
-This challenge is more evident with more complex control flow structures. For
-example, consider the following code with an `if`-statement within a
-`while`-statement.
+Consider the following statement with a logical expression:
```js
-...
-while (cond)
- if (test)
- body;
-...
+x = a && b;
```
-The JSLIR is as follows:
+Its corresponding AST is as follows ([astexplorer](https://astexplorer.net/#/gist/58e3ca121e8bc97d9d1987766f4df96a/c7fbec034a61bcbb66959714b7d95dbd9ca86e32)):
-``` {.bad}
- ...
- cf.br [^bb1]
-
-^bb1:
- %cond = jsir.identifier {"cond"}
- cf.cond_br (%cond) [^bb2, ^bb5]
-
-^bb2:
- %test = jsir.identifier {"test"}
- cf.cond_br (%test) [^bb3, ^bb4]
-
-^bb3:
- %body = jsir.identifier {"body"}
- jsir.expression_statement (%body)
- cf.br [^bb4]
-
-^bb4:
- cf.br [^while_test]
-
-^bb5:
- ...
+```c++
+ExpressionStatement {
+ expression: AssignmentExpression {
+ left: Identifier { name: "x" },
+ right: LogicalExpression {
+ left: Identifier { name: "a" },
+ right: Identifier { name: "b" }
+ }
+ }
+}
```
-### Solution: annotation ops
-
-Our solution is to add additional annotation ops to JSLIR which provide explicit
-information about what control flow structure each block represents. These
-annotation ops do not affect the semantics of the IR (i.e. they are considered
-no-ops during analyses). However, during the lift, we can use them to guide a
-recursive traversal of the original control flow structures.
+Its corresponding JSIR is as follows:
-For example, the annotated JSLIR for the `if`-statement is as follows:
-
- %cond = jsir.identifier {"cond"}
- %token = jslir.control_flow_starter {IfStatement}
- cf.cond_br (%cond) [^bb_true, ^bb_false]
-
-^bb_true:
- jslir.control_flow_marker (%token) {IfStatementConsequent}
- %a = jsir.identifier {"a"}
- jsir.expression_statement (%a)
- cf.br [^bb_end]
-
-^bb_false:
- jslir.control_flow_marker (%token) {IfStatementAlternate}
+```mlir
+%x_ref = jsir.identifier_ref {"x"}
+%a = jsir.identifier {"a"}
+%and = jshir.logical_expression (%a) ({
%b = jsir.identifier {"b"}
- jsir.expression_statement (%b)
- cf.br [^bb_end]
-
-^bb_end:
- jslir.control_flow_marker (%token) {IfStatementEnd}
- ...
-
+ jsir.expr_region_end (%b)
+})
+%assign = jsir.assignment_expression (%x_ref, %and)
+jsir.expression_statement (%assign)
+```
-Note that by tracing the uses of `%token`, we can locate the starting points of
-all components of an `if`-statement.
+Note that in `jshir.logical_expression`, `left` is an SSA value, and `right` is
+a region. This is because `left` is always evaluated first, whereas `right` is
+only evaluated if the result of `left` is truthy, and omitted if `left` is falsy
+due to the short-circuit behavior.
diff --git a/maldoca/astgen/BUILD b/maldoca/astgen/BUILD
index c2d14c8..7d85aba 100644
--- a/maldoca/astgen/BUILD
+++ b/maldoca/astgen/BUILD
@@ -144,6 +144,7 @@ cc_test(
"//maldoca/base:filesystem",
"//maldoca/base/testing:status_matchers",
"@abseil-cpp//absl/container:flat_hash_map",
+ "@abseil-cpp//absl/status",
"@googletest//:gtest_main",
],
)
diff --git a/maldoca/astgen/OWNERS b/maldoca/astgen/OWNERS
deleted file mode 100644
index d163000..0000000
--- a/maldoca/astgen/OWNERS
+++ /dev/null
@@ -1,2 +0,0 @@
-# LLVM owners for API updates. (see go/mlir-sla).
-suggest-reviewers-ignore: file://depot/google3/llvm/OWNERS
diff --git a/maldoca/astgen/ast_def.cc b/maldoca/astgen/ast_def.cc
index 573ed0a..e5d08d7 100644
--- a/maldoca/astgen/ast_def.cc
+++ b/maldoca/astgen/ast_def.cc
@@ -355,6 +355,11 @@ absl::StatusOr AstDef::FromProto(const AstDefPb &pb) {
for (const UnionTypePb &union_type_pb : pb.union_types()) {
auto union_type_node = absl::WrapUnique(new NodeDef());
union_type_node->name_ = union_type_pb.name();
+ union_type_node->should_generate_ir_op_ =
+ union_type_pb.should_generate_ir_op();
+ for (auto kind : union_type_pb.kinds()) {
+ union_type_node->kinds_.push_back(static_cast(kind));
+ }
if (nodes.contains(union_type_pb.name())) {
return absl::InvalidArgumentError(
absl::StrCat(union_type_pb.name(), " already exists!"));
diff --git a/maldoca/astgen/ast_def.proto b/maldoca/astgen/ast_def.proto
index 2d169cd..c607113 100644
--- a/maldoca/astgen/ast_def.proto
+++ b/maldoca/astgen/ast_def.proto
@@ -20,7 +20,6 @@ import "maldoca/astgen/type.proto";
option java_multiple_files = true;
-
// =========
// FieldKind
// =========
@@ -336,6 +335,13 @@ message UnionTypePb {
// Types which are members of this union.
repeated string types = 3;
+
+ // If true, automatically generate the corresponding op.
+ // If false, the op is expected to be manually written.
+ optional bool should_generate_ir_op = 4;
+
+ // Supported kinds. Each kind leads to a different IR op.
+ repeated FieldKind kinds = 5;
}
// Top-level AST definition.
diff --git a/maldoca/astgen/symbol.h b/maldoca/astgen/symbol.h
index fe02a8d..3ca34ed 100644
--- a/maldoca/astgen/symbol.h
+++ b/maldoca/astgen/symbol.h
@@ -43,13 +43,13 @@ class Symbol {
// Concatenation.
// E.g. "one_two" + "three_four" => "one_two_three_four"
- Symbol &operator+=(const Symbol &other);
- Symbol &operator+=(Symbol &&other);
+ Symbol& operator+=(const Symbol& other);
+ Symbol& operator+=(Symbol&& other);
- Symbol &operator+=(absl::string_view other);
+ Symbol& operator+=(absl::string_view other);
template
- Symbol operator+(T &&other) const {
+ Symbol operator+(T&& other) const {
Symbol words = *this;
words += other;
return words;
diff --git a/maldoca/astgen/test/lambda/conversion/ast_to_lair.h b/maldoca/astgen/test/lambda/conversion/ast_to_lair.h
index c8d1c84..a374a36 100644
--- a/maldoca/astgen/test/lambda/conversion/ast_to_lair.h
+++ b/maldoca/astgen/test/lambda/conversion/ast_to_lair.h
@@ -35,7 +35,7 @@ class AstToLair {
template
Op CreateStmt(const JsNode *node, Args &&...args) {
- return builder_.create(builder_.getUnknownLoc(), std::nullopt,
+ return builder_.create(builder_.getUnknownLoc(), mlir::TypeRange(),
std::forward(args)...);
}
diff --git a/maldoca/astgen/test/lambda/conversion/lair_to_ast.generated.cc b/maldoca/astgen/test/lambda/conversion/lair_to_ast.generated.cc
deleted file mode 100644
index 154085c..0000000
--- a/maldoca/astgen/test/lambda/conversion/lair_to_ast.generated.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// =============================================================================
-// STOP!! DO NOT MODIFY!! THIS FILE IS AUTOMATICALLY GENERATED.
-// =============================================================================
-
-// IWYU pragma: begin_keep
-// NOLINTBEGIN(whitespace/line_length)
-// clang-format off
-
-#include "maldoca/astgen/test/lambda/conversion/lair_to_ast.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "llvm/ADT/APFloat.h"
-#include "llvm/ADT/TypeSwitch.h"
-#include "llvm/Support/Casting.h"
-#include "mlir/IR/Attributes.h"
-#include "mlir/IR/Block.h"
-#include "mlir/IR/Builders.h"
-#include "mlir/IR/BuiltinAttributes.h"
-#include "mlir/IR/BuiltinTypes.h"
-#include "mlir/IR/Operation.h"
-#include "mlir/IR/Region.h"
-#include "mlir/IR/Value.h"
-#include "absl/cleanup/cleanup.h"
-#include "absl/log/check.h"
-#include "absl/log/log.h"
-#include "absl/status/status.h"
-#include "absl/status/statusor.h"
-#include "absl/strings/str_cat.h"
-#include "absl/types/optional.h"
-#include "absl/types/variant.h"
-#include "maldoca/base/status_macros.h"
-#include "maldoca/astgen/test/lambda/ast.generated.h"
-#include "maldoca/astgen/test/lambda/ir.h"
-
-namespace maldoca {
-
-absl::StatusOr>
-LairToAst::VisitExpression(LairExpressionOpInterface op) {
- using Ret = absl::StatusOr>;
- return llvm::TypeSwitch(op)
- .Case([&](LairVariableOp op) {
- return VisitVariable(op);
- })
- .Case([&](LairFunctionDefinitionOp op) {
- return VisitFunctionDefinition(op);
- })
- .Case([&](LairFunctionCallOp op) {
- return VisitFunctionCall(op);
- })
- .Default([&](mlir::Operation* op) {
- return absl::InvalidArgumentError("Unrecognized op");
- });
-}
-
-absl::StatusOr>
-LairToAst::VisitVariable(LairVariableOp op) {
- std::string identifier = op.getIdentifierAttr().str();
- return Create(
- op,
- std::move(identifier));
-}
-
-absl::StatusOr>
-LairToAst::VisitVariableRef(LairVariableRefOp op) {
- std::string identifier = op.getIdentifierAttr().str();
- return Create(
- op,
- std::move(identifier));
-}
-
-absl::StatusOr>
-LairToAst::VisitFunctionDefinition(LairFunctionDefinitionOp op) {
- MALDOCA_ASSIGN_OR_RETURN(auto mlir_parameter_value, GetExprRegionValue(op.getParameter()));
- auto parameter_op = llvm::dyn_cast(mlir_parameter_value.getDefiningOp());
- if (parameter_op == nullptr) {
- return absl::InvalidArgumentError(
- absl::StrCat("Expected LairVariableRefOp, got ",
- mlir_parameter_value.getDefiningOp()->getName().getStringRef().str(), "."));
- }
- MALDOCA_ASSIGN_OR_RETURN(std::unique_ptr parameter, VisitVariableRef(parameter_op));
- MALDOCA_ASSIGN_OR_RETURN(auto mlir_body_value, GetExprRegionValue(op.getBody()));
- auto body_op = llvm::dyn_cast(mlir_body_value.getDefiningOp());
- if (body_op == nullptr) {
- return absl::InvalidArgumentError(
- absl::StrCat("Expected LairExpressionOpInterface, got ",
- mlir_body_value.getDefiningOp()->getName().getStringRef().str(), "."));
- }
- MALDOCA_ASSIGN_OR_RETURN(std::unique_ptr body, VisitExpression(body_op));
- return Create(
- op,
- std::move(parameter),
- std::move(body));
-}
-
-absl::StatusOr>
-LairToAst::VisitFunctionCall(LairFunctionCallOp op) {
- auto function_op = llvm::dyn_cast(op.getFunction().getDefiningOp());
- if (function_op == nullptr) {
- return absl::InvalidArgumentError(
- absl::StrCat("Expected LairExpressionOpInterface, got ",
- op.getFunction().getDefiningOp()->getName().getStringRef().str(), "."));
- }
- MALDOCA_ASSIGN_OR_RETURN(std::unique_ptr function, VisitExpression(function_op));
- auto argument_op = llvm::dyn_cast(op.getArgument().getDefiningOp());
- if (argument_op == nullptr) {
- return absl::InvalidArgumentError(
- absl::StrCat("Expected LairExpressionOpInterface, got ",
- op.getArgument().getDefiningOp()->getName().getStringRef().str(), "."));
- }
- MALDOCA_ASSIGN_OR_RETURN(std::unique_ptr argument, VisitExpression(argument_op));
- return Create(
- op,
- std::move(function),
- std::move(argument));
-}
-
-// clang-format on
-// NOLINTEND(whitespace/line_length)
-// IWYU pragma: end_keep
-
-} // namespace maldoca
diff --git a/maldoca/astgen/test/multiple_inheritance/mir_ops.generated.td b/maldoca/astgen/test/multiple_inheritance/mir_ops.generated.td
deleted file mode 100644
index 59f791b..0000000
--- a/maldoca/astgen/test/multiple_inheritance/mir_ops.generated.td
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// =============================================================================
-// STOP!! DO NOT MODIFY!! THIS FILE IS AUTOMATICALLY GENERATED.
-// =============================================================================
-
-#ifndef MALDOCA_ASTGEN_TEST_MULTIPLE_INHERITANCE_MIR_OPS_GENERATED_TD_
-#define MALDOCA_ASTGEN_TEST_MULTIPLE_INHERITANCE_MIR_OPS_GENERATED_TD_
-
-include "mlir/Interfaces/ControlFlowInterfaces.td"
-include "mlir/Interfaces/InferTypeOpInterface.td"
-include "mlir/Interfaces/LoopLikeInterface.td"
-include "mlir/Interfaces/SideEffectInterfaces.td"
-include "mlir/IR/OpBase.td"
-include "mlir/IR/SymbolInterfaces.td"
-include "maldoca/astgen/test/multiple_inheritance/interfaces.td"
-include "maldoca/astgen/test/multiple_inheritance/mir_dialect.td"
-include "maldoca/astgen/test/multiple_inheritance/mir_types.td"
-
-#endif // MALDOCA_ASTGEN_TEST_MULTIPLE_INHERITANCE_MIR_OPS_GENERATED_TD_
diff --git a/maldoca/astgen/test/region/conversion/ast_to_rir.h b/maldoca/astgen/test/region/conversion/ast_to_rir.h
index 33cbd8c..38733fa 100644
--- a/maldoca/astgen/test/region/conversion/ast_to_rir.h
+++ b/maldoca/astgen/test/region/conversion/ast_to_rir.h
@@ -45,7 +45,7 @@ class AstToRir {
template
Op CreateStmt(const RNode *node, Args &&...args) {
- return builder_.create(builder_.getUnknownLoc(), std::nullopt,
+ return builder_.create(builder_.getUnknownLoc(), mlir::TypeRange(),
std::forward(args)...);
}
diff --git a/maldoca/astgen/test/typed_lambda/tlir_ops.generated.td b/maldoca/astgen/test/typed_lambda/tlir_ops.generated.td
deleted file mode 100644
index 2c12356..0000000
--- a/maldoca/astgen/test/typed_lambda/tlir_ops.generated.td
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// =============================================================================
-// STOP!! DO NOT MODIFY!! THIS FILE IS AUTOMATICALLY GENERATED.
-// =============================================================================
-
-#ifndef MALDOCA_ASTGEN_TEST_TYPED_LAMBDA_TLIR_OPS_GENERATED_TD_
-#define MALDOCA_ASTGEN_TEST_TYPED_LAMBDA_TLIR_OPS_GENERATED_TD_
-
-include "mlir/Interfaces/ControlFlowInterfaces.td"
-include "mlir/Interfaces/InferTypeOpInterface.td"
-include "mlir/Interfaces/LoopLikeInterface.td"
-include "mlir/Interfaces/SideEffectInterfaces.td"
-include "mlir/IR/OpBase.td"
-include "mlir/IR/SymbolInterfaces.td"
-include "maldoca/astgen/test/typed_lambda/interfaces.td"
-include "maldoca/astgen/test/typed_lambda/tlir_dialect.td"
-include "maldoca/astgen/test/typed_lambda/tlir_types.td"
-
-#endif // MALDOCA_ASTGEN_TEST_TYPED_LAMBDA_TLIR_OPS_GENERATED_TD_
diff --git a/maldoca/astgen/test/union/BUILD b/maldoca/astgen/test/union/BUILD
index 5121f35..bfdedab 100644
--- a/maldoca/astgen/test/union/BUILD
+++ b/maldoca/astgen/test/union/BUILD
@@ -17,12 +17,7 @@ load("@rules_cc//cc:cc_test.bzl", "cc_test")
licenses(["notice"])
-package(
- default_applicable_licenses = ["//:license"],
- default_visibility = [
- "//maldoca/astgen:__subpackages__",
- ],
-)
+package(default_applicable_licenses = ["//:license"])
cc_test(
name = "ast_gen_test",
diff --git a/maldoca/astgen/test/union/eir_ops.generated.td b/maldoca/astgen/test/union/eir_ops.generated.td
deleted file mode 100644
index 7687265..0000000
--- a/maldoca/astgen/test/union/eir_ops.generated.td
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2024 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// =============================================================================
-// STOP!! DO NOT MODIFY!! THIS FILE IS AUTOMATICALLY GENERATED.
-// =============================================================================
-
-#ifndef MALDOCA_ASTGEN_TEST_UNION_EIR_OPS_GENERATED_TD_
-#define MALDOCA_ASTGEN_TEST_UNION_EIR_OPS_GENERATED_TD_
-
-include "mlir/Interfaces/ControlFlowInterfaces.td"
-include "mlir/Interfaces/InferTypeOpInterface.td"
-include "mlir/Interfaces/LoopLikeInterface.td"
-include "mlir/Interfaces/SideEffectInterfaces.td"
-include "mlir/IR/OpBase.td"
-include "mlir/IR/SymbolInterfaces.td"
-include "maldoca/astgen/test/union/interfaces.td"
-include "maldoca/astgen/test/union/eir_dialect.td"
-include "maldoca/astgen/test/union/eir_types.td"
-
-#endif // MALDOCA_ASTGEN_TEST_UNION_EIR_OPS_GENERATED_TD_
diff --git a/maldoca/astgen/type.proto b/maldoca/astgen/type.proto
index c467727..8f781f6 100644
--- a/maldoca/astgen/type.proto
+++ b/maldoca/astgen/type.proto
@@ -18,7 +18,6 @@ package maldoca;
option java_multiple_files = true;
-
// The Type Hierarchy
//
// BuiltinType ::= BoolType, DoubleType, StringType
diff --git a/maldoca/astgen/type_test.cc b/maldoca/astgen/type_test.cc
index 6d5bcd4..a894385 100644
--- a/maldoca/astgen/type_test.cc
+++ b/maldoca/astgen/type_test.cc
@@ -21,10 +21,11 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/container/flat_hash_map.h"
+#include "absl/status/status.h"
#include "maldoca/astgen/ast_def.pb.h"
#include "maldoca/astgen/type.pb.h"
-#include "maldoca/base/testing/status_matchers.h"
#include "maldoca/base/filesystem.h"
+#include "maldoca/base/testing/status_matchers.h"
namespace maldoca {
namespace {
diff --git a/maldoca/base/get_runfiles_dir.cc b/maldoca/base/get_runfiles_dir.cc
index 61be48b..30cb756 100644
--- a/maldoca/base/get_runfiles_dir.cc
+++ b/maldoca/base/get_runfiles_dir.cc
@@ -32,4 +32,8 @@ std::string GetDataDependencyFilepath(absl::string_view path) {
return runfiles->Rlocation(JoinPath("com_google_maldoca", path));
}
+std::string GetRunfilesDir() {
+ return GetDataDependencyFilepath("");
+}
+
} // namespace maldoca
diff --git a/maldoca/base/get_runfiles_dir.h b/maldoca/base/get_runfiles_dir.h
index 7993a3a..0e680c5 100644
--- a/maldoca/base/get_runfiles_dir.h
+++ b/maldoca/base/get_runfiles_dir.h
@@ -22,6 +22,7 @@
namespace maldoca {
std::string GetDataDependencyFilepath(absl::string_view path);
+std::string GetRunfilesDir();
} // namespace maldoca
diff --git a/maldoca/base/status_builder.cc b/maldoca/base/status_builder.cc
index 108995d..836ce96 100644
--- a/maldoca/base/status_builder.cc
+++ b/maldoca/base/status_builder.cc
@@ -90,14 +90,14 @@ void StatusBuilder::ConditionallyLog(const absl::Status& status) const {
};
static auto* vlog_sites = new LogSites();
- vlog_sites->mutex.Lock();
+ vlog_sites->mutex.lock();
// This assumes that loc_.file_name() is a compile time constant in order
// to satisfy the lifetime constraints imposed by VLogSite. The
// constructors of SourceLocation guarantee that for us.
auto [iter, unused] = vlog_sites->sites_by_file.try_emplace(
loc_.file_name(), loc_.file_name());
auto& site = iter->second;
- vlog_sites->mutex.Unlock();
+ vlog_sites->mutex.unlock();
if (!site.IsEnabled(rep_->verbose_level)) {
return;
@@ -114,11 +114,11 @@ void StatusBuilder::ConditionallyLog(const absl::Status& status) const {
};
static auto* log_every_n_sites = new LogSites();
- log_every_n_sites->mutex.Lock();
+ log_every_n_sites->mutex.lock();
const uint count =
log_every_n_sites
->counts_by_file_and_line[{loc_.file_name(), loc_.line()}]++;
- log_every_n_sites->mutex.Unlock();
+ log_every_n_sites->mutex.unlock();
if (count % rep_->n != 0) {
return;
@@ -134,7 +134,7 @@ void StatusBuilder::ConditionallyLog(const absl::Status& status) const {
static auto* log_every_sites = new LogSites();
const auto now = absl::Now();
- absl::MutexLock lock(&log_every_sites->mutex);
+ absl::MutexLock lock(log_every_sites->mutex);
absl::Time& next_log =
log_every_sites
->next_log_by_file_and_line[{loc_.file_name(), loc_.line()}];
diff --git a/maldoca/js/ast/ast.generated.cc b/maldoca/js/ast/ast.generated.cc
index 3ef1a66..1d6fb4c 100644
--- a/maldoca/js/ast/ast.generated.cc
+++ b/maldoca/js/ast/ast.generated.cc
@@ -379,24 +379,32 @@ absl::StatusOr StringToJsCommentType(absl::string_view s) {
}
JsComment::JsComment(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end)
+ std::optional start,
+ std::optional end)
: loc_(std::move(loc)),
value_(std::move(value)),
start_(std::move(start)),
end_(std::move(end)) {}
-JsSourceLocation* JsComment::loc() {
- return loc_.get();
+std::optional JsComment::loc() {
+ if (!loc_.has_value()) {
+ return std::nullopt;
+ } else {
+ return loc_.value().get();
+ }
}
-const JsSourceLocation* JsComment::loc() const {
- return loc_.get();
+std::optional JsComment::loc() const {
+ if (!loc_.has_value()) {
+ return std::nullopt;
+ } else {
+ return loc_.value().get();
+ }
}
-void JsComment::set_loc(std::unique_ptr loc) {
+void JsComment::set_loc(std::optional> loc) {
loc_ = std::move(loc);
}
@@ -408,19 +416,27 @@ void JsComment::set_value(std::string value) {
value_ = std::move(value);
}
-int64_t JsComment::start() const {
- return start_;
+std::optional JsComment::start() const {
+ if (!start_.has_value()) {
+ return std::nullopt;
+ } else {
+ return start_.value();
+ }
}
-void JsComment::set_start(int64_t start) {
+void JsComment::set_start(std::optional start) {
start_ = std::move(start);
}
-int64_t JsComment::end() const {
- return end_;
+std::optional JsComment::end() const {
+ if (!end_.has_value()) {
+ return std::nullopt;
+ } else {
+ return end_.value();
+ }
}
-void JsComment::set_end(int64_t end) {
+void JsComment::set_end(std::optional end) {
end_ = std::move(end);
}
@@ -429,10 +445,10 @@ void JsComment::set_end(int64_t end) {
// =============================================================================
JsCommentBlock::JsCommentBlock(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end)
+ std::optional start,
+ std::optional end)
: JsComment(std::move(loc), std::move(value), std::move(start), std::move(end)) {}
// =============================================================================
@@ -440,10 +456,10 @@ JsCommentBlock::JsCommentBlock(
// =============================================================================
JsCommentLine::JsCommentLine(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end)
+ std::optional start,
+ std::optional end)
: JsComment(std::move(loc), std::move(value), std::move(start), std::move(end)) {}
// =============================================================================
@@ -954,26 +970,10 @@ void JsInterpreterDirective::set_value(std::string value) {
}
// =============================================================================
-// JsStatement
-// =============================================================================
-
-JsStatement::JsStatement(
- std::optional> loc,
- std::optional start,
- std::optional end,
- std::optional> leading_comment_uids,
- std::optional> trailing_comment_uids,
- std::optional> inner_comment_uids,
- std::optional scope_uid,
- std::optional> referenced_symbol,
- std::optional>> defined_symbols)
- : JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
-
-// =============================================================================
-// JsModuleDeclaration
+// JsProgramBodyElement
// =============================================================================
-JsModuleDeclaration::JsModuleDeclaration(
+JsProgramBodyElement::JsProgramBodyElement(
std::optional> loc,
std::optional start,
std::optional end,
@@ -1105,7 +1105,7 @@ JsProgram::JsProgram(
std::optional>> defined_symbols,
std::optional> interpreter,
std::string source_type,
- std::vector, std::unique_ptr>> body,
+ std::vector> body,
std::vector> directives)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
interpreter_(std::move(interpreter)),
@@ -1141,15 +1141,15 @@ void JsProgram::set_source_type(std::string source_type) {
source_type_ = std::move(source_type);
}
-std::vector, std::unique_ptr>>* JsProgram::body() {
+std::vector>* JsProgram::body() {
return &body_;
}
-const std::vector, std::unique_ptr>>* JsProgram::body() const {
+const std::vector>* JsProgram::body() const {
return &body_;
}
-void JsProgram::set_body(std::vector, std::unique_ptr>> body) {
+void JsProgram::set_body(std::vector> body) {
body_ = std::move(body);
}
@@ -1763,6 +1763,23 @@ void JsFunction::set_async(bool async) {
async_ = async;
}
+// =============================================================================
+// JsStatement
+// =============================================================================
+
+JsStatement::JsStatement(
+ std::optional> loc,
+ std::optional start,
+ std::optional end,
+ std::optional> leading_comment_uids,
+ std::optional> trailing_comment_uids,
+ std::optional> inner_comment_uids,
+ std::optional scope_uid,
+ std::optional> referenced_symbol,
+ std::optional>> defined_symbols)
+ : JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
+
// =============================================================================
// JsBlockStatement
// =============================================================================
@@ -1780,6 +1797,7 @@ JsBlockStatement::JsBlockStatement(
std::vector> body,
std::vector> directives)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
body_(std::move(body)),
directives_(std::move(directives)) {}
@@ -1859,6 +1877,7 @@ JsExpressionStatement::JsExpressionStatement(
std::optional>> defined_symbols,
std::unique_ptr expression)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
expression_(std::move(expression)) {}
@@ -1889,6 +1908,7 @@ JsEmptyStatement::JsEmptyStatement(
std::optional> referenced_symbol,
std::optional>> defined_symbols)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
// =============================================================================
@@ -1906,6 +1926,7 @@ JsDebuggerStatement::JsDebuggerStatement(
std::optional> referenced_symbol,
std::optional>> defined_symbols)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
// =============================================================================
@@ -1925,6 +1946,7 @@ JsWithStatement::JsWithStatement(
std::unique_ptr object,
std::unique_ptr body)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
object_(std::move(object)),
body_(std::move(body)) {}
@@ -1969,6 +1991,7 @@ JsReturnStatement::JsReturnStatement(
std::optional>> defined_symbols,
std::optional> argument)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
argument_(std::move(argument)) {}
@@ -2009,6 +2032,7 @@ JsLabeledStatement::JsLabeledStatement(
std::unique_ptr label,
std::unique_ptr body)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
label_(std::move(label)),
body_(std::move(body)) {}
@@ -2053,6 +2077,7 @@ JsBreakStatement::JsBreakStatement(
std::optional>> defined_symbols,
std::optional> label)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
label_(std::move(label)) {}
@@ -2092,6 +2117,7 @@ JsContinueStatement::JsContinueStatement(
std::optional>> defined_symbols,
std::optional> label)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
label_(std::move(label)) {}
@@ -2133,6 +2159,7 @@ JsIfStatement::JsIfStatement(
std::unique_ptr consequent,
std::optional> alternate)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
test_(std::move(test)),
consequent_(std::move(consequent)),
@@ -2251,6 +2278,7 @@ JsSwitchStatement::JsSwitchStatement(
std::unique_ptr discriminant,
std::vector> cases)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
discriminant_(std::move(discriminant)),
cases_(std::move(cases)) {}
@@ -2295,6 +2323,7 @@ JsThrowStatement::JsThrowStatement(
std::optional>> defined_symbols,
std::unique_ptr argument)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
argument_(std::move(argument)) {}
@@ -2380,6 +2409,7 @@ JsTryStatement::JsTryStatement(
std::optional> handler,
std::optional> finalizer)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
block_(std::move(block)),
handler_(std::move(handler)),
@@ -2454,6 +2484,7 @@ JsWhileStatement::JsWhileStatement(
std::unique_ptr test,
std::unique_ptr body)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
test_(std::move(test)),
body_(std::move(body)) {}
@@ -2499,6 +2530,7 @@ JsDoWhileStatement::JsDoWhileStatement(
std::unique_ptr body,
std::unique_ptr test)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
body_(std::move(body)),
test_(std::move(test)) {}
@@ -2542,6 +2574,7 @@ JsDeclaration::JsDeclaration(
std::optional> referenced_symbol,
std::optional>> defined_symbols)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
// =============================================================================
@@ -2613,6 +2646,7 @@ JsVariableDeclaration::JsVariableDeclaration(
std::vector> declarations,
std::string kind)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
declarations_(std::move(declarations)),
@@ -2657,6 +2691,7 @@ JsForStatement::JsForStatement(
std::optional> update,
std::unique_ptr body)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
init_(std::move(init)),
test_(std::move(test)),
@@ -2771,6 +2806,7 @@ JsForInStatement::JsForInStatement(
std::unique_ptr right,
std::unique_ptr body)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
left_(std::move(left)),
right_(std::move(right)),
@@ -2849,6 +2885,7 @@ JsForOfStatement::JsForOfStatement(
std::unique_ptr body,
bool await)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
left_(std::move(left)),
right_(std::move(right)),
@@ -2939,6 +2976,7 @@ JsFunctionDeclaration::JsFunctionDeclaration(
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsFunction(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols), std::move(id), std::move(params), std::move(generator), std::move(async)),
JsBlockStatementFunction(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols), std::move(id), std::move(params), std::move(generator), std::move(async), std::move(body)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
@@ -4838,6 +4876,7 @@ JsClassDeclaration::JsClassDeclaration(
std::optional> id)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsClass(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols), std::move(super_class), std::move(body)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsStatement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
id_(std::move(id)) {}
@@ -4949,6 +4988,23 @@ void JsMetaProperty::set_property(std::unique_ptr property) {
property_ = std::move(property);
}
+// =============================================================================
+// JsModuleDeclaration
+// =============================================================================
+
+JsModuleDeclaration::JsModuleDeclaration(
+ std::optional> loc,
+ std::optional start,
+ std::optional end,
+ std::optional> leading_comment_uids,
+ std::optional> trailing_comment_uids,
+ std::optional> inner_comment_uids,
+ std::optional scope_uid,
+ std::optional> referenced_symbol,
+ std::optional>> defined_symbols)
+ : JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)) {}
+
// =============================================================================
// JsModuleSpecifier
// =============================================================================
@@ -5152,6 +5208,7 @@ JsImportDeclaration::JsImportDeclaration(
std::unique_ptr source,
std::optional> assertions)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsModuleDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
specifiers_(std::move(specifiers)),
source_(std::move(source)),
@@ -5309,6 +5366,7 @@ JsExportNamedDeclaration::JsExportNamedDeclaration(
std::optional> source,
std::optional>> assertions)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsModuleDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
declaration_(std::move(declaration)),
specifiers_(std::move(specifiers)),
@@ -5403,6 +5461,7 @@ JsExportDefaultDeclaration::JsExportDefaultDeclaration(
std::optional>> defined_symbols,
std::variant, std::unique_ptr, std::unique_ptr> declaration)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsModuleDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
declaration_(std::move(declaration)) {}
@@ -5459,6 +5518,7 @@ JsExportAllDeclaration::JsExportAllDeclaration(
std::unique_ptr source,
std::optional>> assertions)
: JsNode(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
+ JsProgramBodyElement(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
JsModuleDeclaration(std::move(loc), std::move(start), std::move(end), std::move(leading_comment_uids), std::move(trailing_comment_uids), std::move(inner_comment_uids), std::move(scope_uid), std::move(referenced_symbol), std::move(defined_symbols)),
source_(std::move(source)),
assertions_(std::move(assertions)) {}
diff --git a/maldoca/js/ast/ast.generated.h b/maldoca/js/ast/ast.generated.h
index e148c4c..995c8fd 100644
--- a/maldoca/js/ast/ast.generated.h
+++ b/maldoca/js/ast/ast.generated.h
@@ -199,10 +199,10 @@ absl::StatusOr StringToJsCommentType(absl::string_view s);
class JsComment {
public:
explicit JsComment(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end);
+ std::optional start,
+ std::optional end);
virtual ~JsComment() = default;
@@ -212,18 +212,18 @@ class JsComment {
static absl::StatusOr> FromJson(const nlohmann::json& json);
- JsSourceLocation* loc();
- const JsSourceLocation* loc() const;
- void set_loc(std::unique_ptr loc);
+ std::optional loc();
+ std::optional loc() const;
+ void set_loc(std::optional> loc);
absl::string_view value() const;
void set_value(std::string value);
- int64_t start() const;
- void set_start(int64_t start);
+ std::optional start() const;
+ void set_start(std::optional start);
- int64_t end() const;
- void set_end(int64_t end);
+ std::optional end() const;
+ void set_end(std::optional end);
protected:
// Internal function used by Serialize().
@@ -233,25 +233,25 @@ class JsComment {
// Internal functions used by FromJson().
// Extracts a field from a JSON object.
- static absl::StatusOr> GetLoc(const nlohmann::json& json);
+ static absl::StatusOr>> GetLoc(const nlohmann::json& json);
static absl::StatusOr GetValue(const nlohmann::json& json);
- static absl::StatusOr GetStart(const nlohmann::json& json);
- static absl::StatusOr GetEnd(const nlohmann::json& json);
+ static absl::StatusOr> GetStart(const nlohmann::json& json);
+ static absl::StatusOr> GetEnd(const nlohmann::json& json);
private:
- std::unique_ptr loc_;
+ std::optional> loc_;
std::string value_;
- int64_t start_;
- int64_t end_;
+ std::optional start_;
+ std::optional end_;
};
class JsCommentBlock : public virtual JsComment {
public:
explicit JsCommentBlock(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end);
+ std::optional start,
+ std::optional end);
JsCommentType comment_type() const override {
return JsCommentType::kCommentBlock;
@@ -271,10 +271,10 @@ class JsCommentBlock : public virtual JsComment {
class JsCommentLine : public virtual JsComment {
public:
explicit JsCommentLine(
- std::unique_ptr loc,
+ std::optional> loc,
std::string value,
- int64_t start,
- int64_t end);
+ std::optional start,
+ std::optional end);
JsCommentType comment_type() const override {
return JsCommentType::kCommentLine;
@@ -537,31 +537,9 @@ class JsInterpreterDirective : public virtual JsNode {
std::string value_;
};
-class JsStatement : public virtual JsNode {
- public:
- explicit JsStatement(
- std::optional> loc,
- std::optional start,
- std::optional end,
- std::optional> leading_comment_uids,
- std::optional> trailing_comment_uids,
- std::optional> inner_comment_uids,
- std::optional scope_uid,
- std::optional> referenced_symbol,
- std::optional>> defined_symbols);
-
- static absl::StatusOr> FromJson(const nlohmann::json& json);
-
- protected:
- // Internal function used by Serialize().
- // Sets the fields defined in this class.
- // Does not set fields defined in ancestors.
- void SerializeFields(std::ostream& os, bool &needs_comma) const;
-};
-
-class JsModuleDeclaration : public virtual JsNode {
+class JsProgramBodyElement : public virtual JsNode {
public:
- explicit JsModuleDeclaration(
+ explicit JsProgramBodyElement(
std::optional> loc,
std::optional start,
std::optional end,
@@ -572,7 +550,7 @@ class JsModuleDeclaration : public virtual JsNode {
std::optional> referenced_symbol,
std::optional>> defined_symbols);
- static absl::StatusOr> FromJson(const nlohmann::json& json);
+ static absl::StatusOr> FromJson(const nlohmann::json& json);
protected:
// Internal function used by Serialize().
@@ -713,7 +691,7 @@ class JsProgram : public virtual JsNode {
std::optional>> defined_symbols,
std::optional> interpreter,
std::string source_type,
- std::vector, std::unique_ptr>> body,
+ std::vector> body,
std::vector> directives);
JsNodeType node_type() const override {
@@ -731,9 +709,9 @@ class JsProgram : public virtual JsNode {
absl::string_view source_type() const;
void set_source_type(std::string source_type);
- std::vector, std::unique_ptr>>* body();
- const std::vector, std::unique_ptr>>* body() const;
- void set_body(std::vector, std::unique_ptr>> body);
+ std::vector>* body();
+ const std::vector>* body() const;
+ void set_body(std::vector> body);
std::vector>* directives();
const std::vector>* directives() const;
@@ -749,13 +727,13 @@ class JsProgram : public virtual JsNode {
// Extracts a field from a JSON object.
static absl::StatusOr>> GetInterpreter(const nlohmann::json& json);
static absl::StatusOr GetSourceType(const nlohmann::json& json);
- static absl::StatusOr, std::unique_ptr>>> GetBody(const nlohmann::json& json);
+ static absl::StatusOr>> GetBody(const nlohmann::json& json);
static absl::StatusOr>> GetDirectives(const nlohmann::json& json);
private:
std::optional> interpreter_;
std::string source_type_;
- std::vector, std::unique_ptr>> body_;
+ std::vector> body_;
std::vector> directives_;
};
@@ -1405,6 +1383,28 @@ class JsFunction : public virtual JsNode {
bool async_;
};
+class JsStatement : public virtual JsNode, public virtual JsProgramBodyElement {
+ public:
+ explicit JsStatement(
+ std::optional> loc,
+ std::optional start,
+ std::optional end,
+ std::optional> leading_comment_uids,
+ std::optional> trailing_comment_uids,
+ std::optional> inner_comment_uids,
+ std::optional scope_uid,
+ std::optional> referenced_symbol,
+ std::optional>> defined_symbols);
+
+ static absl::StatusOr> FromJson(const nlohmann::json& json);
+
+ protected:
+ // Internal function used by Serialize().
+ // Sets the fields defined in this class.
+ // Does not set fields defined in ancestors.
+ void SerializeFields(std::ostream& os, bool &needs_comma) const;
+};
+
class JsBlockStatement : public virtual JsStatement {
public:
explicit JsBlockStatement(
@@ -4452,6 +4452,28 @@ class JsMetaProperty : public virtual JsExpression {
std::unique_ptr property_;
};
+class JsModuleDeclaration : public virtual JsNode, public virtual JsProgramBodyElement {
+ public:
+ explicit JsModuleDeclaration(
+ std::optional> loc,
+ std::optional start,
+ std::optional end,
+ std::optional> leading_comment_uids,
+ std::optional> trailing_comment_uids,
+ std::optional> inner_comment_uids,
+ std::optional scope_uid,
+ std::optional> referenced_symbol,
+ std::optional>> defined_symbols);
+
+ static absl::StatusOr> FromJson(const nlohmann::json& json);
+
+ protected:
+ // Internal function used by Serialize().
+ // Sets the fields defined in this class.
+ // Does not set fields defined in ancestors.
+ void SerializeFields(std::ostream& os, bool &needs_comma) const;
+};
+
class JsModuleSpecifier : public virtual JsNode {
public:
explicit JsModuleSpecifier(
diff --git a/maldoca/js/ast/ast_from_json.generated.cc b/maldoca/js/ast/ast_from_json.generated.cc
index effea1a..6c95333 100644
--- a/maldoca/js/ast/ast_from_json.generated.cc
+++ b/maldoca/js/ast/ast_from_json.generated.cc
@@ -176,7 +176,7 @@ JsSourceLocation::FromJson(const nlohmann::json& json) {
// JsComment
// =============================================================================
-absl::StatusOr>
+absl::StatusOr>>
JsComment::GetLoc(const nlohmann::json& json) {
auto loc_it = json.find("loc");
if (loc_it == json.end()) {
@@ -185,7 +185,7 @@ JsComment::GetLoc(const nlohmann::json& json) {
const nlohmann::json& json_loc = loc_it.value();
if (json_loc.is_null()) {
- return absl::InvalidArgumentError("json_loc is null.");
+ return std::nullopt;
}
return JsSourceLocation::FromJson(json_loc);
}
@@ -207,7 +207,7 @@ JsComment::GetValue(const nlohmann::json& json) {
return json_value.get