Skip to content

Commit

Permalink
Handle comments coming after division from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Nov 30, 2023
1 parent 6d8d958 commit 7291844
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/tetests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,14 @@ COMBIN(15,
3)
/)");

tep.compile((
R"(21 / 7 // division)"));
CHECK(3 == tep.evaluate());

tep.compile((
R"(21 / /* division */ 7 // division)"));
CHECK(3 == tep.evaluate());
}
}

Expand Down
2 changes: 1 addition & 1 deletion tinyexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ bool te_parser::compile(const std::string_view expression)
{ m_expression.erase(commentStart, commentEnd - commentStart); }
}
else
{ break; }
{ ++commentStart; }
}

try
Expand Down

0 comments on commit 7291844

Please sign in to comment.