]> granicus.if.org Git - php/commitdiff
- Speed up by making null/false/true reserved word which allows to drop
authorMarcus Boerger <helly@php.net>
Fri, 16 Jul 2004 06:50:57 +0000 (06:50 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 16 Jul 2004 06:50:57 +0000 (06:50 +0000)
  an opcode (FETCH_CONSTANT) for every usage.

Zend/zend_language_parser.y
Zend/zend_language_scanner.l

index 6d85f8be7a8745c1289742d1f41bc4888fb25fac..257849fd2642fb837016eb6d4e3318626782ca5e 100644 (file)
 %token T_DOLLAR_OPEN_CURLY_BRACES
 %token T_CURLY_OPEN
 %token T_PAAMAYIM_NEKUDOTAYIM
+%token T_NULL
+%token T_FALSE
+%token T_TRUE
 
 %% /* Rules */
 
@@ -675,6 +678,9 @@ common_scalar:
        |       T_CLASS_C                                       { $$ = $1; }
        |       T_METHOD_C                                      { $$ = $1; }
        |       T_FUNC_C                                        { $$ = $1; }
+       |       T_NULL                                          { $$ = $1; }
+       |       T_FALSE                                         { $$ = $1; }
+       |       T_TRUE                                          { $$ = $1; }
 ;
 
 
index e6efbcc8270ef5b566526525c7eba7b0d1834f9f..00deccd7315c0ddefa3acef57d045a053887c4da 100644 (file)
@@ -57,6 +57,7 @@
 #include "zend_constants.h"
 #include "zend_variables.h"
 #include "zend_operators.h"
+#include "zend_API.h"
 
 #ifdef HAVE_STDARG_H
 # include <stdarg.h>
@@ -1303,6 +1304,21 @@ NEWLINE ("\r"|"\n"|"\r\n")
        return T_FILE;
 }
 
+<ST_IN_SCRIPTING>"NULL" {
+       ZVAL_NULL(zendlval);
+       return T_NULL;
+}
+
+<ST_IN_SCRIPTING>"FALSE" {
+       ZVAL_FALSE(zendlval);
+       return T_FALSE;
+}
+
+<ST_IN_SCRIPTING>"TRUE" {
+       ZVAL_TRUE(zendlval);
+       return T_TRUE;
+}
+
 <INITIAL>(([^<]|"<"[^?%s<]){1,400})|"<s"|"<" {
 #ifdef ZEND_MULTIBYTE
        if (SCNG(output_filter)) {