This commit makes the Input class supporting various text sources, such as a String, a Path, a File, etc. The real source passed at construction is kept under @source for traceability. Common rubyisms are used to recognize those sources. In particular, Pathname instances will be recognized through respond_to?(:to_path), which is standard in ruby 1.9.x. Files and IO are recognized through :read. Strings and StringIO through :to_str.
For traceability of matches inside the parsed string, we now keep the Input instance instead of the source text in matches. This is transparent for the Match class, as it simply expects its input to behave like a String (to_str). That method has been added to Input accordingly.
Instead of successively slicing strings in matches, we keep the parsed text under @source, and an offset in the later in @offset. Btw, that @offset might be very useful for keeping trace of the localisation of the match in the source text (e.g. for subsequent semantic passes; semantic error detection for instance).
…from the cache. Also update tests to verify this behavior.
…ted rule references, accessible via command-I
… this out according to users preferences if tabs are used