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

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Mar 14 15:48:07 EDT 2008


Author: matju
Date: Fri Mar 14 15:48:07 2008
New Revision: 3227

Log:
open-brace at end of \class causes it to expand to struct ThisClass : SuperClass {

Modified:
    trunk/base/source_filter.rb

Modified: trunk/base/source_filter.rb
==============================================================================
--- trunk/base/source_filter.rb (original)
+++ trunk/base/source_filter.rb Fri Mar 14 15:48:07 2008
@@ -55,11 +55,16 @@
 def handle_class(line)
 	raise "already in class #{where}" if $stack[-1] and ClassDecl===$stack[-1]
 	#STDERR.puts "class: #{line}"
-	/^(\w+)(?:\s*<\s*(\w+))?$/.match line or raise "syntax error #{where}"
+	/^(\w+)(?:\s*<\s*(\w+))?\s*(\{?)\s*$/.match line or raise "syntax error #{where}"
 	q=ClassDecl.new($1,$2,{},{},{},false)
 	$stack << q
 	$classes << q
 	Out.print "/* begin class */"
+	if $3 == "{" then
+		Out.print "struct #{$1} "
+		Out.print ": #{$2}" if $2
+		Out.print "{"
+	end
 end
 
 def parse_methoddecl(line,term)



More information about the Gridflow-cvs mailing list