ninetwozero / gradle-to-js

A quick & dirty Gradle build file to JavaScript object parser
Apache License 2.0
47 stars 21 forks source link

Skip function definitions #3

Closed geof90 closed 8 years ago

geof90 commented 8 years ago

Adds the ability to skip function definitions. Originally, something like this

def fibonacci (int i) {
  if (i <= 2) {
    return 1;
  } else {
    return fibonacci(i - 1) + fibonacci(i - 2);
  }
}

would confuse the parser because after seeing the def keyword, it would try to search for an equals sign and we end up skipping a lot of things unintentionally.

joekim commented 8 years ago

+1 I had this issue with my gradle deployment process to code push.

karllindmark commented 8 years ago

This is great, thanks @geof90! I had just one minor comment (left it in the inline code view), and then it should be ready for merge!

...speaking of which, I reckon this should be 0.1.1?

geof90 commented 8 years ago

I'll leave versioning and publishing to NPM up to you @karllindmark :)

karllindmark commented 8 years ago

Version 0.1.1 has now been published to NPM - thanks once again @geof90! :))

http://i.giphy.com/l0HlPVMqlCCfMrYpW.gif