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

Unable to parse script #34

Open
sasgithub opened this issue Feb 5, 2018 · 3 comments
Open

Unable to parse script #34

sasgithub opened this issue Feb 5, 2018 · 3 comments

Comments

@sasgithub
Copy link

sasgithub commented Feb 5, 2018

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.
@nfischer
Copy link
Owner

nfischer commented Feb 6, 2018

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.

@sasgithub
Copy link
Author

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?

@nfischer
Copy link
Owner

nfischer commented Feb 7, 2018

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.

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

No branches or pull requests

2 participants