diff options
author | Li Jin <dragon-fly@qq.com> | 2022-07-26 11:34:34 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-07-26 11:34:34 +0800 |
commit | f7150a004e26f446fbf7a47bae368f209248fa67 (patch) | |
tree | 28cbfc756cfef955a6a40f62d3395920938256db /src/yue.cpp | |
parent | 13c7eb4252e8c4228fabf1ade13b7b9bcbd80656 (diff) | |
download | yuescript-f7150a004e26f446fbf7a47bae368f209248fa67.tar.gz yuescript-f7150a004e26f446fbf7a47bae368f209248fa67.tar.bz2 yuescript-f7150a004e26f446fbf7a47bae368f209248fa67.zip |
make destructuring work on function multiple returned values, fix `a, b[] = 1` crashing issue, no longer support implicit declaring variable to be nil.
Diffstat (limited to 'src/yue.cpp')
-rw-r--r-- | src/yue.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/yue.cpp b/src/yue.cpp index cb27db8..6011d94 100644 --- a/src/yue.cpp +++ b/src/yue.cpp | |||
@@ -446,7 +446,7 @@ int main(int narg, const char** args) { | |||
446 | return 0; | 446 | return 0; |
447 | } | 447 | } |
448 | if (!resultFile.empty() && files.size() > 1) { | 448 | if (!resultFile.empty() && files.size() > 1) { |
449 | std::cout << "Error: -o can not be used with multiple input files.\n"sv; | 449 | std::cout << "Error: -o can not be used with multiple input files\n"sv; |
450 | std::cout << help; | 450 | std::cout << help; |
451 | } | 451 | } |
452 | std::list<std::future<std::tuple<int,std::string,std::string>>> results; | 452 | std::list<std::future<std::tuple<int,std::string,std::string>>> results; |
@@ -485,7 +485,7 @@ int main(int narg, const char** args) { | |||
485 | return std::tuple{0, file.first, buf.str()}; | 485 | return std::tuple{0, file.first, buf.str()}; |
486 | } else { | 486 | } else { |
487 | std::ostringstream buf; | 487 | std::ostringstream buf; |
488 | buf << "Failed to compile: "sv << file.first << ".\n"sv; | 488 | buf << "Failed to compile: "sv << file.first << '\n'; |
489 | buf << result.error << '\n'; | 489 | buf << result.error << '\n'; |
490 | return std::tuple{1, file.first, buf.str()}; | 490 | return std::tuple{1, file.first, buf.str()}; |
491 | } | 491 | } |
@@ -543,12 +543,12 @@ int main(int narg, const char** args) { | |||
543 | } | 543 | } |
544 | } else { | 544 | } else { |
545 | std::ostringstream buf; | 545 | std::ostringstream buf; |
546 | buf << "Failed to compile: "sv << file.first << ".\n"; | 546 | buf << "Failed to compile: "sv << file.first << '\n'; |
547 | buf << result.error << '\n'; | 547 | buf << result.error << '\n'; |
548 | return std::tuple{1, std::string(), buf.str()}; | 548 | return std::tuple{1, std::string(), buf.str()}; |
549 | } | 549 | } |
550 | } else { | 550 | } else { |
551 | return std::tuple{1, std::string(), "Failed to read file: "s + file.first + ".\n"}; | 551 | return std::tuple{1, std::string(), "Failed to read file: "s + file.first + '\n'}; |
552 | } | 552 | } |
553 | }); | 553 | }); |
554 | results.push_back(std::move(task)); | 554 | results.push_back(std::move(task)); |