isAtRootLevel and namespaceAndFunctionDepth were both added to help determine where library statements were permitted. However, we still parse them anyway, so this is just a validation reason. We should remove that unnecessary complexity from the parser, and instead enforce library statement locations in the validation cycle.