summaryrefslogtreecommitdiff
path: root/src/printer/generic.cpp
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-10-07 18:43:39 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-10-07 18:43:39 -0600
commit7bbd1a207f65428283471f1cc956f3fda43fbe3e (patch)
treef8febd1c59ad6aa5f071aa8644a4961b163cfb77 /src/printer/generic.cpp
parent79866eaaf708759db9458e60bb4ea51799608f2e (diff)
downloadchill-7bbd1a207f65428283471f1cc956f3fda43fbe3e.tar.gz
chill-7bbd1a207f65428283471f1cc956f3fda43fbe3e.tar.bz2
chill-7bbd1a207f65428283471f1cc956f3fda43fbe3e.zip
fixes
Diffstat (limited to 'src/printer/generic.cpp')
-rw-r--r--src/printer/generic.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/printer/generic.cpp b/src/printer/generic.cpp
index 79ee312..dcd5498 100644
--- a/src/printer/generic.cpp
+++ b/src/printer/generic.cpp
@@ -7,6 +7,7 @@
using namespace chill::printer;
void GenericPrinter::print(std::string ident, chillAST_Node *n, std::ostream &o) {
+ if (!n) return;
switch (n->getType()) {
case CHILLAST_NODE_ARRAYSUBSCRIPTEXPR:
printS(ident, dynamic_cast<chillAST_ArraySubscriptExpr *>(n), o);
@@ -120,6 +121,7 @@ void GenericPrinter::print(std::string ident, chillAST_Node *n, std::ostream &o)
}
int GenericPrinter::getPrec(chillAST_Node *n) {
+ if (!n) return defGetPrecS();
switch (n->getType()) {
case CHILLAST_NODE_ARRAYSUBSCRIPTEXPR:
return getPrecS(dynamic_cast<chillAST_ArraySubscriptExpr *>(n));