lib/HalModuleParser.js
function(filename, callback) {
		var fileInfo = {
			filename: filename
		};

		var that = this;
		var allDone = pipeline([
			function() {
				return that._loadFile(filename);
			},
			function(fileBuffer) {
				fileInfo.fileBuffer = fileBuffer;

				return that.parseBuffer(fileInfo);
			}
		]);

		if (callback) {
			when(allDone).then(
				function(info) {
					callback(info, null);
				},
				function(err) {
					callback(null, err);
				});
		}

		return allDone;
	}
function(filename, callback) {
		var fileInfo = {
			filename: filename
		};

		var that = this;
		var allDone = pipeline([
			function() {
				return that._loadFile(filename);
			},
			function(fileBuffer) {
				fileInfo.fileBuffer = fileBuffer;

				return that.parseBuffer(fileInfo);
			}
		]);

		if (callback) {
			when(allDone).then(
				function(info) {
					callback(info, null);
				},
				function(err) {
					callback(null, err);
				});
		}

		return allDone;
	}
function ( filename , callback ) { var fileInfo = { filename : filename } ; var that = this ; var allDone = pipeline ( [ function ( ) { return that . _loadFile ( filename ) ; } , function ( fileBuffer ) { fileInfo . fileBuffer = fileBuffer ; return that . parseBuffer ( fileInfo ) ; } ] ) ; if ( callback ) { when ( allDone ) . then ( function ( info ) { callback ( info , null ) ; } , function ( err ) { callback ( null , err ) ; } ) ; } return allDone ; }
/*
given a file / callback, goes and reads out all the info!

meant to be multiply-re-entrant / thread safe

@param filename
@param callback
@returns {*}
/ * given a file / callback goes and reads out all the info!