From d38e606a5028aebf59d7bf8fa81427030d8bea4e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 9 Nov 2014 18:44:12 -0500 Subject: [PATCH] TW-1434 - TW-1434 Parser issue in description.contains (thanks to Ralph Bean). --- ChangeLog | 1 + src/CLI.cpp | 17 +++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index f73174f46..7a47b45bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -171,6 +171,7 @@ - TW-1424 Using a date of '1824days' (in the future) fails (thanks to Black Ops Testing). - TW-1428 Add support for color.uda.. rules. +- TW-1434 Parser issue in description.contains (thanks to Ralph Bean). - TW-1436 Parser hangs when multiple slashes are used. - TW-1437 taskd.trust has a bad default value. - TW-1441 task import continues happily if filename doesn't exist. diff --git a/src/CLI.cpp b/src/CLI.cpp index 7309b4f27..e7d0128d1 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -1128,6 +1128,7 @@ void CLI::desugarFilterAttributeModifiers () A op ("argAttmod", ""); op.tag ("FILTER"); + op.tag ("OP"); A rhs ("argAttMod", ""); rhs.tag ("FILTER"); @@ -1135,77 +1136,66 @@ void CLI::desugarFilterAttributeModifiers () if (modifier == "before" || modifier == "under" || modifier == "below") { op.attribute ("raw", "<"); - op.tag ("OP"); rhs.attribute ("raw", value); rhs.tag ("LITERAL"); } else if (modifier == "after" || modifier == "over" || modifier == "above") { op.attribute ("raw", ">"); - op.tag ("OP"); rhs.attribute ("raw", value); rhs.tag ("LITERAL"); } else if (modifier == "none") { op.attribute ("raw", "=="); - op.tag ("OP"); rhs.attribute ("raw", "''"); rhs.tag ("LITERAL"); } else if (modifier == "any") { op.attribute ("raw", "!="); - op.tag ("OP"); rhs.attribute ("raw", "''"); rhs.tag ("LITERAL"); } else if (modifier == "is" || modifier == "equals") { op.attribute ("raw", "=="); - op.tag ("OP"); rhs.attribute ("raw", value); rhs.tag ("LITERAL"); } else if (modifier == "isnt" || modifier == "not") { op.attribute ("raw", "!="); - op.tag ("OP"); rhs.attribute ("raw", value); rhs.tag ("LITERAL"); } else if (modifier == "has" || modifier == "contains") { op.attribute ("raw", "~"); - op.tag ("OP"); - rhs.attribute ("raw", value); + rhs.attribute ("raw", "'" + value + "'"); rhs.tag ("LITERAL"); } else if (modifier == "hasnt") { op.attribute ("raw", "!~"); - op.tag ("OP"); - rhs.attribute ("raw", value); + rhs.attribute ("raw", "'" + value + "'"); rhs.tag ("LITERAL"); } else if (modifier == "startswith" || modifier == "left") { op.attribute ("raw", "~"); - op.tag ("OP"); rhs.attribute ("raw", "'^" + value + "'"); rhs.tag ("REGEX"); } else if (modifier == "endswith" || modifier == "right") { op.attribute ("raw", "~"); - op.tag ("OP"); rhs.attribute ("raw", "'" + value + "$'"); rhs.tag ("REGEX"); } else if (modifier == "word") { op.attribute ("raw", "~"); - op.tag ("OP"); #if defined (DARWIN) rhs.attribute ("raw", value); #elif defined (SOLARIS) @@ -1218,7 +1208,6 @@ void CLI::desugarFilterAttributeModifiers () else if (modifier == "noword") { op.attribute ("raw", "!~"); - op.tag ("OP"); #if defined (DARWIN) rhs.attribute ("raw", value); #elif defined (SOLARIS)