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

ERROR: -g user:main: Syntax error: Operator expected #122

Open
joncorrin opened this issue Apr 25, 2020 · 7 comments
Open

ERROR: -g user:main: Syntax error: Operator expected #122

joncorrin opened this issue Apr 25, 2020 · 7 comments

Comments

@joncorrin
Copy link

I keep getting the following error when trying to convert my xsd file:
ERROR: -g user:main: Syntax error: Operator expected

Seems to be a Prolog issue. Any idea what could be wrong? The XSD appears to be valid.

https://xilo-s3.s3-us-west-2.amazonaws.com/ezauto.xsd

@nachtigall-83
Copy link

Similar problem here:
With one xsd it's working fine, with the other I get a json file with no content.

With --debug-info it shows:
ERROR: -g user:main: false

With --trace it shows:
ERROR: -g user:main: Undefined procedure: chr_leash/1
ERROR: In:
ERROR: [11] chr_leash(none)
ERROR: [10] main([space(remove),...|...],['C:\Users\taascru2\AppData\Roaming\npm\\node_modules\xsd2json\lib-pl\cli.exe','AccountRead.xsd']) at c:/users/taascru2/appdata/roaming/npm/node_modules/xsd2json/lib-pl/cli.pl:107
ERROR: [8] catch(user:main,error(existence_error(procedure,...),context(...,_30256)),'$toplevel':true) at c:/program files/swipl/boot/init.pl:386
ERROR: [7] catch_with_backtrace(user:main,error(existence_error(procedure,...),context(...,_30314)),'$toplevel':true) at c:/program files/swipl/boot/init.pl:436
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

Same happens if I trace or debug the xsd that normally works. With --debug-info or --trace I get the error messages and an empty json. After deleting the empty file and rerun the command without flags, it works again.

For the second xsd that never works I get no hint what could be wrong with it. It has a dependency to another xsd that has a dependency to a third xsd. Could this be the reason?

Thanks in advance for your help.

@fnogatz
Copy link
Owner

fnogatz commented Jun 26, 2020

With --debug-info it shows:
ERROR: -g user:main: false

Hm, we should first try to get --debug-info working. Have you installed xsd2json as a global module (npm install -g xsd2json), or as a dependency in your local package.json?

@nachtigall-83
Copy link

I installed it as a global module.

@fnogatz
Copy link
Owner

fnogatz commented Jun 29, 2020

What version of SWI-Prolog are you using? (simply call swipl --version)

@nachtigall-83
Copy link

SWI-Prolog version 8.0.3 for x64-win64

@fnogatz
Copy link
Owner

fnogatz commented Jun 29, 2020

I think the problem here is the Windows OS. Actually, I never tried xsd2json on a Windows machine, but I see several possibilities for issues here. As I don't have a Windows machine at hand, I unfortunately can't provide an ad-hoc solution.

@joncorrin, are you using a Windows machine, too?

@nachtigall-83
Copy link

I finally managed to install it on my ancient Mac, but not as a global module. Running with debug-info gives me a json file with this content (but nothing in the terminal):
#xsd2json
1.12.16
#SWI-Prolog
SWI-Prolog version 7.6.4 for x86_64-darwin15.6.0
#npm
6.14.5
#node
v12.18.1

Tracing option seems to work, it gives me a huge amount of output in the Terminal. I didn't have the time to check this, but last line is:
ERROR: -g main: Domain error: 'chr_port' expected, found 'none'

This may give you a hint?

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

3 participants