lib/smurf/javascript.rb
def peek(aheadCount=1)
      history = []
      aheadCount.times { history << @input.getc }
      history.reverse.each { |chr| @input.ungetc(chr) }
      return history.last.chr
    end
def peek(aheadCount=1)
      history = []
      aheadCount.times { history << @input.getc }
      history.reverse.each { |chr| @input.ungetc(chr) }
      return history.last.chr
    end
def peek ( aheadCount = 1 ) history = [ ] aheadCount . times { history << @input . getc } history . reverse . each { | chr | @input . ungetc ( chr ) } return history . last . chr end
Get the next character without getting it.
Get the next character without getting it .