class AdLint::Cpp::Matcher::OuterTokenMatching

Public Instance Methods

process(tok) click to toggle source
# File lib/adlint/cpp/subst.rb, line 188
def process(tok)
  if ptn_tok = next_pattern_token
    if tok.value == ptn_tok.value
      case tok.value
      when "(", "[", "{"
        InnerTokenMatching.new(matcher, self)
      else
        self
      end
    else
      if ptn_tok.value == "__adlint__any"
        if sentry_tok = rest_pattern_tokens.first and
            tok.value == sentry_tok.value
          case tok.value
          when "(", "[", "{"
            InnerTokenMatching.new(matcher, self).process(tok)
          else
            self
          end
        else
          OuterAnyMatching.new(matcher)
        end
      else
        Rejected.new(matcher)
      end
    end
  else
    Accepted.new(matcher)
  end
end