 # Syntax printing to HTML
 
 toHtml = (highlighted) ->
-  crawl highlighted, (word, symbol, parent) ->
-    (word.ws or '') + colorize(theme[labelOf word, parent], symbol)
-
-labelOf = (word, parent) ->
-  word.malformed and 'malformed' or
-    parent?.malformed and word.symbol in allDelims and 'malformed' or
-      word.label or 'normal'
+  crawl highlighted, (node, symbol, parent) ->
+    colorize(theme[labelOf node, parent], symbol)
+
+print = (ast) ->
+  collapse crawl ast, (node, symbol) -> symbol
+
+labelOf = (node, parent) ->
+  node.malformed and 'malformed' or
+    parent?.malformed and node.symbol in allDelims and 'malformed' or
+      node.label or 'normal'
 
 collapse = (nodes) ->
   collapsed = ""

      ctx.addToDeferredNames {name: symbol, type: type}
      nameTranslate ctx, atom, symbol, type
    else
      console.log "deferring in rhs for #{symbol}"
      ctx.doDefer atom, symbol
      translation: deferredExpression()


      rhs = fake_()
    definitionPairCompile ctx, lhs, rhs)

  shouldRecompile = yes
  while shouldRecompile
    compiledPairs = join compiledPairs, compileDeferred ctx
    shouldRecompile = _notEmpty ctx.deferredBindings()
    resolveDeferredTypes ctx
  deferDeferred ctx

  filter _is, compiledPairs
