OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
-#include "php_psi_stdinc.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#else
+# include "php_config.h"
+#endif
#include <assert.h>
#include <math.h>
#include "calc.h"
#include "call.h"
#include "parser.h"
+#include "debug.h"
#include "Zend/zend_constants.h"
#include "Zend/zend_operators.h"
{
switch (exp->type) {
case PSI_T_DEFINED:
- CASE_IMPLVAL_NUM_PRINTF(dump->fun, dump->ctx, exp->data.ival, 1);
+ CASE_IMPLVAL_NUM_DUMP(dump, exp->data.ival, true);
case PSI_T_NULL:
PSI_DUMP(dump, "NULL");
break;
case PSI_T_NUMBER:
case PSI_T_NSNAME:
- case PSI_T_DEFINE:
case PSI_T_QUOTED_CHAR:
case PSI_T_CPP_HEADER:
PSI_DUMP(dump, "%s", exp->data.numb->val);
break;
+ case PSI_T_DEFINE:
+ PSI_DUMP(dump, "%s /* DEFINE */", exp->data.numb->val);
+ break;
case PSI_T_FUNCTION:
psi_cpp_macro_call_dump(dump, exp->data.call);
break;
PSI_DUMP(dump, "%s", exp->data.cnst->name->val);
break;
case PSI_T_ENUM:
- PSI_DUMP(dump, "%s", exp->data.enm->name->val);
+ PSI_DUMP(dump, "%s /* ENUM */ ", exp->data.enm->name->val);
break;
case PSI_T_NAME:
psi_decl_var_dump(dump, exp->data.dvar);
default:
assert(0);
}
+#if 0
+ PSI_DUMP(dump, "\t/* number.type=%d */ ", exp->type);
+#endif
}
static inline bool psi_number_validate_enum(struct psi_data *data,
return true;
}
}
- break;
+ /* no break */
default:
zend_string_release(exp->data.numb);
exp->type = PSI_T_INT64;
return true;
case PSI_T_NAME:
- if (scope && scope->cpp && zend_hash_exists(&scope->cpp->defs, exp->data.dvar->name)) {
- exp->type = PSI_T_DEFINE;
- goto define;
- }
+ //if (scope && scope->cpp && zend_hash_exists(&scope->cpp->defs, exp->data.dvar->name)) {
+ // exp->type = PSI_T_DEFINE;
+ // goto define;
+ //}
if (scope && scope->current_enum && psi_number_validate_enum(data, exp, scope)) {
return true;
}
case PSI_T_DEFINE:
if (scope && scope->cpp && zend_hash_exists(&scope->cpp->defs, exp->data.numb)) {
- define: ;
if (!scope->macro || !zend_string_equals(scope->macro->token->text, exp->data.numb)) {
return true;
}