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
// escodegen has a fucked up API for attaching comments | |
// https://github.com/estools/escodegen/issues/10 | |
var esprima = require("esprima"); | |
var es = require("escodegen"); | |
var ast = esprima.parse( | |
'//comment here\nvar answer = 42;', | |
{range: true, tokens: true, comment: true}); | |
// attaching comments is a separate step |
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
/* | |
Written by Peter O. | |
Any copyright to this work is released to the Public Domain. | |
In case this is not possible, this work is also | |
licensed under Creative Commons Zero (CC0): | |
https://creativecommons.org/publicdomain/zero/1.0/ | |
*/ |