From dbb576957737a14d68a2cba602a731e1c8062856 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Tue, 24 Jan 2012 09:15:09 +0100 Subject: tools/sed-enums, tools/genruby: take care of multilines DEF=(A|B|C) --- tools/sed-enums | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/sed-enums') diff --git a/tools/sed-enums b/tools/sed-enums index 870e030..aa44675 100644 --- a/tools/sed-enums +++ b/tools/sed-enums @@ -7,9 +7,9 @@ T;h :attrs;n # read again if { /^\s*\{/ b attrs -# append each item -s/^\s*([A-Z0-9_]+)(\s*=\s*[^,\/]+)?.*$/\1\2, / -# goto next if subsitution fails, append pattern, loop +# append each item finished by , or \/ +s/^\s*([A-Z0-9_]+)(\s*=\s*[^,\/]+)?\s*([,|\)])?[\/]?.*$/\1\2\3 / +# goto next if subsitution fails, append pattern, loop to attrs T next;H;b attrs :next # try again if } not found @@ -29,4 +29,5 @@ H;x s/\n//g # replace multi spaces with one s/ {2,}/ /g -s/, }/ }/p +s/, }/ }/ +p -- cgit v1.2.3