parameters: ( self, values )
return_statement: return t
docstring: Evaluates the values list of dictionaries passed in and figures out what the enum value
          for each enum is editing in place:
          
          Example:
          From: [{'name': 'ORANGE'},
                 {'name': 'RED'},
                 {'name': 'GREEN', 'value': '8'}]
          To:   [{'name': 'ORANGE', 'value': 0},
                 {'name': 'RED', 'value': 1},
                 {'name': 'GREEN', 'value': 8}]
docstring_summary: Evaluates the values list of dictionaries passed in and figures out what the enum value
          for each enum is editing in place:
          
          Example:
          From: [{'name': 'ORANGE'},
                 {'name': 'RED'},
                 {'name': 'GREEN', 'value': '8'}]
          To:   [{'name': 'ORANGE', 'value': 0},
                 {'name': 'RED', 'value': 1},
                 {'name': 'GREEN', 'value': 8}]
docstring_tokens: Evaluates the values list of dictionaries passed in and figures out what the enum value for each enum is editing in place : Example : From : [ { name : ORANGE } { name : RED } { name : GREEN value : 8 } ] To : [ { name : ORANGE value : 0 } { name : RED value : 1 } { name : GREEN value : 8 } ]
function: def resolve_enum_values( self, values ):
          """Evaluates the values list of dictionaries passed in and figures out what the enum value
          for each enum is editing in place:
          
          Example:
          From: [{'name': 'ORANGE'},
                 {'name': 'RED'},
                 {'name': 'GREEN', 'value': '8'}]
          To:   [{'name': 'ORANGE', 'value': 0},
                 {'name': 'RED', 'value': 1},
                 {'name': 'GREEN', 'value': 8}]
          """
          t = int; i = 0
          names = [ v['name'] for v in values ]
          for v in values:
              if 'value' in v:
                  a = v['value'].strip()
                  # Remove single quotes from single quoted chars (unless part of some expression
                  if len(a) == 3 and a[0] == "'" and a[2] == "'":
                      a = v['value'] = a[1]
                  if a.lower().startswith("0x"):
                      try:
                          i = a = int(a , 16)
                      except:pass
                  elif a.isdigit():
                      i = a = int( a )
                  elif a in names:
                      for other in values:
                          if other['name'] == a:
                              v['value'] = other['value']
                              break
  
                  elif '"' in a or "'" in a: t = str # only if there are quotes it this a string enum
                  else:
                      try:
                          a = i = ord(a)
                      except: pass
                  #Allow access of what is in the file pre-convert if converted
                  if v['value'] != str(a):
                      v['raw_value'] = v['value']
                  v['value'] = a
              else: v['value'] = i
              try:
                  v['value'] = v['value'].replace(" < < ", " << ").replace(" >> ", " >> ")
              except: pass
              i += 1
          return t
function_tokens: def resolve_enum_values ( self , values ) : t = int i = 0 names = [ v [ 'name' ] for v in values ] for v in values : if 'value' in v : a = v [ 'value' ] . strip ( ) # Remove single quotes from single quoted chars (unless part of some expression if len ( a ) == 3 and a [ 0 ] == "'" and a [ 2 ] == "'" : a = v [ 'value' ] = a [ 1 ] if a . lower ( ) . startswith ( "0x" ) : try : i = a = int ( a , 16 ) except : pass elif a . isdigit ( ) : i = a = int ( a ) elif a in names : for other in values : if other [ 'name' ] == a : v [ 'value' ] = other [ 'value' ] break elif '"' in a or "'" in a : t = str # only if there are quotes it this a string enum else : try : a = i = ord ( a ) except : pass #Allow access of what is in the file pre-convert if converted if v [ 'value' ] != str ( a ) : v [ 'raw_value' ] = v [ 'value' ] v [ 'value' ] = a else : v [ 'value' ] = i try : v [ 'value' ] = v [ 'value' ] . replace ( " < < " , " << " ) . replace ( " >> " , " >> " ) except : pass i += 1 return t