Skip to content

Commit 0184915

Browse files
committed
Use new interpret eval api and updated deps
1 parent e144c28 commit 0184915

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

WORKSPACE.bazel

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,37 @@ rules_pkg_dependencies()
5454

5555
http_archive(
5656
name = "ecsact_rtb",
57-
sha256 = "e616d42fd775977f15f41d69ab6dc88f96b4fb0d8dfd584427ab5d2110daacc3",
58-
strip_prefix = "ecsact_rtb-16092a6efb971e0ac27bd06d188c7375224b475d",
59-
url = "https://github.com/ecsact-dev/ecsact_rtb/archive/16092a6efb971e0ac27bd06d188c7375224b475d.zip",
57+
sha256 = "1c9b6f3bf8aea80cb61148f33a562a49a1dfad6eb881f04c80e44d82152ae82f",
58+
strip_prefix = "ecsact_rtb-7928486e0326a718d11619f246b5107a6d2c9bdc",
59+
url = "https://github.com/ecsact-dev/ecsact_rtb/archive/7928486e0326a718d11619f246b5107a6d2c9bdc.zip",
6060
)
6161

6262
http_archive(
6363
name = "ecsact_parse",
64-
sha256 = "44c465e40b7d14546e025cdad631b1c6041e95eb58c8d18e28358f7ce2c4d825",
65-
strip_prefix = "ecsact_parse-7880d1d89d9f18cf930ed0071c880c253c02af3c",
66-
url = "https://github.com/ecsact-dev/ecsact_parse/archive/7880d1d89d9f18cf930ed0071c880c253c02af3c.zip",
64+
sha256 = "b3f65f9c5ec62d77647c32736738458230469cac937eab82d46a577e52b7fc2a",
65+
strip_prefix = "ecsact_parse-45a30d62a0c53acb3a329fa9df250c20f0b384d1",
66+
url = "https://github.com/ecsact-dev/ecsact_parse/archive/45a30d62a0c53acb3a329fa9df250c20f0b384d1.zip",
6767
)
6868

6969
http_archive(
7070
name = "ecsact_runtime",
71-
sha256 = "80b722a8790447627b621877c171a96d5e7d09005bfbed7d8b388cb37cefa7b6",
72-
strip_prefix = "ecsact_runtime-f7ee18fe96c4400672caccf5475835d54281582c",
73-
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/f7ee18fe96c4400672caccf5475835d54281582c.zip",
71+
sha256 = "f7b5f5cc5b70620934be48090048e9092dbc86ba4e027959d65fd1dd46c36a77",
72+
strip_prefix = "ecsact_runtime-475cae75c657b2570b1041264670c026de412814",
73+
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/475cae75c657b2570b1041264670c026de412814.zip",
7474
)
7575

7676
http_archive(
77-
name = "ecsact_parse_runtime_interop",
78-
sha256 = "c39bdfa6af986214bdfaf0f2793c77b35ac9690bc085cdd0ab90beca845e536c",
79-
strip_prefix = "ecsact_parse_runtime_interop-0101aaa89179ddd63c81ed8267191ec86943f99c",
80-
url = "https://github.com/ecsact-dev/ecsact_parse_runtime_interop/archive/0101aaa89179ddd63c81ed8267191ec86943f99c.zip",
77+
name = "ecsact_interpret",
78+
sha256 = "ac3fb03b584ec226bb2d240621e7a539339fbfd6dc2131580109c35f3b11f461",
79+
strip_prefix = "ecsact_interpret-d014d7aa30ee2a1ac5086773a6c3477451671acd",
80+
url = "https://github.com/ecsact-dev/ecsact_interpret/archive/d014d7aa30ee2a1ac5086773a6c3477451671acd.zip",
8181
)
8282

8383
http_archive(
8484
name = "ecsact_lang_cpp",
85-
sha256 = "2b2adc4d1a002d7f8fbe24153c9aff5fd7c616de13cf36bd520b7ec4e345965a",
86-
strip_prefix = "ecsact_lang_cpp-18c6f0df8be535a1586abb7f4e3460b635976a44",
87-
url = "https://github.com/ecsact-dev/ecsact_lang_cpp/archive/18c6f0df8be535a1586abb7f4e3460b635976a44.zip",
85+
sha256 = "2f9982186cb817bf44b938c26dd07cdfd136601d0578549a251de58e43c429bc",
86+
strip_prefix = "ecsact_lang_cpp-389390edc5a2f2468ee866c7e4aea18642f9c186",
87+
url = "https://github.com/ecsact-dev/ecsact_lang_cpp/archive/389390edc5a2f2468ee866c7e4aea18642f9c186.zip",
8888
)
8989

