aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-11-09 15:17:17 +0800
committerLi Jin <dragon-fly@qq.com>2022-11-09 15:17:17 +0800
commite02780668e0ce2ebf7088bad2e70ad94b6824b08 (patch)
tree5542a135197d4b7c7741708a9544180ee4fbcf13
parent42f50d380cf3a5dc30b4c0d06caec93d0ddd76d9 (diff)
downloadyuescript-e02780668e0ce2ebf7088bad2e70ad94b6824b08.tar.gz
yuescript-e02780668e0ce2ebf7088bad2e70ad94b6824b08.tar.bz2
yuescript-e02780668e0ce2ebf7088bad2e70ad94b6824b08.zip
fix readme.
-rw-r--r--README.md7
-rw-r--r--src/yuescript/yue_parser.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/README.md b/README.md
index 50124d1..31198dc 100644
--- a/README.md
+++ b/README.md
@@ -87,17 +87,22 @@ Usage: yue [options|files|directories] ...
87 87
88 -h Print this message 88 -h Print this message
89 -e str Execute a file or raw codes 89 -e str Execute a file or raw codes
90 -m Generate minified codes
90 -t path Specify where to place compiled files 91 -t path Specify where to place compiled files
91 -o file Write output to file 92 -o file Write output to file
92 -s Use spaces in generated codes instead of tabs 93 -s Use spaces in generated codes instead of tabs
93 -m Generate minified codes
94 -p Write output to standard out 94 -p Write output to standard out
95 -b Dump compile time (doesn't write output) 95 -b Dump compile time (doesn't write output)
96 -g Dump global variables used in NAME LINE COLUMN
96 -l Write line numbers from source codes 97 -l Write line numbers from source codes
97 -v Print version 98 -v Print version
98 -- Read from standard in, print to standard out 99 -- Read from standard in, print to standard out
99 (Must be first and only argument) 100 (Must be first and only argument)
100 101
102 --target=version Specify the Lua version that codes will be generated to
103 (version can only be 5.1, 5.2, 5.3 or 5.4)
104 --path=path_str Append an extra Lua search path string to package.path
105
101 Execute without options to enter REPL, type symbol '$' 106 Execute without options to enter REPL, type symbol '$'
102 in a single line to start/stop multi-line mode 107 in a single line to start/stop multi-line mode
103``` 108```
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp
index df64759..0d9a183 100644
--- a/src/yuescript/yue_parser.cpp
+++ b/src/yuescript/yue_parser.cpp
@@ -544,7 +544,7 @@ YueParser::YueParser() {
544 | (not_(Space >> export_default) >> pl::user(true_(), [](const item_t& item) { 544 | (not_(Space >> export_default) >> pl::user(true_(), [](const item_t& item) {
545 State* st = reinterpret_cast<State*>(item.user_data); 545 State* st = reinterpret_cast<State*>(item.user_data);
546 if (st->exportDefault && st->exportCount > 1) { 546 if (st->exportDefault && st->exportCount > 1) {
547 throw ParserError("can not export more items when export default has been declared", *item.begin, *item.end); 547 throw ParserError("can not export any more items when 'export default' is declared", *item.begin, *item.end);
548 } 548 }
549 return true; 549 return true;
550 }) >> ExpList >> -Assign) 550 }) >> ExpList >> -Assign)