summaryrefslogtreecommitdiff
path: root/src/ai/api/squirrel_export.awk
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-31 19:50:01 +0000
committeryexo <yexo@openttd.org>2009-07-31 19:50:01 +0000
commitc2ed8840123cc81f58b3db8d6341b22349b4ac78 (patch)
tree71e42277f511c8cdfa800e9d564d159e20b595ff /src/ai/api/squirrel_export.awk
parent0bb3d7030ffdd336acd0131a00b93c6aa1b26419 (diff)
downloadopenttd-c2ed8840123cc81f58b3db8d6341b22349b4ac78.tar.xz
(svn r17005) -Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING
Diffstat (limited to 'src/ai/api/squirrel_export.awk')
-rw-r--r--src/ai/api/squirrel_export.awk19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk
index 930de32dd..eb829a510 100644
--- a/src/ai/api/squirrel_export.awk
+++ b/src/ai/api/squirrel_export.awk
@@ -34,6 +34,7 @@ BEGIN {
enum_value_size = 0
enum_string_to_error_size = 0
enum_error_to_string_size = 0
+ const_size = 0
struct_size = 0
method_size = 0
static_method_size = 0
@@ -217,6 +218,17 @@ BEGIN {
}
if (enum_value_size != 0) print ""
+ # Const values
+ mlen = 0
+ for (i = 1; i <= const_size; i++) {
+ if (mlen <= length(const_value[i])) mlen = length(const_value[i])
+ }
+ for (i = 1; i <= const_size; i++) {
+ print " SQ" cls ".DefSQConst(engine, " cls "::" const_value[i] ", " substr(spaces, 1, mlen - length(const_value[i])) "\"" const_value[i] "\");"
+ delete const_value[i]
+ }
+ if (const_size != 0) print ""
+
# Mapping of OTTD strings to errors
mlen = 0
for (i = 1; i <= enum_string_to_error_size; i++) {
@@ -320,6 +332,13 @@ BEGIN {
}
}
+# Add a const (non-enum) value
+/^[ ]*static const \w+ \w+ = \w+;$/ {
+ const_size++
+ const_value[const_size] = $4
+ next
+}
+
# Add a method to the list
/^.*\(.*\).*$/ {
if (cls_level != 1) next