txt: ## subparse.md
  subparse
  
  Combined from primary sources listed below.
  
  # [In Grammar](#___top "go to top of document")[§](#(Grammar)_method_subparse "direct link")
  
  See primary documentation
  [in context](/type/Grammar#method_subparse)
  for **method subparse**.
  
  ```raku
  method subparse($target, :$rule = 'TOP', Capture() :$args = \(),  Mu :$actions = Mu, *%opt)
  ```
  
  Does exactly the same as [method parse](/routine/parse), except that cursor doesn't have to reach the end of the string to succeed. That is, it doesn't have to match the whole string.
  
  Note that unlike [method parse](/routine/parse), `subparse` *always* returns a [`Match`](/type/Match), which will be a failed match (and thus falsy), if the grammar failed to match.
  
  ```raku
  grammar RepeatChar {
      token start($character) { $character+ }
  }
  
  say RepeatChar.subparse('bbbabb', :rule('start'), :args(\('b')));
  say RepeatChar.parse(   'bbbabb', :rule('start'), :args(\('b')));
  say RepeatChar.subparse('bbbabb', :rule('start'), :args(\('a')));
  say RepeatChar.subparse('bbbabb', :rule('start'), :args(\('a')), :pos(3));
  
  
  # OUTPUT:
  # ｢bbb｣
  # Nil
  # #<failed match>
  # ｢a｣
  ```
  