Skip to content
Commit 5a68522b authored by Milian Wolff's avatar Milian Wolff
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment