Are there any docs / examples of writing a Typescript plugin?    For the last time I am very inspired with the idea of bringing Typescript into my projects. However, currently I see this is not possible because of my failed attempts to find any docs...
I often need to rename variables when refactoring code, which I currently do in a somewhat hacky way using regexs - I end up having to come with silly text workaround workarounds for the lack of actual structure, eg, rename 'req' to 'requ...
This is related to this other question:  Last evaluated expression in Javascript  But I wanted to provide more details about what I wanted to do and show how I finally solved the problem as some users requested in the comments.  I have snippets of Ja...
How do you build an AST (Abstract Syntax Tree) for left-associative operators using PEG.js?  I've tried to write some code based on the information I found on the internet, but I seem to have made a mistake.  The code I wrote generates an incorre...
I'm implementing a pretty-printer for a JavaScript AST and I wanted to ask if someone is aware of a "proper" algorithm to automatically parenthesize expressions with minimal parentheses based on operator precedence and associativity. I ha...
var foo = (function(){   var x = "bar";   return function(){     console.log(x);   }; })();  console.log(foo.toString()); // function() {console.log(x);} (foo)(); // 'bar' eval('(' + foo.toString()+')()')); // error: x...
https://astexplorer.net/#/gist/ad90272020dd0bfb15619d93cca81b66/28d3cf7178271f4f99b10bc9352daa873c2f2b20  // file var a = "a" // what if this is import statement?  // jscodeshift export default (file, api) => {   const j = api.jscodeshift;...
I'd like to use JavaScript to parse an html document into an abstract syntax tree, where each node also includes start and end line numbers (and hopefully also character positions) for each node.  Are there any existing solutions that can do this...
I'm looking for a library in scala that generates JavaScript from an abstract syntax tree. I want to use it in an compiler that generates JavaScript at the end and I don't want to implement the pretty printing part myself....
I'm implementing a mutation testing tool for JavaScript. AST is modified and test cases are executed against the modified code. After running the test cases, I want to restore the modified AST to the original one so that I can repeat the mutation...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.