 
 parse = (code) ->
 	try
-		esprima.parse code
+		esprima.parse code,
+			range: true
 	catch err
 		{ 'Parse error': err }
+		{}
 
 
 display = (data) ->
-	try
-		data = JSON.stringify(data, null, 2) unless typeof data == 'string'
-	catch err
-		data = { 'JSON error': err }
-	output.setValue(data)
+	# try
+	# 	data = JSON.stringify(data, null, 2) unless typeof data == 'string'
+	# catch err
+	# 	data = { 'JSON error': err }
+	output.setValue(JSON.stringify(data, null, 2))
 	output.clearSelection()
+
 
 
 Syntax =

		when 'ObjectExpression'
			for prop in block.properties
				treeify prop.value, scope
		when 'VariableDeclarator'
			treeify block.id, scope, true
			treeify block.init, scope

editor.getSession().setMode 'ace/mode/javascript'
editor.setShowPrintMargin false
editor.getSession().on 'change', (event) ->
	#try
		display treeify(parse editor.getValue()).toObject()
	#catch err
	#	console.error err

output = ace.edit 'output'
output.setTheme 'ace/theme/monokai'
