Fix error when no parenthesis in export statement

The previous, verbose code actually crashed when for example someone forgets to put parenthesis:

def test():
    ...

In that case the p token passed to p_error is None, and so it crashes when trying to access p.value