diff options
Diffstat (limited to '')
| -rw-r--r-- | src/MoonP/moon_compiler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index 020e561..b1770fb 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp | |||
| @@ -441,16 +441,17 @@ private: | |||
| 441 | if (ast_is<existential_op_t>(chainValue->items.back())) { | 441 | if (ast_is<existential_op_t>(chainValue->items.back())) { |
| 442 | return ChainType::EndWithEOP; | 442 | return ChainType::EndWithEOP; |
| 443 | } | 443 | } |
| 444 | ChainType type = ChainType::Common; | ||
| 444 | for (auto item : chainValue->items.objects()) { | 445 | for (auto item : chainValue->items.objects()) { |
| 445 | if (auto colonChain = ast_cast<ColonChainItem_t>(item)) { | 446 | if (auto colonChain = ast_cast<ColonChainItem_t>(item)) { |
| 446 | if (ast_is<LuaKeyword_t>(colonChain->name)) { | 447 | if (ast_is<LuaKeyword_t>(colonChain->name)) { |
| 447 | return ChainType::HasKeyword; | 448 | type = ChainType::HasKeyword; |
| 448 | } | 449 | } |
| 449 | } else if (ast_is<existential_op_t>(item) && item != chainValue->items.back()) { | 450 | } else if (ast_is<existential_op_t>(item)) { |
| 450 | return ChainType::HasEOP; | 451 | return ChainType::HasEOP; |
| 451 | } | 452 | } |
| 452 | } | 453 | } |
| 453 | return ChainType::Common; | 454 | return type; |
| 454 | } | 455 | } |
| 455 | 456 | ||
| 456 | std::string singleVariableFrom(ChainValue_t* chainValue) { | 457 | std::string singleVariableFrom(ChainValue_t* chainValue) { |
