16 #include <catch2/catch_test_macros.hpp>
17 #include <catch2/matchers/catch_matchers_string.hpp>
19 using namespace nmodl;
34 SCENARIO(
"Check insertion of explicit METHOD to SOLVE block",
"[visitor][solve_without_method]") {
35 GIVEN(
"A mod file that has a SOLVE block of a derivative without an explicit METHOD") {
38 SUFFIX ImplicitMethodTest
53 auto const expected_text = R
"(
55 SUFFIX ImplicitMethodTest
59 SOLVE states METHOD derivimplicit
71 THEN(
"The two mod files should match") {
75 GIVEN(
"A mod file that has a SOLVE block of a derivative with an explicit METHOD") {
78 SUFFIX ImplicitMethodTest
82 SOLVE states METHOD cnexp
94 THEN(
"The mod file should remain as-is") {
98 GIVEN(
"A mod file that has a SOLVE block of a LINEAR block without an explicit METHOD") {
101 SUFFIX ImplicitMethodTest
117 THEN(
"The mod file should remain as-is") {
Class that binds all pieces together for parsing nmodl file.
Visitor for adding an explicit method to a SOLVE block which has an implicit one
void visit_program(ast::Program &node) override
visit node of type ast::Program
Concrete visitor for constructing symbol table from AST.
void visit_program(ast::Program &node) override
visit node of type ast::Program
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
encapsulates code generation backend implementations
std::string to_nmodl(const ast::Ast &node, const std::set< ast::AstNodeType > &exclude_types)
Given AST node, return the NMODL string representation.
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
Auto generated AST classes declaration.
SCENARIO("Check insertion of explicit METHOD to SOLVE block", "[visitor][solve_without_method]")
std::string generate_mod_after_solve_without_method_visitor(std::string const &text)
Visitor for adding an explicit method to a SOLVE block which has an implicit one
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
nmodl::parser::UnitDriver driver
Utility functions for visitors implementation.