summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--makefile20
-rw-r--r--src/yue.cpp6
2 files changed, 13 insertions, 13 deletions
diff --git a/makefile b/makefile
index 047718a..5cd1de2 100644
--- a/makefile
+++ b/makefile
@@ -432,11 +432,11 @@ test: debug
432 @$(START_TIME) 432 @$(START_TIME)
433 @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) --tl_enabled 433 @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) --tl_enabled
434 @./$(BIN_NAME) $(TEST_INPUT)/teal_lang.yue -o $(TEST_OUTPUT)/teal_lang.lua 434 @./$(BIN_NAME) $(TEST_INPUT)/teal_lang.yue -o $(TEST_OUTPUT)/teal_lang.lua
435 @./$(BIN_NAME) $(TEST_INPUT)/loops.yue -o $(TEST_OUTPUT)/5.1/loops.lua --target=5.1 435 @./$(BIN_NAME) $(TEST_INPUT)/loops.yue -o $(TEST_OUTPUT)/5.1/loops.lua --target 5.1
436 @./$(BIN_NAME) $(TEST_INPUT)/try_catch.yue -o $(TEST_OUTPUT)/5.1/try_catch.lua --target=5.1 436 @./$(BIN_NAME) $(TEST_INPUT)/try_catch.yue -o $(TEST_OUTPUT)/5.1/try_catch.lua --target 5.1
437 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(TEST_OUTPUT)/5.1/attrib.lua --target=5.1 437 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(TEST_OUTPUT)/5.1/attrib.lua --target 5.1
438 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(TEST_OUTPUT)/5.1/import_global.lua --target=5.1 438 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(TEST_OUTPUT)/5.1/import_global.lua --target 5.1
439 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(TEST_OUTPUT)/5.1/test/loops_spec.lua --target=5.1 439 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(TEST_OUTPUT)/5.1/test/loops_spec.lua --target 5.1
440 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(TEST_OUTPUT) 440 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(TEST_OUTPUT)
441 @echo -en "Compile time: " 441 @echo -en "Compile time: "
442 @$(END_TIME) 442 @$(END_TIME)
@@ -452,11 +452,11 @@ gen: release
452 @$(START_TIME) 452 @$(START_TIME)
453 @./$(BIN_NAME) $(TEST_INPUT) -t $(GEN_OUTPUT) --tl_enabled 453 @./$(BIN_NAME) $(TEST_INPUT) -t $(GEN_OUTPUT) --tl_enabled
454 @./$(BIN_NAME) $(TEST_INPUT)/teal_lang.yue -o $(GEN_OUTPUT)/teal_lang.lua 454 @./$(BIN_NAME) $(TEST_INPUT)/teal_lang.yue -o $(GEN_OUTPUT)/teal_lang.lua
455 @./$(BIN_NAME) $(TEST_INPUT)/loops.yue -o $(GEN_OUTPUT)/5.1/loops.lua --target=5.1 455 @./$(BIN_NAME) $(TEST_INPUT)/loops.yue -o $(GEN_OUTPUT)/5.1/loops.lua --target 5.1
456 @./$(BIN_NAME) $(TEST_INPUT)/try_catch.yue -o $(GEN_OUTPUT)/5.1/try_catch.lua --target=5.1 456 @./$(BIN_NAME) $(TEST_INPUT)/try_catch.yue -o $(GEN_OUTPUT)/5.1/try_catch.lua --target 5.1
457 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(GEN_OUTPUT)/5.1/attrib.lua --target=5.1 457 @./$(BIN_NAME) $(TEST_INPUT)/attrib.yue -o $(GEN_OUTPUT)/5.1/attrib.lua --target 5.1
458 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(GEN_OUTPUT)/5.1/import_global.lua --target=5.1 458 @./$(BIN_NAME) $(TEST_INPUT)/import_global.yue -o $(GEN_OUTPUT)/5.1/import_global.lua --target 5.1
459 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(GEN_OUTPUT)/5.1/test/loops_spec.lua --target=5.1 459 @./$(BIN_NAME) $(TEST_INPUT)/test/loops_spec.yue -o $(GEN_OUTPUT)/5.1/test/loops_spec.lua --target 5.1
460 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(GEN_OUTPUT) 460 @./$(BIN_NAME) -e spec/inputs/compile_doc.yue $(GEN_OUTPUT)
461 @echo -en "Compile time: " 461 @echo -en "Compile time: "
462 @$(END_TIME) 462 @$(END_TIME)
diff --git a/src/yue.cpp b/src/yue.cpp
index 7e39367..f48d14b 100644
--- a/src/yue.cpp
+++ b/src/yue.cpp
@@ -520,9 +520,6 @@ int main(int narg, const char** args) {
520 std::string workPath; 520 std::string workPath;
521 std::list<std::pair<std::string, std::string>> files; 521 std::list<std::pair<std::string, std::string>> files;
522 522
523 auto isOptionToken = [](std::string_view s) {
524 return !s.empty() && (s[0] == '-' || (s.size() >= 2 && s.substr(0, 2) == "--"sv));
525 };
526 auto takeValue = [&](int& i, std::string_view arg, std::string_view optName) -> std::string { 523 auto takeValue = [&](int& i, std::string_view arg, std::string_view optName) -> std::string {
527 // supports: --opt=value, --opt value, -o value, -t value, etc. 524 // supports: --opt=value, --opt value, -o value, -t value, etc.
528 if (auto eq = arg.find('='); eq != std::string_view::npos) { 525 if (auto eq = arg.find('='); eq != std::string_view::npos) {
@@ -697,6 +694,9 @@ int main(int narg, const char** args) {
697 if (resultFile.empty()) return 1; 694 if (resultFile.empty()) return 1;
698 } else if (arg == "-w"sv || arg == "--watch"sv || arg.rfind("--watch="sv, 0) == 0) { 695 } else if (arg == "-w"sv || arg == "--watch"sv || arg.rfind("--watch="sv, 0) == 0) {
699#ifndef YUE_NO_WATCHER 696#ifndef YUE_NO_WATCHER
697 auto isOptionToken = [](std::string_view s) {
698 return !s.empty() && (s[0] == '-' || (s.size() >= 2 && s.substr(0, 2) == "--"sv));
699 };
700 watchFiles = true; 700 watchFiles = true;
701 // accept optional directory value: -w <dir> / --watch <dir> / --watch=<dir> 701 // accept optional directory value: -w <dir> / --watch <dir> / --watch=<dir>
702 if (arg != "-w"sv) { 702 if (arg != "-w"sv) {