lib/fig/string_tokenizer.rb
def strip_quotes_and_process_escapes()
    if @string.length == 0
      @single_quoted = false
      @segments << Fig::TokenizedString::PlainSegment.new('')

      return
    end

    @single_quoted = strip_single_quotes_and_process_escapes
    return if @single_quoted.nil?
    if @single_quoted
      @segments << Fig::TokenizedString::PlainSegment.new(@string.clone)

      return
    end

    strip_double_quotes_and_process_escapes

    return
  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 strip_quotes_and_process_escapes()
    if @string.length == 0
      @single_quoted = false
      @segments << Fig::TokenizedString::PlainSegment.new('')
      return
    end
    @single_quoted = strip_single_quotes_and_process_escapes
    return if @single_quoted.nil?
    if @single_quoted
      @segments << Fig::TokenizedString::PlainSegment.new(@string.clone)
      return
    end
    strip_double_quotes_and_process_escapes
    return
  end
def strip_quotes_and_process_escapes ( ) if @string . length == 0 @single_quoted = false @segments << Fig :: TokenizedString :: PlainSegment . new ( '' ) return end @single_quoted = strip_single_quotes_and_process_escapes return if @single_quoted . nil? if @single_quoted @segments << Fig :: TokenizedString :: PlainSegment . new ( @string . clone ) return end strip_double_quotes_and_process_escapes return end
subexpression_matchers is an array of hashes.
subexpression_matchers is an array of hashes .