Simplify regexps for commenting out unsupported directives

Message ID 1376151867-73257-1-git-send-email-martin@martin.st
State Committed
Commit 35de474e7aad900b389e90e3cc7dc9bbc1f9d10a
Headers show

Commit Message

Martin Storsjö Aug. 10, 2013, 4:24 p.m.
---
 gas-preprocessor.pl |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Luca Barbato Aug. 10, 2013, 6:08 p.m. | #1
On 10/08/13 18:24, Martin Storsjo wrote:
> ---
>  gas-preprocessor.pl |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 

Looks fine.

lu

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index f932c60..54694c5 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -109,14 +109,14 @@  while (<ASMFILE>) {
     s/(?<!\\)$comm.*//x;
 
     # comment out unsupported directives
-    s/\.type/$comm.type/x;
-    s/\.func/$comm.func/x;
-    s/\.endfunc/$comm.endfunc/x;
-    s/\.ltorg/$comm.ltorg/x;
-    s/\.size/$comm.size/x;
-    s/\.fpu/$comm.fpu/x;
-    s/\.arch/$comm.arch/x;
-    s/\.object_arch/$comm.object_arch/x;
+    s/\.type/$comm$&/x;
+    s/\.func/$comm$&/x;
+    s/\.endfunc/$comm$&/x;
+    s/\.ltorg/$comm$&/x;
+    s/\.size/$comm$&/x;
+    s/\.fpu/$comm$&/x;
+    s/\.arch/$comm$&/x;
+    s/\.object_arch/$comm$&/x;
 
     # the syntax for these is a little different
     s/\.global/.globl/x;