parameters: (self)
docstring: Parse command line remainder in the context of an unquoted string.
docstring_summary: Parse command line remainder in the context of an unquoted string.
docstring_tokens: Parse command line remainder in the context of an unquoted string .
function: def _parse_unquoted(self):
          """
          Parse command line remainder in the context of an unquoted string.
          """
          while self.cline:
              # Find the next token
              m = _unquoted_tokens.search(self.cline)
              # If we find none, the remainder of the string can be pushed to
              # the current argument and the argument finalized
              if not m:
                  self._push(self.cline)
                  break
              # The beginning of the string, up to the found token, is part of
              # the current argument
              if m.start():
                  self._push(self.cline[:m.start()])
              self.cline = self.cline[m.end():]
  
              match = dict([(name, value) for name, value in m.groupdict().items() if value])
              if 'quote' in match:
                  # " or ' start a quoted string
                  if match['quote'] == '"':
                      self._parse_doubly_quoted()
                  else:
                      self._parse_quoted()
              elif 'comment' in match:
                  # Comments are ignored. The current argument can be finalized,
                  # and parsing stopped.
                  break
              elif 'special' in match:
                  # Unquoted, non-escaped special characters need to be sent to a
                  # shell.
                  raise MetaCharacterException, match['special']
              elif 'whitespace' in match:
                  # Whitespaces terminate current argument.
                  self._next()
              elif 'escape' in match:
                  # Escaped backslashes turn into a single backslash
                  self._push('\\')
              elif 'backslashed' in match:
                  # Backslashed characters are unbackslashed
                  # e.g. echo \a -> a
                  self._push(match['backslashed'][1])
              elif 'glob' in match:
                  # ? or * will need globbing
                  self.glob = True
                  self._push(m.group(0))
              else:
                  raise Exception, "Shouldn't reach here"
          if self.arg:
              self._next()
function_tokens: def _parse_unquoted ( self ) : while self . cline : # Find the next token m = _unquoted_tokens . search ( self . cline ) # If we find none, the remainder of the string can be pushed to # the current argument and the argument finalized if not m : self . _push ( self . cline ) break # The beginning of the string, up to the found token, is part of # the current argument if m . start ( ) : self . _push ( self . cline [ : m . start ( ) ] ) self . cline = self . cline [ m . end ( ) : ] match = dict ( [ ( name , value ) for name , value in m . groupdict ( ) . items ( ) if value ] ) if 'quote' in match : # " or ' start a quoted string if match [ 'quote' ] == '"' : self . _parse_doubly_quoted ( ) else : self . _parse_quoted ( ) elif 'comment' in match : # Comments are ignored. The current argument can be finalized, # and parsing stopped. break elif 'special' in match : # Unquoted, non-escaped special characters need to be sent to a # shell. raise MetaCharacterException , match [ 'special' ] elif 'whitespace' in match : # Whitespaces terminate current argument. self . _next ( ) elif 'escape' in match : # Escaped backslashes turn into a single backslash self . _push ( '\\' ) elif 'backslashed' in match : # Backslashed characters are unbackslashed # e.g. echo \a -> a self . _push ( match [ 'backslashed' ] [ 1 ] ) elif 'glob' in match : # ? or * will need globbing self . glob = True self . _push ( m . group ( 0 ) ) else : raise Exception , "Shouldn't reach here" if self . arg : self . _next ( )