[Gridflow-cvs] [svn] commit: r3353 - /trunk/base/source_filter.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sun Mar 30 15:18:30 EDT 2008


Author: matju
Date: Sun Mar 30 15:18:28 2008
New Revision: 3353

Log:
allow brace in \end class without having to restate the class name

Modified:
    trunk/base/source_filter.rb

Modified: trunk/base/source_filter.rb
==============================================================================
--- trunk/base/source_filter.rb (original)
+++ trunk/base/source_filter.rb Sun Mar 30 15:18:28 2008
@@ -283,7 +283,7 @@
 	if ClassDecl===frame then
 		#handle_classinfo if not frame.info
 		cl = frame.name
-		if fields[0]!="class" or (n>1 and fields[1]!=cl) then raise "end not matching #{where}" end
+		if fields[0]!="class" or (n>1 and not /^\{/ =~ fields[1] and fields[1]!=cl) then raise "end not matching #{where}" end
 		$stack.push frame
 		frame.attrs.each {|name,attr|
 			type,name,default = attr.to_a
@@ -306,7 +306,7 @@
 				"return in[#{i}]->begin(argc,argv);}"
 
 		}
-		if /^class\s+(\w+\s+)?\{(.*)/ =~ line then handle_classinfo("{"+$2) end
+		if /^class\s*(\w+\s+)?\{(.*)/ =~ line then handle_classinfo("{"+$2) end
 		$stack.pop
 	end
 	if :ruby==frame then



More information about the Gridflow-cvs mailing list