#NEWLINE# def _field( self ) : #NEWLINE# #INDENT# "Parse a field.\n\n        field ::= '[' exp ']' '=' exp | Name '=' exp | exp\n\n        Returns:\n          FieldExpKey(key_exp, exp)\n          FieldNamedKey(key_name, exp)\n          FieldExp(exp)\n        " #NEWLINE# pos = self . _pos #NEWLINE# if self . _accept ( lexer . TokSymbol ( '[' ) ) : #NEWLINE# #INDENT# key_exp = self . _assert ( self . _exp ( ) , 'exp key in field' ) #NEWLINE# self . _expect ( lexer . TokSymbol ( ']' ) ) #NEWLINE# self . _expect ( lexer . TokSymbol ( '=' ) ) #NEWLINE# exp = self . _assert ( self . _exp ( ) , 'exp value in field' ) #NEWLINE# return FieldExpKey ( key_exp , exp , start = pos , end = self . _pos ) #NEWLINE# #UNINDENT# key_name = self . _accept ( lexer . TokName ) #NEWLINE# if ( ( key_name is not None ) and ( self . _accept ( lexer . TokSymbol ( '=' ) ) is not None ) ) : #NEWLINE# #INDENT# exp = self . _assert ( self . _exp ( ) , 'exp value in field' ) #NEWLINE# return FieldNamedKey ( key_name , exp , start = pos , end = self . _pos ) #NEWLINE# #UNINDENT# self . _pos = pos #NEWLINE# exp = self . _exp ( ) #NEWLINE# if ( exp is not None ) : #NEWLINE# #INDENT# return FieldExp ( exp , start = pos , end = self . _pos ) #NEWLINE# #UNINDENT# return None