9090
http_archive(
@@ -96,9 +96,9 @@ http_archive(
9696

9797
http_archive(
9898
name = "ecsact_lang_csharp",
99-
sha256 = "bd4ea4a0aa961e7e8e4520090074faea9a574829cafb87802cdf85076ee3b79e",
100-
strip_prefix = "ecsact_lang_csharp-3e4d9fc68b3d0f62465641682064da051510d69e",
101-
url = "https://github.com/ecsact-dev/ecsact_lang_csharp/archive/3e4d9fc68b3d0f62465641682064da051510d69e.zip",
99+
sha256 = "75e584f77b7c29916ce5d24dea4d2242963c61901730c36a4e52eacb13057c3e",
100+
strip_prefix = "ecsact_lang_csharp-996166d67fe6b819a10d3c840606b0ac5d2fc1fa",
101+
url = "https://github.com/ecsact-dev/ecsact_lang_csharp/archive/996166d67fe6b819a10d3c840606b0ac5d2fc1fa.zip",
102102
)
103103

104104
load("@ecsact_parse//:repositories.bzl", "ecsact_parse_dependencies")

cli/commands/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cc_library(
1919
"//executable_path",
2020
"@bazelregistry_docopt_cpp//:docopt",
2121
"@boost//libs/dll",
22-
"@ecsact_parse_runtime_interop",
22+
"@ecsact_interpret",
2323
"@ecsact_runtime//:codegen_plugin",
2424
"@ecsact_runtime//:codegen_plugin_validate",
2525
"@ecsact_runtime//:dylib",

cli/commands/codegen.cc

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <boost/dll/shared_library.hpp>
1010
#include <boost/dll/library_info.hpp>
1111
#include "docopt.h"
12-
#include "ecsact/parse_runtime_interop.h"
12+
#include "ecsact/interpret/eval.hh"
1313
#include "ecsact/runtime/meta.h"
1414
#include "ecsact/runtime/dylib.h"
1515
#include "ecsact/codegen_plugin.h"
@@ -113,9 +113,12 @@ int ecsact::cli::detail::codegen_command(int argc, char* argv[]) {
113113

114114
auto args = docopt::docopt(USAGE, {argv + 1, argv + argc});
115115
bool files_error = false;
116-
auto files = args.at("<files>").asStringList();
116+
auto files_str = args.at("<files>").asStringList();
117+
std::vector<fs::path> files;
118+
files.reserve(files_str.size());
117119

118-
for(fs::path file_path : files) {
120+
for(fs::path file_path : files_str) {
121+
files.push_back(file_path);
119122
if(file_path.extension() != ".ecsact") {
120123
files_error = true;
121124
std::cerr
@@ -171,17 +174,17 @@ int ecsact::cli::detail::codegen_command(int argc, char* argv[]) {
171174
return 1;
172175
}
173176

174-
std::vector<const char*> cstr_files;
175-
cstr_files.reserve(files.size());
176-
for(auto& file : files) {
177-
cstr_files.emplace_back() = file.c_str();
177+
auto eval_errors = ecsact::eval_files(files);
178+
if(!eval_errors.empty()) {
179+
for(auto& eval_err : eval_errors) {
180+
std::cerr
181+
<< "[ERROR] " << files[eval_err.source_index].string()
182+
<< ":" << eval_err.line << ":" << eval_err.character << " "
183+
<< eval_err.error_message << "\n";
184+
}
185+
return 1;
178186
}
179187

180-
ecsact_parse_runtime_interop(
181-
cstr_files.data(),
182-
static_cast<int32_t>(cstr_files.size())
183-
);
184-
185188
std::vector<ecsact_package_id> package_ids;
186189
package_ids.resize(static_cast<int32_t>(ecsact_meta_count_packages()));
187190
ecsact_meta_get_package_ids(

0 commit comments

Comments
 (0)