[gnome-games/wip/exalm/mame: 14/18] mame: Make extract-supported-games preprocess the file more



commit c44187ad9b4199ef5ff7d940d2bc2d41a6f7bd09
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Thu Feb 6 02:34:33 2020 +0500

    mame: Make extract-supported-games preprocess the file more
    
    Only leave id and name in. This will allow to drastically simplify and
    speed up the parsing in the next commit.

 plugins/mame/tools/extract-suported-games.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/plugins/mame/tools/extract-suported-games.sh b/plugins/mame/tools/extract-suported-games.sh
index 64493bd4..a6acf36f 100755
--- a/plugins/mame/tools/extract-suported-games.sh
+++ b/plugins/mame/tools/extract-suported-games.sh
@@ -3,4 +3,10 @@
 # $1: path to the MAME repository
 # $2: file name of the produced game database
 
-cat `find $1/src/mame/drivers -name "*.cpp" | sort` | egrep "^GAMEL?\(.*\)$" > $2
+simple=' *[^,]+ *'
+simpleg=' *([^,]+) *'
+quoted=' *" *(.*?) *" *'
+pattern="$simple,$simpleg,$simple,$simple,$simple,($simple,)?$simple,$simple,$quoted,$quoted,${simple}(${simple})?(,${simple})?"
+regex="^GAMEL?\(${pattern}\) *(//.*)?$"
+
+cat `find $1/src/mame/drivers -name "*.cpp" | sort` | egrep "^GAMEL?\(.*\)$" | sed -E "s|$regex|\1 \4|g" | 
sed -E 's/^([^ ]+) +(.+)$/\1 \2/g' | sort > $2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]