Fixed arity detection in lexer.py