Skip to content
Commits on Jan 18, 2012
  1. Broke out Tokenizer class from Scanner.

    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.
    committed Jan 18, 2012
  2. @practicingruby
  3. @practicingruby
  4. @practicingruby
  5. @practicingruby
  6. @practicingruby

    Merge pull request #2 from eregon/patch-1

    use putc(char) instead of print("" << char)
    practicingruby committed Jan 18, 2012
  7. @eregon
Commits on Jan 17, 2012
  1. @practicingruby

    Update README.md

    practicingruby committed Jan 17, 2012
  2. @practicingruby

    small refactoring

    practicingruby committed Jan 16, 2012
  3. @practicingruby

    ideas

    practicingruby committed Jan 16, 2012
  4. @practicingruby

    Interpreter

    practicingruby committed Jan 16, 2012
  5. @practicingruby

    Refactor

    practicingruby committed Jan 16, 2012
  6. @practicingruby

    Refactor

    practicingruby committed Jan 16, 2012
  7. implemented nested ] with error

    Jia Wu committed Jan 16, 2012
  8. @practicingruby

    nested loop

    practicingruby committed Jan 16, 2012
  9. implemented nested [

    Jia Wu committed Jan 16, 2012
  10. @practicingruby

    nested jump

    practicingruby committed Jan 16, 2012
  11. implemented ]

    Jia Wu committed Jan 16, 2012
  12. @practicingruby

    loop test

    practicingruby committed Jan 16, 2012
  13. implemented [ partially

    Jia Wu committed Jan 16, 2012
  14. @practicingruby

    additional scanner test

    practicingruby committed Jan 16, 2012
  15. implemented scanner.next

    Jia Wu committed Jan 16, 2012
  16. @practicingruby

    Add scanner test

    practicingruby committed Jan 16, 2012
  17. @practicingruby

    initial scanner test

    practicingruby committed Jan 16, 2012
Commits on Jan 16, 2012
  1. @practicingruby
  2. @practicingruby

    Add some sample data

    practicingruby committed Jan 16, 2012
Commits on Jan 14, 2012
  1. @practicingruby

    Minor cleanup

    practicingruby committed Jan 14, 2012
  2. @practicingruby
  3. @practicingruby

    Remove example

    practicingruby committed Jan 14, 2012
  4. implement overflow behavior

    Jia Wu committed Jan 14, 2012
  5. @practicingruby

    Add overflow tests

    practicingruby committed Jan 14, 2012
  6. implement decrement_cell_value

    Jia Wu committed Jan 14, 2012
  7. @practicingruby
  8. implement cell_value setter

    Jia Wu committed Jan 14, 2012
  9. @practicingruby

    cell_value setter tests

    practicingruby committed Jan 14, 2012
Something went wrong with that request. Please try again.