]> git.proxmox.com Git - mirror_ovs.git/commit
expr: Fine-tune parser error message for common typo.
authorBen Pfaff <blp@ovn.org>
Sun, 31 Jul 2016 17:18:40 +0000 (10:18 -0700)
committerBen Pfaff <blp@ovn.org>
Mon, 8 Aug 2016 18:00:39 +0000 (11:00 -0700)
commit76da94b5bd33f059be5327d96da14072fb32c0d5
tree65baccda785d02d54eb2db3b77013a2045a53f01
parent13c1637f5ba8efc95b63af74b9ae9a3abd884414
expr: Fine-tune parser error message for common typo.

It's easy to type "=" in place of "==" in an expression but the expression
parser's error message was far from clear.  For multibit numeric fields,
it said:
    Explicit `!= 0' is required for inequality test of multibit field
    against 0.
For string fields, the parser treated such an expression as "<name> != 0"
and thus it said:
    String field <name> is not compatible with numeric constant.

This improves the error message in each case to:
    Syntax error at `=' expecting relational operator.
which I hope to be clear.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
ovn/lib/expr.c
tests/ovn.at