shelljs-transpiler icon indicating copy to clipboard operation
shelljs-transpiler copied to clipboard

Unable to parse script

Open sasgithub opened this issue 7 years ago • 3 comments

First attempted use of sh2js and it gives me;

Unable to parse script Line 26, col 26: 25 | function isint {

26 | expr $1 + 0 >/dev/null 2>&1 && return 0 ^ 27 | return 1 Expected "}" Please include this output in the bug report

The "}" it's looking for is on the next line;

# isint -  is integer?
function isint {
  expr $1 + 0 >/dev/null 2>&1 && return 0
  return 1
}
#

I agree that the above is ugly.

sasgithub avatar Feb 05 '18 21:02 sasgithub

Do simpler functions work? How about:

function sayHello {
  echo "hello"
  return 0
}

This is probably because we don't support && and || yet (issue #19). I haven't worked on this project in a while unfortunately. Let me know if you're interested in adding support for that feature.

nfischer avatar Feb 06 '18 00:02 nfischer

It does indeed work for simple functions.

If I get some time I will take a look at what's required to add && and ||.

Is there a list of what all is left to implement?

sasgithub avatar Feb 06 '18 14:02 sasgithub

If I get some time I will take a look at what's required to add && and ||.

Cool! I'll post some thoughts on #19.

Is there a list of what all is left to implement?

Unfortunately no. I've filed github issues for the most obvious missing features. I would recommend playing with the web playground to get a feel for the state of the project.

nfischer avatar Feb 07 '18 00:02 nfischer