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

@JSON cant have negative number #475

Open
mathiasrw opened this issue Dec 1, 2015 · 2 comments
Open

@JSON cant have negative number #475

mathiasrw opened this issue Dec 1, 2015 · 2 comments

Comments

@mathiasrw
Copy link
Member

When having minus in front of a (number) value the parser cannot handle the JSON

> alasql "SELECT * FROM @[{delay:5},{delay:-7}]"
[Error: Parse error on line 1:
...M @[{delay:5},{delay:-7}]
-----------------------^
Expecting 'COLON', got 'COLONDASH']

Workaound in the moment: put ' around the negative numbers ('-7')

@mathiasrw mathiasrw added the ! Bug label Dec 1, 2015
@agershun
Copy link
Member

agershun commented Dec 1, 2015

@mathiasrw Yes,now you need to put () around any expression inside JSON object. This is a parser problem, because it does not know how to handle this expression:

    @{a:@{b}}

is this the expression inside expression or this is a sub-json object. Probably, we have to leave it as it is.

@mathiasrw
Copy link
Member Author

Good to see you again.

I get it - its because we consider -7 to be an expression... and they need to be wrapped in ( )

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