Opened 3 years ago

Closed 3 years ago

#747 closed defect (fixed)

Parsing subtraction bug

Reported by: dmisev Owned by: vliaukevich
Priority: major Milestone: 9.0.x
Component: qlparser Version: development
Keywords: Cc: pbaumann
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 Changed 3 years ago by vliaukevich

  • Status changed from new to accepted

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 Changed 3 years ago by pbaumann

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

comment:3 Changed 3 years ago by vliaukevich

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 Changed 3 years ago by vliaukevich

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.