Opened 11 years ago

Closed 11 years ago

#747 closed defect (fixed)

Parsing subtraction bug

Reported by: Dimitar Misev Owned by: Veranika Liaukevich
Priority: major Milestone: 9.0.x
Component: qlparser Version: development
Keywords: Cc: Peter Baumann
Complexity: Medium

Description

This fails

$ rasql -q 'select 2-1 from mr2 as c' --out string
Executing retrieval query...rasdaman error 300: Parsing error 300 in line 1, column 9: Unexpected name -1.

while this works

$ rasql -q 'select 2- 1 from mr2 as c' --out string
  Result element 1: 1

Both should work in the same way, it seems like when the '-' is exactly in front of the argument with no whitespace, it is wrongly considered as the unary minus sign.

Change History (4)

comment:1 by Veranika Liaukevich, 11 years ago

Status: newaccepted

This minus is considered as a part of negative integer '-1' by Lex, so I think it would be better to move all 'unary minus' logic to Bison part.

comment:2 by Peter Baumann, 11 years ago

before doing that let us have a chat to find out what this exactly entails.

comment:3 by Veranika Liaukevich, 11 years ago

We can delegate unary minus operation to some other bison rule (e.g. intLitExp, which is now useless in the way it is), and then replace IntegerLit with intLitExp in other rules.

I have just checked it, at least systemtests passed without failure.

comment:4 by Veranika Liaukevich, 11 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.