lib/fig/string_tokenizer.rb
def subexpression_match(sub_string)
    @subexpression_matchers.each do
      |matcher|

      pattern = matcher[:pattern]
      if sub_string =~ %r< \A ( #{pattern} ) >x
        subexpression, remainder = $1, $'
        replacement = matcher[:action].call subexpression, @error_block

        return if ! replacement
        return [replacement, remainder]
      end
    end

    return false
  end
# subexpression_matchers is an array of hashes.  Each hash is expected to
# contain two keys: :pattern and :action.
#
# The :pattern value needs to be a regular expression for the substring that
# needs special handling.
#
# The :action value needs to be a block that takes two parameters.
#
# The first parameter is the text that was matched and the second is the
# error block passed to #tokenize().
#
# On success the block returns either a String containing replacement text or
# a Fig::TokenizedString::Token representing the special handling of the
# consumed text.  If there was a problem, then the error block should have
# been invoked and the block should return nil.
#
#
# metacharacters is a regular expression character class for characters that
# need to be escaped when un-single quoting a string.
subexpression_matchers is an array of hashes.  Each hash is expected to
contain two keys: :pattern and :action.

The :pattern value needs to be a regular expression for the substring that
needs special handling.

The :action value needs to be a block that takes two parameters.

The first parameter is the text that was matched and the second is the
error block passed to #tokenize().

On success the block returns either a String containing replacement text or
a Fig::TokenizedString::Token representing the special handling of the
consumed text.  If there was a problem, then the error block should have
been invoked and the block should return nil.

metacharacters is a regular expression character class for characters that
need to be escaped when un-single quoting a string.
subexpression_matchers is an array of hashes . Each hash is expected to contain two keys : : pattern and : action . The : pattern value needs to be a regular expression for the substring that needs special handling . The : action value needs to be a block that takes two parameters . The first parameter is the text that was matched and the second is the error block passed to #tokenize () . On success the block returns either a String containing replacement text or a Fig :: TokenizedString :: Token representing the special handling of the consumed text . If there was a problem then the error block should have been invoked and the block should return nil . metacharacters is a regular expression character class for characters that need to be escaped when un - single quoting a string .
def subexpression_match(sub_string)
    @subexpression_matchers.each do
      |matcher|
      pattern = matcher[:pattern]
      if sub_string =~ %r< \A ( #{pattern} ) >x
        subexpression, remainder = $1, $'
        replacement = matcher[:action].call subexpression, @error_block
        return if ! replacement
        return [replacement, remainder]
      end
    end
    return false
  end
def subexpression_match ( sub_string ) @subexpression_matchers . each do | matcher | pattern = matcher [ :pattern ] if sub_string =~ %r< \A  (  #{ pattern }  )  >x subexpression , remainder = $1 , $' replacement = matcher [ :action ] . call subexpression , @error_block return if ! replacement return [ replacement , remainder ] end end return false end
subexpression_matchers is an array of hashes.
subexpression_matchers is an array of hashes .
sub_string