def p_const(p):
 try:
  val = _cast(p[2])(p[5])
 except AssertionError:
  raise ThriftParserError(('Type error for constant %s at line %d' % (p[3], p.lineno(3))))
 setattr(thrift_stack[(-1)], p[3], val)
 _add_thrift_meta('consts', val)

def p_const ( p ) : try : val = _cast ( p [ 2 ] ) ( p [ 5 ] ) except AssertionError : raise ThriftParserError ( ( 'Type error for constant %s at line %d' % ( p [ 3 ] , p . lineno ( 3 ) ) ) ) setattr ( thrift_stack [ ( - 1 ) ] , p [ 3 ] , val ) _add_thrift_meta ( 'consts' , val )
const : const field_type identifier = const_value | const field_type identifier = const_value sep .