make it simpler to extend the ast without introducing nasty crashes by...
make it simpler to extend the ast without introducing nasty crashes by improving the expressionvisitor api a) no longer do we have to overload all visit*() functions just to add the PushPositiveContext, instead we overload visit() centrally and handle it there b) we explicitly mark visit() private, users are supposed to use .parse() - this showed a bug in the name visitor leading to the crash in bug 284536 Future work ideas: - go even farther and expect a required currentContext argument in the parse() method that makes the assertion for node->duContext a compile-time check and removes quite some duplicated code where the expression visitor is used - clean m_context <-> m_localContext in TypeASTVisitor and NameASTVisitor. a quick check showed no actual difference as far as I could see, hence this should be probably merge. - furthermore I wonder whether the visit() overload of the expr. visitor should not also be done in the TypeASTVisitor and NameASTVisitor as well? BUG: 284536
parent
ea4cc580
Please register or sign in to comment