From ead35aa5546c19d1e74518ce6cc7b4efb9efb5ae Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 4 Apr 2014 05:50:52 +0000 Subject: [PATCH] scripts/specialize-patch: Rework r5405 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5406 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/specialize-patch | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/specialize-patch b/scripts/specialize-patch index 124311799..ede8b0a19 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -151,13 +151,13 @@ function evaluate(stmnt, pattern, arg, op, result) { { last_stmnt = stmnt - pattern = "\\([[:blank:]]*([0-9]+)[[:blank:]]*\\)" + pattern = "![[:blank:]]*(-*[0-9]+)" while (match(stmnt, pattern, op) != 0) { - sub(pattern, op[1], stmnt) + sub(pattern, op[1] == 0, stmnt) } - pattern = "![[:blank:]]*([0-9]+)" + pattern = "![[:blank:]]*\\([[:blank:]]*(-*[0-9]+)[[:blank:]]*\\)" while (match(stmnt, pattern, op) != 0) { sub(pattern, op[1] == 0, stmnt) @@ -203,6 +203,12 @@ function evaluate(stmnt, pattern, arg, op, result) { sub(pattern, result, stmnt) } + pattern="(-*[0-9]+)[[:blank:]]*\\&\\&[[:blank:]]*\\([[:blank:]]*(-*[0-9]+)[[:blank:]]*\\)" + while (match(stmnt, pattern, op) != 0) + { + sub(pattern, (op[1] != 0) && (op[2] != 0), stmnt) + } + pattern="(-*[0-9]+)[[:blank:]]*\\&\\&[[:blank:]]*(-*[0-9]+)" while (match(stmnt, pattern, op) != 0) {