OSDN Git Service

Minor simplification.
authorDan Bornstein <danfuzz@android.com>
Sat, 4 Dec 2010 01:58:01 +0000 (17:58 -0800)
committerDan Bornstein <danfuzz@android.com>
Sat, 4 Dec 2010 01:58:01 +0000 (17:58 -0800)
Change-Id: Ie17ba83ead45028a8b7b32c1cc5763f9dd6d684c

opcode-gen/opcode-gen.awk

index 82e4fcf..934413f 100644 (file)
@@ -53,6 +53,11 @@ consumeUntil != "" {
     emission = substr($0, i + 6, RLENGTH - 7);
     consumeUntil = "END(" emission ")";
     emissionHandled = 0;
+}
+
+# Most lines just get copied from the source as-is, including the start
+# comment for directives.
+{
     print;
 }
 
@@ -195,11 +200,8 @@ emission == "libdex-index-types" {
     }
 }
 
-#
-# General control (must appear after the directives).
-#
-
-# Handle the end of directive processing.
+# Handle the end of directive processing (must appear after the directive
+# clauses).
 emission != "" {
     if (!emissionHandled) {
         printf("WARNING: unknown tag \"%s\"\n", emission) >"/dev/stderr";
@@ -207,12 +209,8 @@ emission != "" {
     }
 
     emission = "";
-    next;
 }
 
-# Most lines just get copied from the source as-is.
-{ print; }
-
 #
 # Helper functions.
 #
@@ -288,7 +286,7 @@ function defineOpcode(line, count, parts, idx) {
     # Calculate derived values.
 
     constName[idx] = toupper(name[idx]);
-    gsub("[---/]", "_", constName[idx]); # Dash and slash become underscore.
+    gsub("[/-]", "_", constName[idx]);   # Dash and slash become underscore.
     gsub("[+^]", "", constName[idx]);    # Plus and caret are removed.
     split(name[idx], parts, "/");