Permalink
Switch branches/tags
Commits on Jan 25, 2012
  1. Update README.md

    practicingruby committed Jan 25, 2012
  2. Update README

    practicingruby committed Jan 25, 2012
  3. Update README

    practicingruby committed Jan 25, 2012
  4. Update README

    practicingruby committed Jan 25, 2012
  5. Update README

    practicingruby committed Jan 25, 2012
  6. Add integration tests

    practicingruby committed Jan 25, 2012
  7. No longer needed

    practicingruby committed Jan 25, 2012
  8. Add gems to .gitignore

    practicingruby committed Jan 25, 2012
  9. Make releaseable

    practicingruby committed Jan 25, 2012
  10. Major refactor

    practicingruby committed Jan 25, 2012
  11. Tiny cleanup

    practicingruby committed Jan 25, 2012
  12. Update test naming

    practicingruby committed Jan 25, 2012
  13. Update README

    practicingruby committed Jan 25, 2012
  14. Update naming

    practicingruby committed Jan 25, 2012
  15. Missed a few ivars

    practicingruby committed Jan 25, 2012
Commits on Jan 21, 2012
  1. Merge pull request #6 from riccieri/master

    practicingruby committed Jan 21, 2012
    Moved classes on the main file to their own files.
Commits on Jan 20, 2012
Commits on Jan 18, 2012
  1. Merge pull request #5 from steveklabnik/master

    practicingruby committed Jan 18, 2012
    Broke out a Tokenizer class from Scanner
  2. Broke out Tokenizer class from Scanner.

    steveklabnik committed Jan 18, 2012
    Private is a smell. Especially when you have a bunch of private methods.
    It usually means there's a class hiding inside.
    
    I drew this diagram of dependencies between methods:
    http://i.imgur.com/PPhXb.jpg
    
    As you can see, the Scanner class at the bottom is strange: only
    one method gets used from outside, and everything else is private.
    This suggests that the cluster of methods that _aren't_ \#next should
    be some sort of class. The best strategy is to look at the names and
    see if they feel grouped in some way.
    
    It wasn't all sunshine in paradise, however. Reading the method names,
    I kept saying 'man, this feels like a Scanner to me.' So I decided
    to turn the tables: what does \#next imply?
    
    To me, it implies a Tokenizer. Ahhhh, Java! But that's really what
    the Interpreter wants: a stream of tokens. Damn the logic for actually
    getting them. So I renamed Scanner to Tokenizer, and broke out
    the private methods into a class named Scanner.
    
    This feels better from an SRP standpoint as well. The next method is
    all about the logic concerning which token we want next, but all the
    others are about the manipulation of the actual data structure itself.
    \#next is a higher level interface built on top of the lower-level
    Scanner. Rock.
    
    I also had to update the tests.
  3. Merge pull request #2 from eregon/patch-1

    practicingruby committed Jan 18, 2012
    use putc(char) instead of print("" << char)