[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/5] convert-ly rule for removing parser/location
From: |
David Kastrup |
Subject: |
[PATCH 4/5] convert-ly rule for removing parser/location |
Date: |
Wed, 27 May 2015 11:45:17 +0200 |
---
python/convertrules.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/python/convertrules.py b/python/convertrules.py
index 8dc8e91..ba10f25 100644
--- a/python/convertrules.py
+++ b/python/convertrules.py
@@ -3743,6 +3743,22 @@ def conv(str):
+ after_id, r'\1-\2', str)
return str
address@hidden ((2, 19, 22), "(define-xxx-function (parser location ...) ->
(define-xxx-function (...)")
+def conv(str):
+ def subst(m):
+ def subsub(m):
+ str = (m.group (1)
+ + re.sub ('(?<=\s|["\\()])' + m.group (2) +
r'(?=\s|["\\()])',
+ r'(*location*)',
+ re.sub (r'(?<=\s|["\\()])parser(?=\s|["\\()])',
+ r'(*parser*)', m.group (3))))
+ return str
+ return re.sub (r'(\([-a-z]+\s*\(+)parser\s+([-a-z]+)\s*((?:.|\n)*)$',
+ subsub, m.group (0))
+ str = re.sub (r'\(define-(?:music|event|scheme|void)-function(?=\s|["(])'
+ + paren_matcher (20) + r'\)', subst, str)
+ return str
+
# Guidelines to write rules (please keep this at the end of this file)
#
# - keep at most one rule per version; if several conversions should be done,
--
2.1.4
- [PATCH 1/5] Remove parser/location global variable setup, David Kastrup, 2015/05/27
- [PATCH 2/5] Fix various jumbled parser/location argument pairs, David Kastrup, 2015/05/27
- [PATCH 3/5] Remove parser/location args from music function calls, David Kastrup, 2015/05/27
- [PATCH 4/5] convert-ly rule for removing parser/location,
David Kastrup <=
- [PATCH 5/5] Run scripts/auxiliar/update-with-convert-ly.sh, David Kastrup, 2015/05/27
- Re: [PATCH 1/5] Remove parser/location global variable setup, David Kastrup, 2015/05/27
- Re: [PATCH 1/5] Remove parser/location global variable setup, Dan Eble, 2015/05/27