raml-org/raml-js-parser — pull request #74 by dmartinezg (2013-11-08 17:29:14+00:00)
Title: Async parser

- Adds feature flags
- Makes parser truly async
- Allows file resolution to be injected
- Removed functions in validator and RAML namespace
- Removed resources() method in validator, which should not be used at all, ever, because it was evil

To inject file resolution the parser can be called:
```javascript
var raml = require('./lib/raml.js');
var q = require("q");

var callbackCalled = false;

var injectedReader = new raml.FileReader(function() { callbackCalled = true; return q.fcall(function(){return "#%RAML 0.8\ntitle: Hi"}) } );

raml.loadFile('text3.yml', { reader: injectedReader } ).then( function(data) {
console.log(JSON.stringify(data, null, 1));
}, function(error) {
console.log('Error parsing: ');
console.log(error);
console.log(error.stack);
});
```