Fix binary operator parentheses bug. (#400)
Fixes #399. Update `test_printers.cpp`: * Fix compilation and scope management issues, and re-include in CMakeLists.txt. * Update to use `verbose_print` (run-time verbosity). * Apply expected output tests to `CPrinter` and `CUDAPrinter` outputs. Address binary operation rendering issue: * Move C-style expression rendering common to `CPrinter` and `CUDAPrinter` to a specialized `Visitor`, `CExprRenderer`. * Use operator associativity to determine need for parentheses around sub-expressions of a binary expression.
Showing
- modcc/CMakeLists.txt 1 addition, 0 deletionsmodcc/CMakeLists.txt
- modcc/cexpr_emit.cpp 112 additions, 0 deletionsmodcc/cexpr_emit.cpp
- modcc/cexpr_emit.hpp 34 additions, 0 deletionsmodcc/cexpr_emit.hpp
- modcc/cprinter.cpp 5 additions, 103 deletionsmodcc/cprinter.cpp
- modcc/cprinter.hpp 1 addition, 4 deletionsmodcc/cprinter.hpp
- modcc/cudaprinter.cpp 4 additions, 106 deletionsmodcc/cudaprinter.cpp
- modcc/cudaprinter.hpp 5 additions, 6 deletionsmodcc/cudaprinter.hpp
- modcc/token.hpp 10 additions, 0 deletionsmodcc/token.hpp
- tests/modcc/CMakeLists.txt 1 addition, 1 deletiontests/modcc/CMakeLists.txt
- tests/modcc/test_printers.cpp 98 additions, 48 deletionstests/modcc/test_printers.cpp
Please register or sign in to comment