[gimp] tools: handle multiline enum values in gimp-mkenums



commit 3f07ab3614af2f7670b50c271ba0ad99db9ebe1d
Author: Ell <ell_se yahoo com>
Date:   Mon Feb 20 17:27:01 2017 -0500

    tools: handle multiline enum values in gimp-mkenums
    
    Mostly useful for flag enums aliases.

 tools/gimp-mkenums |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tools/gimp-mkenums b/tools/gimp-mkenums
index a030fc8..b78d175 100755
--- a/tools/gimp-mkenums
+++ b/tools/gimp-mkenums
@@ -119,6 +119,18 @@ sub parse_entries {
            } else {
                push @entries, [ $name ];
            }
+
+            # skip remaining lines of multiline values
+            do {
+                if (m/}/) {
+                    redo;
+                } elsif (m@,\s*(/\*.*?\*/\s*)*$@) {
+                    next;
+                }
+            } while (<$file>);
+
+            # failed to find end of value. bail
+            die "$0: $file_name:$.: Unterminated enum, while processing `$name'\n";
        } elsif (m@^\s*\#@) {
            # ignore preprocessor directives
        } else {


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