Changeset - r22350:676a32d1d855
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-04-17 19:51:42
frosch@openttd.org
(svn r27545) -Fix: Remove special handling of classes with virtual methods from squirrel_export.awk. It seems to serve no purpose, except to break on 3 classes.
1 file changed with 2 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/script/api/squirrel_export.awk
Show inline comments
 
@@ -81,7 +81,6 @@ function reset_reader()
 
	struct_size = 0
 
	method_size = 0
 
	static_method_size = 0
 
	virtual_class = "false"
 
	cls = ""
 
	start_squirrel_define_on_next_line = "false"
 
	cls_level = 0
 
@@ -97,7 +96,6 @@ BEGIN {
 
	struct_size = 0
 
	method_size = 0
 
	static_method_size = 0
 
	virtual_class = "false"
 
	super_cls = ""
 
	cls = ""
 
	api_selected = ""
 
@@ -340,7 +338,7 @@ BEGIN {
 
	} else {
 
		print "	SQ" api_cls ".PreRegister(engine, \"" api_super_cls "\");"
 
	}
 
	if (virtual_class == "false" && super_cls != "ScriptEvent") {
 
	if (super_cls != "ScriptEvent") {
 
		if (cls_param[2] == "v") {
 
			print "	SQ" api_cls ".AddSQAdvancedConstructor(engine);"
 
		} else {
 
@@ -409,7 +407,6 @@ BEGIN {
 
	}
 
	if (static_method_size != 0) print ""
 

	
 
	if (virtual_class == "false") {
 
		# Non-static methods
 
		mlen = 0
 
		for (i = 1; i <= method_size; i++) {
 
@@ -424,7 +421,7 @@ BEGIN {
 
			delete methods[i]
 
		}
 
		if (method_size != 0) print ""
 
	}
 

	
 
	print "	SQ" api_cls ".PostRegister(engine);"
 
	print "}"
 

	
 
@@ -489,9 +486,6 @@ BEGIN {
 
	}
 

	
 
	is_static = match($0, "static")
 
	if (match($0, "virtual")) {
 
		virtual_class = "true"
 
	}
 
	gsub("\\yvirtual\\y", "", $0)
 
	gsub("\\ystatic\\y", "", $0)
 
	gsub("\\yconst\\y", "", $0)
0 comments (0 inline, 0 general)