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

calls to commands starting with digits #37

Open
cancerberoSgx opened this issue Jul 3, 2019 · 2 comments
Open

calls to commands starting with digits #37

cancerberoSgx opened this issue Jul 3, 2019 · 2 comments

Comments

@cancerberoSgx
Copy link

Seems it will fail if when calling a command which name start with a digit. probably around :

CmdName = (~keyword Bashword #(~alnum))

BTW which grammar syntax are you using ?

#!/bin/bash
ang=1
while [ $ang -le 360 ]
	do
	echo "ang=$ang"
	if [ $ang -gt 180 ] 
		then
		newang=`expr $ang - 360`
	else
		newang=$ang
	fi
	3Drotate tilt=30 pan=$newang zoom=-1.5 mandril.jpg $tmp
done
	
Unable to parse script
Line 12, col 3:
  11 | 	fi
> 12 | 	3Drotate tilt=30 pan=$newang zoom=-1.5 mandril.jpg $tmp
         ^
  13 | 
Expected not an alpha-numeric character
Please include this output in the bug report
Please file a bug report at git+https://github.com/nfischer/shelljs-transpiler.git
```
@nfischer
Copy link
Owner

nfischer commented Jul 3, 2019

BTW which grammar syntax are you using ?

It's PEG. We use the Ohm library: https://github.com/harc/ohm, https://ohmlang.github.io/

Seems it will fail if when calling a command which name start with a digit. probably around

Seems like a bug in the Bashword definition. echo 3three parses as echo(3, 'three') instead of echo('3three'). Bugfixes are encouraged, I don't actively work on this project anymore.

@cancerberoSgx
Copy link
Author

Aja, unfortunately I'm not currently using it, but if that's the case in the future I will. Also just a comment seems to be a descent grammar for bash but not peg but antlr https://github.com/antlr/grammars-v4, just in case. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants