diff options
author | Zeev Suraski <zeev@php.net> | 2000-06-26 18:15:49 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-06-26 18:15:49 +0000 |
commit | cacbf1ea28db39a95ba515f3f3ee70b0f28b1197 (patch) | |
tree | 538f96bf749a6b4dab53bcedfe29580c94aa16ef | |
parent | 8e45536cf4b3627c6ad0af7a611eb689f0f60ea5 (diff) | |
download | php-git-cacbf1ea28db39a95ba515f3f3ee70b0f28b1197.tar.gz |
Support boolean NOT in the php.ini processor
-rw-r--r-- | main/configuration-parser.y | 6 | ||||
-rw-r--r-- | main/configuration-scanner.l | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/main/configuration-parser.y b/main/configuration-parser.y index 0e8b57bced..f36327f29c 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -384,6 +384,9 @@ void do_cfg_op(char type, zval *result, zval *op1, zval *op2) case '~': i_result = ~i_op1; break; + case '!': + i_result = !i_op1; + break; default: i_result = 0; break; @@ -429,7 +432,7 @@ void do_cfg_get_constant(zval *result, zval *name) %token T_ZEND_EXTENSION_DEBUG %token T_ZEND_EXTENSION_DEBUG_TS %left '|' '&' -%right '~' +%right '~' '!' %% @@ -568,6 +571,7 @@ expr: | expr '|' expr { do_cfg_op('|', &$$, &$1, &$3); } | expr '&' expr { do_cfg_op('&', &$$, &$1, &$3); } | '~' expr { do_cfg_op('~', &$$, &$2, NULL); } + | '!' expr { do_cfg_op('!', &$$, &$2, NULL); } | '(' expr ')' { $$ = $2; } ; diff --git a/main/configuration-scanner.l b/main/configuration-scanner.l index a13d074d9b..4958e7246e 100644 --- a/main/configuration-scanner.l +++ b/main/configuration-scanner.l @@ -119,12 +119,12 @@ void init_cfg_scanner() return TC_ENCAPSULATED_STRING; } -<INITIAL>[&|~()] { +<INITIAL>[&|~()!] { return yytext[0]; } -<INITIAL>[^=\n\r\t;|&~()"]+ { +<INITIAL>[^=\n\r\t;|&~()!"]+ { /* STRING */ register int i; |