+{join} = require 'path'
+{existsSync} = require 'path'
+
 class HulkHogan
 	parsePartials : (source)->  # Return list of patial filenames in the source.
 		{scan} = require 'hogan.js'

		partial_files = @parsePartials source

		if partial_files.length
			@_makePartials partials, partial_files, options.root, options.defaultEngine

		return ->
			return compiled.render options, partials

	
	__express : (filename, options, callback) ->
		# add support for Express 3.x templating scheme
		# in Express use like this:

					sublist = @parsePartials source

					if sublist.length
						@_makePartials partials, sublist
		
	render : (source, context={})->  # Shortcut for @compile(source, options)()
		do @compile source, context

	compile : (source='', options={})->
		@root = options.root if options.root
		@ext = options.defaultEngine if options.defaultEngine

		hogan = require 'hogan.js'
		compiled = hogan.compile source

