diff options
Diffstat (limited to '')
| -rwxr-xr-x | src/yuescript/yue_parser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/yuescript/yue_parser.cpp b/src/yuescript/yue_parser.cpp index 5c42963..78b4713 100755 --- a/src/yuescript/yue_parser.cpp +++ b/src/yuescript/yue_parser.cpp | |||
| @@ -532,7 +532,11 @@ YueParser::YueParser() { | |||
| 532 | return true; | 532 | return true; |
| 533 | } | 533 | } |
| 534 | }) >> ExpList >> -Assign) | 534 | }) >> ExpList >> -Assign) |
| 535 | | Space >> Macro) >> not_(Space >> statement_appendix); | 535 | | Space >> pl::user(Macro, [](const item_t& item) { |
| 536 | State* st = reinterpret_cast<State*>(item.user_data); | ||
| 537 | st->exportMacro = true; | ||
| 538 | return true; | ||
| 539 | })) >> not_(Space >> statement_appendix); | ||
| 536 | 540 | ||
| 537 | variable_pair = sym(':') >> Variable >> not_('#'); | 541 | variable_pair = sym(':') >> Variable >> not_('#'); |
| 538 | 542 | ||
| @@ -664,6 +668,7 @@ ParseInfo YueParser::parse(std::string_view codes, rule& r) { | |||
| 664 | if (state.exportCount > 0) { | 668 | if (state.exportCount > 0) { |
| 665 | res.moduleName = std::move(state.moduleName); | 669 | res.moduleName = std::move(state.moduleName); |
| 666 | res.exportDefault = state.exportDefault; | 670 | res.exportDefault = state.exportDefault; |
| 671 | res.exportMacro = state.exportMacro; | ||
| 667 | } | 672 | } |
| 668 | } catch (const std::logic_error& err) { | 673 | } catch (const std::logic_error& err) { |
| 669 | res.error = err.what(); | 674 | res.error = err.what(); |
