| 554 | } |
| 555 | |
| 556 | modelicaParser::Equation_sectionContext* ClassDefinitionImpl::selectEquationSection() const { |
| 557 | auto* specifier = ctx()->class_specifier(); |
| 558 | if (!specifier || !specifier->long_class_specifier()) { |
| 559 | return nullptr; |
| 560 | } |
| 561 | |
| 562 | auto* composition = specifier->long_class_specifier()->composition(); |
| 563 | if (!composition) { |
| 564 | return nullptr; |
| 565 | } |
| 566 | |
| 567 | modelicaParser::Equation_sectionContext* fallback = nullptr; |
| 568 | const auto sections = composition->equation_section(); |
| 569 | for (auto* section : sections) { |
| 570 | if (!section) { |
| 571 | continue; |
| 572 | } |
| 573 | auto* start = section->getStart(); |
| 574 | if (start && start->getText() != "initial") { |
| 575 | return section; |
| 576 | } |
| 577 | if (!fallback) { |
| 578 | fallback = section; |
| 579 | } |
| 580 | } |
| 581 | return fallback; |
| 582 | } |
| 583 | |
| 584 | std::pair<std::string, std::string> ClassDefinitionImpl::validateAndNormalizeConnectClause(const std::string& source, const std::string& target) { |
| 585 | try { |
nothing calls this directly
no test coverage detected