diff options
author | Li Jin <dragon-fly@qq.com> | 2023-02-27 12:01:38 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-02-27 12:01:38 +0800 |
commit | 618b2be86e2d44a9151d708cf590dc3713410022 (patch) | |
tree | 786417df432c3b44a53f25f2226c4ad713b4cd00 /src/yue.cpp | |
parent | 78f07cc7bf7e310cd559c45c6c7a4977341c107e (diff) | |
download | yuescript-618b2be86e2d44a9151d708cf590dc3713410022.tar.gz yuescript-618b2be86e2d44a9151d708cf590dc3713410022.tar.bz2 yuescript-618b2be86e2d44a9151d708cf590dc3713410022.zip |
fix issue #126 by reserving comments before statements
Diffstat (limited to 'src/yue.cpp')
-rw-r--r-- | src/yue.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/yue.cpp b/src/yue.cpp index 7adde70..0b13688 100644 --- a/src/yue.cpp +++ b/src/yue.cpp | |||
@@ -254,6 +254,7 @@ int main(int narg, const char** args) { | |||
254 | " -b Dump compile time (doesn't write output)\n" | 254 | " -b Dump compile time (doesn't write output)\n" |
255 | " -g Dump global variables used in NAME LINE COLUMN\n" | 255 | " -g Dump global variables used in NAME LINE COLUMN\n" |
256 | " -l Write line numbers from source codes\n" | 256 | " -l Write line numbers from source codes\n" |
257 | " -c Reserve comments before statement from source codes\n" | ||
257 | #ifndef YUE_NO_WATCHER | 258 | #ifndef YUE_NO_WATCHER |
258 | " -w path Watch changes and compile every file under directory\n" | 259 | " -w path Watch changes and compile every file under directory\n" |
259 | #endif // YUE_NO_WATCHER | 260 | #endif // YUE_NO_WATCHER |
@@ -526,6 +527,8 @@ int main(int narg, const char** args) { | |||
526 | config.useSpaceOverTab = true; | 527 | config.useSpaceOverTab = true; |
527 | } else if (arg == "-l"sv) { | 528 | } else if (arg == "-l"sv) { |
528 | config.reserveLineNumber = true; | 529 | config.reserveLineNumber = true; |
530 | } else if (arg == "-c"sv) { | ||
531 | config.reserveComment = true; | ||
529 | } else if (arg == "-p"sv) { | 532 | } else if (arg == "-p"sv) { |
530 | writeToFile = false; | 533 | writeToFile = false; |
531 | } else if (arg == "-g"sv) { | 534 | } else if (arg == "-g"sv) { |