Skip to content

Incorrect parsing of input when "!=" operator is used #1

@prakashsurya

Description

@prakashsurya

When using the != operator with the filter or pyfilter commands, the lexer will incorrectly split that operator into two tokens, instead of grouping the two characters into a single token. Specifically, it will split != into ! and = tokens, when it should return a single != token.

Here's a concrete example:

> spa | filter obj.spa_name != "rpool" | pp

In this example, the expectation is for the following to occur:

  1. spa is called without any arguments
  2. filter is called with arguments: obj.spa_name != "rpool"
  3. pp is called without any arguments

Unfortunately, due to the bug in the lexer, this does not happen. What does happen is the following:

  1. spa is called without any arguments
  2. filter is called with arguments: obj.spa_name
  3. A suprocess is created to execute: = "rpool" | pp

This is because != is split into the tokens ! and =, and then we interpret the ! special, as it is used to denote piping into a subprocess rather than piping into an SDB command.

Metadata

Metadata

Assignees

Labels

design bugSomething isn't working due to the current design

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions