From a112b40657ce03ab64fc1d3ffbad794615cb3e3f Mon Sep 17 00:00:00 2001 From: Paul Morris Date: Wed, 10 Jun 2015 00:42:44 -0400 Subject: [PATCH] Issue 4418/3 convert-ly rule: whiteout -> whiteout-box --- python/convertrules.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/convertrules.py b/python/convertrules.py index 77d83ff52a..c1506654e0 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3746,9 +3746,17 @@ def conv(str): + after_id, r'\1-\2', str) return str -@rule ((2, 19, 22), """(define-xxx-function (parser location ...) -> (define-xxx-function (...) +@rule ((2, 19, 22), """whiteout -> whiteout-box +(define-xxx-function (parser location ...) -> (define-xxx-function (...) (xxx ... parser ...) -> (xxx ... ...)""") def conv(str): + # whiteout -> whiteout-box + str = re.sub (r"\\whiteout(?![a-z_-])", r"\\whiteout-box", str) + str = re.sub (r"\b\.whiteout(?![a-z_-])\b", r".whiteout-box", str) + str = re.sub (r"#'whiteout(?![a-z_-])\b", r"#'whiteout-box", str) + str = re.sub (r"\bstencil-whiteout\b", r"stencil-whiteout-box", str) + + # (define-xxx-function (parser location ...) -> (define-xxx-function (...) def subst(m): def subsub(m): str = (m.group (1) @@ -3762,6 +3770,7 @@ def conv(str): str = re.sub (r'\(define-(?:music|event|scheme|void)-function(?=\s|["(])' + paren_matcher (20) + r'\)', subst, str) + # (xxx ... parser ...) -> (xxx ... ...) def repl (m): return m.group (1) + inner (m.group (2)) def inner (str): -- 2.39.5