summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2017-01-19 06:29:11 +0100
committerRemi Collet <fedora@famillecollet.com>2017-01-19 06:29:11 +0100
commit9f06dee86dd9036f59c153eb4046e63a5cc7c5a1 (patch)
tree994ad65f0d39ad58f40a5711b509fadc4460cefb
parent352cf49b21963e8b8acf3d197ebab8aefc263eb3 (diff)
php-ast: 0.1.3
-rw-r--r--REFLECTION2
-rw-r--r--php-ast-upstream.patch97
-rw-r--r--php-ast.spec17
3 files changed, 11 insertions, 105 deletions
diff --git a/REFLECTION b/REFLECTION
index acb441b..8b7a599 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #75 ast version 0.1.2 ] {
+Extension [ <persistent> extension #75 ast version 0.1.3 ] {
- Constants [187] {
Constant [ integer ast\AST_ARG_LIST ] { 128 }
diff --git a/php-ast-upstream.patch b/php-ast-upstream.patch
deleted file mode 100644
index 264e630..0000000
--- a/php-ast-upstream.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 81e2938b02ffb734bb85ef2a0fbc74f87b4ba377 Mon Sep 17 00:00:00 2001
-From: Nikita Popov <nikic@php.net>
-Date: Thu, 24 Nov 2016 21:49:21 +0100
-Subject: [PATCH] Fix issue #36
-
-The emulation of PHP 7.0 list() structure did not account for
-skipped elements.
----
- ast.c | 4 ++--
- tests/array_destructuring_old.phpt | 19 +++++++++++++++++++
- 2 files changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/ast.c b/ast.c
-index ad24ce8..755af14 100644
---- a/ast.c
-+++ b/ast.c
-@@ -241,7 +241,7 @@ static inline zend_bool ast_array_is_list(zend_ast *ast) {
- }
-
- for (i = 0; i < list->children; i++) {
-- if (list->child[i]->child[1] != NULL || list->child[i]->attr) {
-+ if (list->child[i] && (list->child[i]->child[1] != NULL || list->child[i]->attr)) {
- return 0;
- }
- }
-@@ -400,7 +400,7 @@ static void ast_fill_children_ht(HashTable *ht, zend_ast *ast, zend_long version
- /* Skip docComment child -- It's handled separately */
- continue;
- #if PHP_VERSION_ID >= 70100
-- } else if (ast->kind == ZEND_AST_LIST) {
-+ } else if (ast->kind == ZEND_AST_LIST && child != NULL) {
- /* Emulate simple variable list */
- ast_to_zval(&child_zv, child->child[0], version);
- #else
-diff --git a/tests/array_destructuring_old.phpt b/tests/array_destructuring_old.phpt
-index 6699a80..0aa378d 100644
---- a/tests/array_destructuring_old.phpt
-+++ b/tests/array_destructuring_old.phpt
-@@ -8,6 +8,7 @@ require __DIR__ . '/../util.php';
- $code = <<<'PHP'
- <?php
- list($a, $b) = $x;
-+list(, $b) = $x;
- PHP;
-
- echo ast_dump(ast\parse_code($code, $version=30)), "\n";
-@@ -24,6 +25,13 @@ AST_STMT_LIST
- name: "b"
- expr: AST_VAR
- name: "x"
-+ 1: AST_ASSIGN
-+ var: AST_LIST
-+ 0: null
-+ 1: AST_VAR
-+ name: "b"
-+ expr: AST_VAR
-+ name: "x"
- AST_STMT_LIST
- 0: AST_ASSIGN
- var: AST_ARRAY
-@@ -40,3 +48,14 @@ AST_STMT_LIST
- key: null
- expr: AST_VAR
- name: "x"
-+ 1: AST_ASSIGN
-+ var: AST_ARRAY
-+ flags: ARRAY_SYNTAX_LIST (1)
-+ 0: null
-+ 1: AST_ARRAY_ELEM
-+ flags: 0
-+ value: AST_VAR
-+ name: "b"
-+ key: null
-+ expr: AST_VAR
-+ name: "x"
-From fbab0c35d4c7851f32384073798a0031ecb4499e Mon Sep 17 00:00:00 2001
-From: Nikita Popov <nikic@php.net>
-Date: Thu, 24 Nov 2016 22:13:38 +0100
-Subject: [PATCH] Fix PHP 7 build
-
----
- ast.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/ast.c b/ast.c
-index 4c4095d..62a9f48 100644
---- a/ast.c
-+++ b/ast.c
-@@ -405,7 +405,7 @@ static void ast_fill_children_ht(HashTable *ht, zend_ast *ast, zend_long version
- ast_to_zval(&child_zv, child->child[0], version);
- #else
- } else if (version >= 35 && ast->kind == ZEND_AST_ARRAY
-- && ast->attr == ZEND_ARRAY_SYNTAX_LIST) {
-+ && ast->attr == ZEND_ARRAY_SYNTAX_LIST && child != NULL) {
- /* Emulate ARRAY_ELEM list */
- zval ch0, ch1;
- ast_to_zval(&ch0, child, version);
diff --git a/php-ast.spec b/php-ast.spec
index e9e0fb0..431049d 100644
--- a/php-ast.spec
+++ b/php-ast.spec
@@ -8,7 +8,7 @@
#
%{?scl: %scl_package php-ast}
-%global gh_commit abfef40846cb5454dafa1808769fde851ba8dd70
+%global gh_commit ae55a198e64b14fd70f467476789c60ba06f61f6
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner nikic
%global gh_project php-ast
@@ -20,19 +20,17 @@
Summary: Abstract Syntax Tree
Name: %{?scl_prefix}php-ast
-Version: 0.1.2
+Version: 0.1.3
%if 0%{?gh_date:1}
Release: 0.2.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%else
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%endif
License: BSD
Group: Development/Languages
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
-Patch0: %{gh_project}-upstream.patch
-
BuildRequires: %{?scl_prefix}php-devel > 7
BuildRequires: %{?scl_prefix}php-tokenizer
@@ -68,8 +66,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
mv %{gh_project}-%{gh_commit} NTS
cd NTS
-%patch0 -p1 -b .upstream
-
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_AST_VERSION/{s/.* "//;s/".*$//;p}' php_ast.h)
if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
@@ -91,6 +87,8 @@ EOF
%build
+%{?dtsenable}
+
cd NTS
%{_bindir}/phpize
%configure \
@@ -109,6 +107,8 @@ make %{?_smp_mflags}
%install
+%{?dtsenable}
+
# Install the NTS stuff
make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -169,6 +169,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Thu Jan 19 2017 Remi Collet <remi@fedoraproject.org> - 0.1.3-1
+- update to 0.1.3
+
* Thu Dec 1 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-4
- rebuild with PHP 7.1.0 GA