Class: Packr::Parser

Inherits:
RegexpGroup show all
Defined in:
lib/packr/parser.rb

Constant Summary collapse

DICTIONARY =

STRING1 requires backslashes to fix concat bug

RegexpGroup.new.
put(:OPERATOR,    /return|typeof|[\[(\^=,{}:;&|!*?]/.source).
put(:CONDITIONAL, /\/\*@\w*|\w*@\*\/|\/\/@\w*|@\w+/.source).
put(:COMMENT1,    /\/\/[^\n]*/.source).
put(:COMMENT2,    /\/\*[^*]*\*+([^\/][^*]*\*+)*\//.source).
put(:REGEXP,      /\/(\\[\/\\]|[^*\/])(\\.|[^\/\n\\])*\/[gim]*/.source).
put(:STRING1,     /\'(\\.|[^\'\\])*\'/.source).
put(:STRING2,     /"(\\.|[^"\\])*"/.source)

Constants inherited from RegexpGroup

RegexpGroup::BACK_REF, RegexpGroup::BRACKETS, RegexpGroup::ESCAPE_BRACKETS, RegexpGroup::ESCAPE_CHARS, RegexpGroup::IGNORE, RegexpGroup::LOOKUP, RegexpGroup::LOOKUP_SIMPLE

Instance Attribute Summary

Attributes inherited from Collection

#keys, #values

Instance Method Summary collapse

Methods inherited from RegexpGroup

count, #exec, #initialize, #insert_at, #test, #to_s

Methods inherited from Collection

#add, #clear, #copy, create, #each, #get_at, #get_keys, #index_of, #initialize, #insert_at, #item, #map, #merge, #put_at, #remove, #remove_at, #reverse!, #size, #slice, #sort!, #to_s

Methods inherited from Map

#clear, #copy, #each, #get, #get_keys, #get_values, #has?, #initialize, #merge, #remove, #size, #union

Constructor Details

This class inherits a constructor from Packr::RegexpGroup

Instance Method Details

#put(expression, replacement) ⇒ Object



4
5
6
7
# File 'lib/packr/parser.rb', line 4

def put(expression, replacement)
  expression = DICTIONARY.exec(expression) if expression.is_a?(String)
  super(expression, replacement)
end