 # scope, and indentation level.
 exports.Base = class Base
 
-  constructor: ->
-    @tags = {}
+  constructor: -> @tags = {}
 
   # Common logic for determining whether to wrap this node in a closure before
   # compiling it, or to compile directly. We need to wrap if this node is a

    @properties.push prop
    this

  hasProperties: ->
    !!@properties.length

  # Some boolean checks for the benefit of other nodes.

  isArray: ->
    @base instanceof Arr and not @properties.length

  isObject: ->
    @base instanceof Obj and not @properties.length

  isComplex: ->
    @base.isComplex() or @hasProperties()

  isAtomic: ->
    for node in @properties.concat @base
      return no if node.soakNode or node instanceof Call
    yes

  isAssignable: ->
    @hasProperties() or @base.isAssignable()

  assigns: (name) ->
    not @properties.length and @base.assigns name

  makeReturn: ->
    if @properties.length then super() else @base.makeReturn()

  # The value can be unwrapped as its inner node, if there are no attached
  # properties.
  unwrap: ->
    if @properties.length then this else @base

  # Values are considered to be statements if their base is a statement.
  isStatement: (o) ->
    not @properties.length and @base.isStatement o

  isSimpleNumber: ->
    @base instanceof Literal and SIMPLENUM.test @base.value

  # A reference has base part (`this` value) and name part.
  # We cache them separately for compiling complex expressions.

# The **Push** creates the tree for `array.push(value)`,
# which is helpful for recording the result arrays from comprehensions.
Push =
  wrap: (name, exps) ->
    return exps if exps.isEmpty() or last(exps.expressions).containsPureStatement()
    exps.push new Call \
      new Value(new Literal(name), [new Accessor new Literal 'push']), [exps.pop()]

#### Closure

