def precedence(state):
 try:
  return PRECEDENCE_LOOKUP[state]
 except KeyError:
  return NONE_PRECEDENCE

def precedence ( state ) : try : return PRECEDENCE_LOOKUP [ state ] except KeyError : return NONE_PRECEDENCE
get the precedence index for state .