code: def t_LITERAL(self, t):
          r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\''
          s = t.value[1:-1]
          maps = {
              't': '\t',
              'r': '\r',
              'n': '\n',
              '\\': '\\',
              '\'': '\'',
              '"': '\"'
          }
          i = 0
          length = len(s)
          val = ''
          while i < length:
              if s[i] == '\\':
                  i += 1
                  if s[i] in maps:
                      val += maps[s[i]]
                  else:
                      msg = 'Cannot escape character: %s' % s[i]
                      raise ThriftParserError(msg)
              else:
                  val += s[i]
              i += 1
  
          t.value = val
          return f t_LITERAL(self, t):
          r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\''
          s = t.value[1:-1]
          maps = {
              't': '\t',
              'r': '\r',
              'n': '\n',
              '\\': '\\',
              '\'': '\'',
              '"': '\"'
          }
          i = 0
          length = len(s)
          val = ''
          while i < length:
              if s[i] == '\\':
                  i += 1
                  if s[i] in maps:
                      val += maps[s[i]]
                  else:
                      msg = 'Cannot escape character: %s' % s[i]
                      raise ThriftParserError(msg)
              else:
                  val += s[i]
              i += 1
  
          t.value = val
          return t
docs: r'(\"([^\\\n]|(\\.))*?\")|\'([^\\\n]|(\\.))*?\