forked from eslint/archive-website
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update parser demo for espree 3.0 (fixes eslint#196)
- Loading branch information
Jamund Ferguson
committed
Feb 15, 2016
1 parent
6b0a0b9
commit f40fd5d
Showing
5 changed files
with
150 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
// requires | ||
var espree = require('espree'); | ||
|
||
exports.parse = function(config) { | ||
var code = editor.value; | ||
exports.parse = function(code, config) { | ||
var ast = espree.parse(code, config); // throws... | ||
return JSON.stringify(ast, null, ' '); | ||
}; | ||
}; | ||
|
||
exports.getVersion = function() { | ||
return espree.version; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters