Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow saving and loading in ast format #106

Merged
merged 6 commits into from Aug 7, 2014
Merged

Conversation

brettlangdon
Copy link
Contributor

@jimfleming, this was my attempt at trying to support loading/saving as AST, I dont expect it to be perfect, but a random attempt.

tries to take care of #102

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 33d7449 on brettlangdon:ast into a18921c on rdio:master.

@jimfleming
Copy link
Contributor

Nice, I like it, personally. It should be fairly easy to integrate with atom with this.

@brettlangdon
Copy link
Contributor Author

@jimfleming yeah, I think I can get my emacs plugin working pretty easily with it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.43%) when pulling dc21fad on brettlangdon:ast into a18921c on rdio:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.43%) when pulling bd8c2a2 on brettlangdon:ast into a18921c on rdio:master.

@@ -90,6 +92,10 @@ function handleJavascript(fullPath, original) {
var js = original;
var relativePath = path.relative(process.cwd(), fullPath);

if (argv['--ast']) {
js = jsfmt.parseAST(JSON.parse(js));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a try/catch here or just let it error?

@jimfleming
Copy link
Contributor

One comment above but it looks good to me. The action-word is more clear too (--save-ast).

@brettlangdon
Copy link
Contributor Author

@jimfleming think this is good, I added try/catch around ast json parsing.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.43%) when pulling 5607fdc on brettlangdon:ast into a18921c on rdio:master.

@jimfleming
Copy link
Contributor

👍 Thanks!

jimfleming added a commit that referenced this pull request Aug 7, 2014
allow saving and loading in ast format
@jimfleming jimfleming merged commit 0fa7953 into rdio:master Aug 7, 2014
@brettlangdon brettlangdon deleted the ast branch August 7, 2014 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants