 astizeExpressionWithWrapper = (source) ->
   parentize astize (tokenize "(#{source})", -1), -1
 
+finalizeTypes = (ctx, ast) ->
+  visitExpressions ast, (expression) ->
+    expression.tea = highlightType substitute ctx.substitution, expression.tea
 
 # end of API
 

exports.astizeExpression = astizeExpression
exports.astizeExpressionWithWrapper = astizeExpressionWithWrapper
exports.syntaxedExpHtml = syntaxedExpHtml

# exports.compileModule = (source) ->
#   """

syntaxedExpHtml = (string) ->
  collapse toHtml astize tokenize string

syntaxedType = (type) ->
  collapse toHtml typeCompile new Context, type

compileTopLevel = (source) ->
  {js, ast, ctx} = compileToJs topLevel, "(#{source})", -1, -1
  (finalizeTypes ctx, ast)
  {js, ast: ast, types: typeEnumaration ctx}

compileTopLevelAndExpression = (source) ->
  topLevelAndExpression source
