Method: Token#_pattern_

Defined in:
lib/raka/token.rb

#_pattern_Object



141
142
143
144
145
146
147
# File 'lib/raka/token.rb', line 141

def _pattern_
  # scopes as leading
  leading = !@context.scopes.empty? ? _scope_pattern_ + '/' : _scope_pattern_
  leading += "(#{@inline_scope})/" unless @inline_scope.nil?
  body = @chain.reverse.map { |s| "(#{s})" }.join('__')
  Regexp.new('^' + leading + body + '\.' + @context.ext.to_s + '$')
end