only skip semantic checks if parse tree invalid, instead of on all syntax errors