Git Product home page Git Product logo

esprima-ast-visitor's Introduction

๐ŸŒˆ H3ll0 W0rld ๐Ÿ‘‹

I'm a backend software engineer passionate about Go, AWS, serverless, cybersecurity, algorithms, compilers, infrastructure-as-code, musicals, hiking, Factorio, and XKCD. I've also worked with Python, Java, C#, machine learning, pianos, and trumpets ๐ŸŽบ

If you want to get ahold of me, LinkedIn works well.

Parsers

I seem to be enthralled by tedious, recursive, low-level work that might bore others to death - like processing an abstract syntax tree from a compiler.

I highly recommend LOLCODE for your next project. For example, need a Fibonacci generator?

HAI
BTW This program prints every fibonacci number in a specified range
BTW Austin Byers, 2013

	U SEEZ "I will find your fib numbers!\nWhere do U want to start?"
	GIMMEH start_num

	U SEEZ "Where do U want to end?"
	GIMMEH end_num

	OBTW fibonacci is our main variable
		 second_fib is the fib number right before fibonacci 
	TLDR
	I HAS A fibonacci ITZ 1 
	I HAS A second_fib ITZ 1

	I HAS A printflag ITZ FAIL   BTW This means False
	I HAS A finishflag ITZ FAIL

	HOW DUZ I get_next_fib ?
		I HAS A tempvar ITZ fibonacci
		LOL fibonacci IZ NOW fibonacci PLUS second_fib
		LOL second_fib IZ NOW tempvar
	IF U SAY SO
...

Still more readable than Haskell.

esprima-ast-visitor's People

Contributors

austinbyers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esprima-ast-visitor's Issues

Problem encountered when running the tool

Hi,
I parsed the following code with esprima. However, when I tried to call visitor.objectify() on the ast, it givens the error in the following screenshot.

const path = require ( 's' ) ; module . exports = { process ( src , filename ) { return template; } , }

image

Thanks!

How should we install it?

Hi, I want to use your library.

But I'm not a Python developer in fact. I just know that I have to use pip install x to install libraries. I tried yours and it did not get installed.

What should I do? Can you modify the README to include installation too? Thanks.

Parsing ExpressionStatement

Hi,
First of all I should thank you for accepting my feature request. :-)
Its all good and working, the current problem I have right now is 'Parsing ExpressionStatement'!

The problem is that ExpressionStatements could have another kind of Expression or Statement in them, how can I parse them and find which Expression or Statement does it contain?

What am I trying to achieve?

Im trying to parse the target code when some specific conditions met, add a ExpressionStatement... so far so good. But before adding the ExpressionStatement I need to check for the dependency of that Expression, for example:
var test= 10;
afunction(1, "a", test);

I need to that 'test' is a dependency of afunction, so in order to make afunction work i need to add 'test' variable too.
I hope im clear enough, the whole idea is how to check for dependency of an expression? and as return get the ast node of each of those dependencies?

Thank you

Modifying AST tree

Hello,

Im visiting the AST tree generated by acorn, it works perfectly but i want to write down the generated tree that im visiting to a file to use esgenerate to make new .js file.

thanks

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.