       return parseInt(num)
 
     #string
-    if @expects '"'
-      @forwards '"'
+    if @forwards_if '"'
       str = ''
       str += @code[@pos++] until @expects '"'
       @forwards '"'
       return str
 
-    #nil
-    if @expects 'nil'
-      @forwards_str 'nil'
-      return nil
-
-    #t
-    if @expects 't'
-      @forwards 't'
-      return t
+    return nil if @forwards_if 'nil'
+    return t if @forwards_if 't'
 
     #var
     return new Symbol(@symbol())

    @pos == @code.length

  expects: (pattern, throwing = false) ->
    valid = @code[@pos] &&
      (pattern instanceof RegExp and pattern.test @code[@pos]) ||
      pattern == @code[@pos...@pos + pattern.length]
    if !valid && throwing
      throw "unexpected \"#{@code[@pos]}\", expects \"#{pattern}\""



  forwards: (pattern) ->
    @expects pattern, true
    @code[@pos]
    @pos += if pattern instanceof RegExp then 1 else pattern.length

  forwards_if: (pattern) ->
    @forwards pattern if @expects pattern

  atom: ->
    #number
