![Logo](logo.png) |
User Guide
|
Go to the documentation of this file.
8 #include <catch2/catch_test_macros.hpp>
9 #include <catch2/matchers/catch_matchers_string.hpp>
21 using namespace nmodl;
22 using namespace visitor;
24 using namespace test_utils;
26 using Catch::Matchers::Equals;
37 SymtabVisitor().visit_program(*ast);
38 InlineVisitor().visit_program(*ast);
39 SymtabVisitor().visit_program(*ast);
40 LocalVarRenameVisitor().visit_program(*ast);
41 SymtabVisitor().visit_program(*ast);
42 std::stringstream stream;
43 NmodlPrintVisitor(stream).visit_program(*ast);
47 CheckParentVisitor().check_ast(*ast);
52 SCENARIO(
"LocalVarRenameVisitor works with InlineVisitor",
"[visitor][localvarrename]") {
53 GIVEN(
"A FUNCTION that gets inlined with a LOCAL variable") {
54 std::string nmodl_text = R
"(
55 FUNCTION rates_1(Vm (mV)) {
61 FUNCTION rates_2(Vm (mV)) {
65 std::string output_nmodl = R"(
66 FUNCTION rates_1(Vm(mV)) {
72 FUNCTION rates_2(Vm(mV)) {
80 rates_2 = rates_1_in_0
83 THEN("LOCAL variable in inlined function gets renamed") {
87 REQUIRE(result == expected_result);
Class that binds all pieces together for parsing nmodl file.
std::string reindent_text(const std::string &text, int indent_level)
Reindent nmodl text for text-to-text comparison.
encapsulates code generation backend implementations
Auto generated AST classes declaration.
nmodl::parser::UnitDriver driver
Visitor to rename local variables conflicting with global scope
bool parse_string(const std::string &input)
parser Units provided as string (used for testing)
Visitor for checking parents of ast nodes
Visitor to inline local procedure and function calls
std::string run_inline_localvarrename_visitor(const std::string &text)
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
SCENARIO("LocalVarRenameVisitor works with InlineVisitor", "[visitor][localvarrename]")
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.