teragrep / pth_03

Data Processing Language (DPL) parser
GNU Affero General Public License v3.0
0 stars 5 forks source link

replace does not support replacing multiple values #29

Closed 51-code closed 3 months ago

51-code commented 3 months ago

Describe the bug

See PTH-10 issue #218.

Grammar allows writing just one x WITH y at the same time.

Expected behavior

Should allow replacing multiple values like so: x WITH y, a WITH b.

How to reproduce

Run a query like | replace x WITH y, a WITH b IN z. Surprisingly it will go through without an error. It ends parsing after the comma, perhaps because everything after that is deemed optional in the grammar. This, however, will result in an error in PTH-10 side when the parse tree is visited.

Screenshots

Software version

PTH-03: 5.11.0

Desktop (please complete the following information if relevant):

Additional context

Grammar seems to support writing x WITH y WITH z which probably shouldn't be allowed.

51-code commented 3 months ago

Ran into an issue with commas when solving this. Commas do not work in replace at all right now so there is also an issue with the IN instruction. It parses ... IN a, b as two fields "a," and "b".