(svn r9454) [NoAI] -Fix: remove mawk <-> gawk incompatabilities from the Squirrel export. noai
authorrubidium
Sun, 25 Mar 2007 19:18:51 +0000
branchnoai
changeset 9533 2c692ffdf5e4
parent 9532 539c48d64eea
child 9534 72cd7f3a32d9
(svn r9454) [NoAI] -Fix: remove mawk <-> gawk incompatabilities from the Squirrel export.
src/ai/api/squirrel_export.awk
--- a/src/ai/api/squirrel_export.awk	Sun Mar 25 17:43:40 2007 +0000
+++ b/src/ai/api/squirrel_export.awk	Sun Mar 25 19:18:51 2007 +0000
@@ -125,10 +125,10 @@
 	# Enum values
 	mlen = 0
 	for (i = 1; i <= enum_value_size; i++) {
-		if (mlen <= length(enum_value[i])) mlen = length(enum_value[i]) + 1
+		if (mlen <= length(enum_value[i])) mlen = length(enum_value[i])
 	}
 	for (i = 1; i <= enum_value_size; i++) {
-		print "	SQ" cls ".DefSQConst   (engine, " cls "::" enum_value[i] ", " substr(spaces, 0, mlen - length(enum_value[i])) "\""  enum_value[i] "\");"
+		print "	SQ" cls ".DefSQConst   (engine, " cls "::" enum_value[i] ", " substr(spaces, 1, mlen - length(enum_value[i])) "\""  enum_value[i] "\");"
 		delete enum_value[i]
 	}
 	if (enum_value_size != 0) print ""
@@ -136,10 +136,10 @@
 	# Static methods
 	mlen = 0
 	for (i = 1; i <= static_method_size; i++) {
-		if (mlen <= length(static_methods[i])) mlen = length(static_methods[i]) + 1
+		if (mlen <= length(static_methods[i])) mlen = length(static_methods[i])
 	}
 	for (i = 1; i <= static_method_size; i++) {
-		print "	SQ" cls ".DefSQStaticMethod(engine, &" cls "::" static_methods[i] ", " substr(spaces, 0, mlen - length(static_methods[i])) "\""  static_methods[i] "\");"
+		print "	SQ" cls ".DefSQStaticMethod(engine, &" cls "::" static_methods[i] ", " substr(spaces, 1, mlen - length(static_methods[i])) "\""  static_methods[i] "\");"
 		delete static_methods[i]
 	}
 	if (static_method_size != 0) print ""
@@ -147,10 +147,10 @@
 	# Non-static methods
 	mlen = 0
 	for (i = 1; i <= method_size; i++) {
-		if (mlen <= length(methods[i])) mlen = length(methods[i]) + 1
+		if (mlen <= length(methods[i])) mlen = length(methods[i])
 	}
 	for (i = 1; i <= method_size; i++) {
-		print "	SQ" cls ".DefSQMethod(engine, &" cls "::" methods[i] ", " substr(spaces, 0, mlen - length(methods[i])) "\""  methods[i] "\");"
+		print "	SQ" cls ".DefSQMethod(engine, &" cls "::" methods[i] ", " substr(spaces, 1, mlen - length(methods[i])) "\""  methods[i] "\");"
 		delete methods[i]
 	}
 	if (method_size != 0) print ""
@@ -190,8 +190,8 @@
 	gsub("virtual", "", $0)
 	gsub("static", "", $0)
 	gsub("const", "", $0)
-	gsub("\*", "", $0)
-	gsub("\(.*", "", $0)
+	gsub("\\*", "", $0)
+	gsub("\\(.*", "", $0)
 	if ($2 == "") next
 	if (is_static) {
 		static_method_size++