It does not make sense to set local variables that you don't use; you should have gotten a Ruby warning about this. If you want to use the value of "state" between methods, you need an instance variable (which is slower, that's why I try to keep it all in the scan_tokens method.)