 # Leading newlines would introduce an ambiguity in the grammar, so we
 # dispatch them here.
 re::remove_leading_newlines: ->
-  this.tokens.shift() if this.tokens[0][0] is 'TERMINATOR'
+  @tokens.shift() if @tokens[0][0] is 'TERMINATOR'
 
 # Some blocks occur in the middle of expressions -- when we're expecting
 # this, remove their trailing newlines.
 re::remove_mid_expression_newlines: ->
-  this.scan_tokens (prev, token, post, i) =>
+  @scan_tokens (prev, token, post, i) =>
     return 1 unless post and EXPRESSION_CLOSE.indexOf(post[0]) >= 0 and token[0] is 'TERMINATOR'
-    this.tokens.splice(i, 1)
+    @tokens.splice(i, 1)
     return 0
 
 # Make sure that we don't accidentally break trailing commas, which need
 # to go on the outside of expression closers.
 re::move_commas_outside_outdents: ->
-  this.scan_tokens (prev, token, post, i) =>
-    this.tokens.splice(i, 1, token) if token[0] is 'OUTDENT' and prev[0] is ','
+  @scan_tokens (prev, token, post, i) =>
+    @tokens.splice(i, 1, token) if token[0] is 'OUTDENT' and prev[0] is ','
     return 1
 
 # We've tagged the opening parenthesis of a method call, and the opening

      # If the tag is already in our debt, swallow it.
      if debt[inv] > 0
        debt[inv] -= 1
        this.tokens.splice(i, 1)
        return 0
      else
        # Pop the stack of open delimiters.

  stack: []
  debt:  {}
  (debt[key]: 0) for key, val of INVERSES
  @scan_tokens (prev, token, post, i) =>
    tag: token[0]
    inv: INVERSES[token[0]]
    # Push openers onto the stack.
