Small change to generator.php

From: Date: Thu, 17 Mar 2005 02:16:21 +0000
Subject: Small change to generator.php
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1014@lists.php.net to get a copy of this message
Andrei, If you could be so kind as to apply this diff to generator.php, I would be very appreciative. Basically what it does is also print out all the methods/reader functions/constructors/functions in the same basic way it does for ones which fail. This makes it a lot easier (atleast for me) to see what is actually being built successfully to aid in documentation efforts. If there is a better route to get at this information, please share! Link to diff incase ML strips it: http://www.jeremyjohnstone.com/code/generator.php.diff.txt -- --------------------------- Jeremy Johnstone http://www.jeremyjohnstone.com jsjohnst@php.net

Index: generator.php =================================================================== RCS file: /repository/php-gtk/generator/generator.php,v retrieving revision 1.71 diff -w -u -r1.71 generator.php --- generator.php 15 Mar 2005 06:32:25 -0000 1.71 +++ generator.php 17 Mar 2005 02:08:51 -0000 @@ -574,6 +574,8 @@ } foreach ($methods as $method) { + $exception_occured = FALSE; + $method_name = $method->c_name; /* skip ignored methods */ @@ -604,6 +606,10 @@ } } catch (Exception $e) { fprintf(STDERR, "\tnot generating method %s::%s: %s\n", $object->c_name, $method->name, $e->getMessage()); + $exception_occured = TRUE; + } + if(!$exception_occured) { + fprintf(STDERR, "\t*** generating method %s::%s\n", $object->c_name, $method->name); } } @@ -624,6 +630,8 @@ $first = 1; foreach ($ctors as $ctor) { + $exception_occured = FALSE; + $ctor_name = $ctor->c_name; if ($first) { $ctor_fe_name = '__construct'; @@ -660,6 +668,10 @@ if ($ctor_fe_name == '__construct') { $ctor_defs[] = sprintf(Templates::function_entry, $ctor_fe_name, 'no_direct_constructor'); } + $exception_occured = TRUE; + } + if(!$exception_occured) { + fprintf(STDERR, "\t*** generating constructor %s for %s\n", $ctor_fe_name, $object->c_name); } $first = 0; } @@ -849,6 +861,8 @@ } foreach ($object->fields as $field) { + $exception_occured = FALSE; + list($field_type, $field_name) = $field; $read_func = "PHPG_PROP_READ_FN($object->c_name, $field_name)"; @@ -886,6 +900,10 @@ $field_name, $read_func, $write_func); } catch (Exception $e) { fprintf(STDERR, "\tnot generating reader function for %s->%s: %s\n", $object->c_name, $field_name, $e->getMessage()); + $exception_occured = TRUE; + } + if(!$exception_occured) { + fprintf(STDERR, "\t*** generating reader function for %s->%s\n", $object->c_name, $field_name); } } @@ -1007,6 +1025,8 @@ $dict['scope'] = $this->lprefix; foreach ($this->parser->functions as $function) { + $exception_occured = FALSE; + $func_name = $function->name; if ($function->name == $function->c_name) { $func_name = substr($function->name, strlen($this->lprefix) + 1); @@ -1034,6 +1054,10 @@ } } catch (Exception $e) { fprintf(STDERR, "\tnot generating function %s::%s: %s\n", $this->lprefix, $function->name, $e->getMessage()); + $exception_occured = TRUE; + } + if(!$exception_occured) { + fprintf(STDERR, "\t*** generating function %s::%s\n", $this->lprefix, $function->name); } }
« previous php.gtk.dev (#1014) next »