 #     paren '(hi)' => "(hi)"
 #
 paren = (string) ->
-    str = string.toString()
-    if str.substr(0, 1) == '(' and str.substr(-1, 1) == ')'
-      str
-    else
-      "(#{str})"
+  str = string.toString()
+  if str.substr(0, 1) == '(' and str.substr(-1, 1) == ')'
+    str
+  else
+    "(#{str})"
 
 # `strRepeat()`  
 # Repeats a string a certain number of times.

#     strRepeat('.', 3) => "..."
#
strRepeat = (str, times) ->
    (str for i in [0...times]).join('')

# `trim()` *and friends*  
# String trimming functions.

## Code snippet helper
# A helper class to deal with building code.

CoffeeScript = @CoffeeScript or require 'coffee-script'

class Code
  constructor: ->
    @code = ''

  add: (str) ->
    @code += str.toString()
    @

  scope: (str, level=1) ->
    indent = strRepeat("  ", level)
    @code  = rtrim(@code) + "\n"
    @code += indent + rtrim(str).replace(/\n/g, "\n#{indent}") + "\n"
    @

  toString: ->
    @code

# ## String helpers
# These are functions that deal with strings.
