/**
 * Gray Matter
 * Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
 * Licensed under the MIT license.
 */

'use strict';

// node_modules
var YAML = require('js-yaml');
var coffee = require('coffee-script');
var toml = require('toml');


// The module to export
var parse = module.exports = {};


parse.yaml = function(src) {
  return YAML.load(src);
};

parse.json = function(src) {
  return JSON.parse(src);
};

parse.coffee = function(src, options) {
  options = options || {};
  try {
    return coffee['eval'](src, options);
  } catch (e) {
    console.warn('Could not parse coffee-script:', e);
  }
};

parse.toml = function(src) {
  try {
    return toml.parse(src.trim());
  } catch (e) {
    console.warn('Count not parse toml:' + src, e);
  }
};

@@ -184,79 +184,29 @@
 ml')
-;%0Avar coffee = require('coffee-script');%0Avar toml = require('
+,%0A  coffee,%0A  
 toml
-')
 ;%0A%0A
-%0A
 // T
@@ -444,16 +444,76 @@
  %7C%7C %7B%7D;%0A
+  if (!coffee) %7B%0A    coffee = require('coffee-script');%0A  %7D%0A
   try %7B%0A
@@ -628,24 +628,24 @@
 e);%0A  %7D%0A%7D;%0A%0A
-
 parse.toml =
@@ -661,16 +661,63 @@
 (src) %7B%0A
+  if (!toml) %7B%0A    toml = require('toml');%0A  %7D%0A
   try %7B%0A

Fix the CoffeeScript and TOML dependency injection