Author: bernhard
Date: Fri Nov 28 00:42:45 2008
New Revision: 33301
Modified:
trunk/languages/pipp/src/common/php_basic.pir
trunk/languages/pipp/src/common/php_builtin.pir
Log:
[Pipp] Move the constant() function back to php_basic.pir,
because in C-PHP it is defined in ./ext/standard/basic_functions.c
Modified: trunk/languages/pipp/src/common/php_basic.pir
==============================================================================
--- trunk/languages/pipp/src/common/php_basic.pir (original)
+++ trunk/languages/pipp/src/common/php_basic.pir Fri Nov 28 00:42:45 2008
@@ -85,6 +85,33 @@
not_implemented()
.end
+=item C<mixed constant(string const_name)>
+
+Given the name of a constant this function will return the constants
associated value
+
+=cut
+
+.sub 'constant'
+ .param pmc args :slurpy
+ .local int argc
+ argc = args
+ unless argc != 1 goto L1
+ wrong_param_count()
+ .RETURN_NULL()
+ L1:
+ $P1 = shift args
+ $S1 = $P1
+ .local pmc cst
+ .GET_CONSTANTS(cst)
+ $I0 = exists cst[$S1]
+ unless $I0 goto L2
+ $P0 = cst[$S1]
+ .return ($P0)
+ L2:
+ error(E_WARNING, "Couldn't find constant ", $S1)
+ .RETURN_NULL()
+.end
+
=item C<array error_get_last()>
Get the last occurred error as associative array. Returns NULL if there hasn't
been an error yet.
Modified: trunk/languages/pipp/src/common/php_builtin.pir
==============================================================================
--- trunk/languages/pipp/src/common/php_builtin.pir (original)
+++ trunk/languages/pipp/src/common/php_builtin.pir Fri Nov 28 00:42:45 2008
@@ -27,33 +27,6 @@
not_implemented()
.end
-=item C<mixed constant(string const_name)>
-
-Given the name of a constant this function will return the constants
associated value
-
-=cut
-
-.sub 'constant'
- .param pmc args :slurpy
- .local int argc
- argc = args
- unless argc != 1 goto L1
- wrong_param_count()
- .RETURN_NULL()
- L1:
- $P1 = shift args
- $S1 = $P1
- .local pmc cst
- .GET_CONSTANTS(cst)
- $I0 = exists cst[$S1]
- unless $I0 goto L2
- $P0 = cst[$S1]
- .return ($P0)
- L2:
- error(E_WARNING, "Couldn't find constant ", $S1)
- .RETURN_NULL()
-.end
-
=item C<string create_function(string args, string code)>
Creates an anonymous function, and returns its name (funny, eh?)