Skip to content

Commit 3cdd0eb

Browse files
authored
Merge pull request #91 from phalcon/development
1.3.4
2 parents 244890b + 99dd234 commit 3cdd0eb

File tree

10 files changed

+176
-28
lines changed

10 files changed

+176
-28
lines changed

.dir-locals.el

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
;;; Directory Local Variables
2+
;; For more information see (info "(emacs) Directory Variables")
3+
4+
((nil . ((fill-column . 78)))
5+
(c-mode . ((c-file-style . "k&r")
6+
(tab-width . 4)
7+
(c-basic-offset . 4))))
File renamed without changes.
File renamed without changes.

.github/workflows/main.yml

+26-19
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- '*.md'
99
pull_request:
1010
branches:
11-
- 'master'
12-
- 'development'
11+
- master
12+
- development
1313
schedule:
1414
- cron: '0 11 * * *'
1515

@@ -21,23 +21,24 @@ jobs:
2121
matrix:
2222
re2c:
2323
- '0.13.6'
24-
- '1.2.1'
24+
- '1.3'
2525
php:
2626
- '7.0'
2727
- '7.1'
2828
- '7.3'
2929
- '7.4'
3030
name:
31-
- 'Ubuntu'
32-
- 'macOS X'
31+
- Ubuntu
32+
- macOS
3333

3434
include:
35-
- name: 'Ubuntu'
35+
- name: Ubuntu
3636
os: ubuntu-latest
3737
ccov: ON
38-
- name: 'macOS X'
39-
os: macOS-latest
40-
ccov: ON
38+
39+
- name: macOS
40+
os: macos-latest
41+
ccov: OFF
4142

4243
name: "${{ matrix.name }}: PHP ${{ matrix.php }}, re2c ${{ matrix.re2c }}"
4344
runs-on: ${{ matrix.os }}
@@ -47,12 +48,12 @@ jobs:
4748
USE_ZEND_ALLOC: 0
4849

4950
steps:
50-
- uses: actions/checkout@v2-beta
51+
- uses: actions/checkout@v2
5152
with:
5253
fetch-depth: 5
5354

5455
- name: Install PHP ${{ matrix.php }}
55-
uses: shivammathur/setup-php@v1
56+
uses: shivammathur/setup-php@v2
5657
with:
5758
php-version: '${{ matrix.php }}'
5859
coverage: none
@@ -64,7 +65,7 @@ jobs:
6465
sudo apt-get install --no-install-recommends --quiet --yes lcov gdb
6566
6667
- name: Setup Prerequisites (macOS)
67-
if: runner.os == 'macOS'
68+
if: runner.os == 'macOS' && matrix.ccov == 'ON'
6869
run: |
6970
brew install lcov
7071
sudo xcode-select -switch /Applications/Xcode.app
@@ -87,17 +88,23 @@ jobs:
8788
run: echo '/tmp/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern
8889

8990
- name: Install re2c ${{ matrix.re2c }}
90-
if: runner.os != 'Windows'
9191
run: .ci/install-re2c.sh
9292

93-
- name: Build extensions (Linux)
94-
if: runner.os != 'Windows'
93+
- name: Build extensions
9594
run: |
9695
phpize
97-
./configure \
98-
--enable-zephir-parser \
99-
--enable-zephir-parser-debug \
100-
--enable-coverage
96+
97+
if [ "${{ matrix.ccov}}" = "ON" ]; then
98+
./configure \
99+
--enable-zephir-parser \
100+
--enable-zephir-parser-debug \
101+
--enable-coverage
102+
else
103+
./configure \
104+
--enable-zephir-parser \
105+
--enable-zephir-parser-debug
106+
fi
107+
101108
make -j$(getconf _NPROCESSORS_ONLN)
102109
103110
- name: Preparing to collect coverage data

CHANGELOG.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
## [1.3.4] - 2020-04-04
9+
### Fixed
10+
- Fixed operator precedence
11+
[#89](https://github.com/phalcon/php-zephir-parser/issues/89)
12+
813
## [1.3.3] - 2019-12-10
914
### Added
1015
- Added PHP 7.4 support
1116

1217
## [1.3.2] - 2019-09-30
1318
### Changed
1419
- Files `parser.c` and `scanner.c` no longer distributed.
15-
Package maintainer should re-generate they by himself.
20+
Package maintainer should re-generate they by himself
1621
[#75](https://github.com/phalcon/php-zephir-parser/pull/75)
1722

1823
### Fixed
@@ -30,7 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3035
## [1.3.0] - 2019-04-27
3136
### Added
3237
- Added support for "use" keyword in closures
33-
[phalcon/zephir#1848](https://github.com/phalcon/zephir/issues/1848)
38+
[phalcon/zephir#1848](https://github.com/phalcon/zephir/issues/1848),
3439
[phalcon/zephir#888](https://github.com/phalcon/zephir/issues/888)
3540

3641
### Fixed
@@ -146,7 +151,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
146151
### Added
147152
- Initial stable release
148153

149-
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.3...HEAD
154+
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.4...HEAD
155+
[1.3.4]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.3...v1.3.4
150156
[1.3.3]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...v1.3.3
151157
[1.3.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...v1.3.2
152158
[1.3.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.0...v1.3.1

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.3
1+
1.3.4

parser/zephir.lemon

+7-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
%name xx_
3232

3333
// Define operator precedence early so that this is the first occurrence
34-
// of the operator tokens in the grammer. Keeping the operators together
34+
// of the operator tokens in the grammar. Keeping the operators together
3535
// causes them to be assigned integer values that are close together,
3636
// which keeps parser tables smaller.
3737
//
@@ -46,8 +46,12 @@
4646
%left OR .
4747
%left AND .
4848
%left INSTANCEOF .
49-
%left BITWISE_OR BITWISE_XOR BITWISE_SHIFTLEFT BITWISE_SHIFTRIGHT .
50-
%left EQUALS IDENTICAL LESS GREATER LESSEQUAL GREATEREQUAL NOTIDENTICAL NOTEQUALS .
49+
%left BITWISE_OR .
50+
%left BITWISE_XOR .
51+
%left BITWISE_AND .
52+
%left EQUALS IDENTICAL NOTIDENTICAL NOTEQUALS .
53+
%left LESS GREATER LESSEQUAL GREATEREQUAL .
54+
%left BITWISE_SHIFTLEFT BITWISE_SHIFTRIGHT .
5155
%left ADD SUB CONCAT .
5256
%left MUL DIV MOD .
5357
%right ISSET FETCH EMPTY .
@@ -57,7 +61,6 @@
5761
%right NEW .
5862
%right NOT .
5963
%right BITWISE_NOT .
60-
%left BITWISE_AND .
6164
%right PARENTHESES_CLOSE .
6265
%right SBRACKET_OPEN .
6366
%right ARROW .

tests/operators/bug89.phpt

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
--TEST--
2+
Tests bitwise operators priority
3+
--SKIPIF--
4+
<?php include(__DIR__ . '/../skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
$code =<<<ZEP
9+
function test () {
10+
let t = u & v << 7;
11+
}
12+
ZEP;
13+
14+
var_dump(zephir_parse_file($code, '(eval code)'));
15+
16+
?>
17+
--EXPECT--
18+
array(1) {
19+
[0]=>
20+
array(6) {
21+
["type"]=>
22+
string(8) "function"
23+
["name"]=>
24+
string(4) "test"
25+
["statements"]=>
26+
array(1) {
27+
[0]=>
28+
array(5) {
29+
["type"]=>
30+
string(3) "let"
31+
["assignments"]=>
32+
array(1) {
33+
[0]=>
34+
array(7) {
35+
["assign-type"]=>
36+
string(8) "variable"
37+
["operator"]=>
38+
string(6) "assign"
39+
["variable"]=>
40+
string(1) "t"
41+
["expr"]=>
42+
array(6) {
43+
["type"]=>
44+
string(11) "bitwise_and"
45+
["left"]=>
46+
array(5) {
47+
["type"]=>
48+
string(8) "variable"
49+
["value"]=>
50+
string(1) "u"
51+
["file"]=>
52+
string(11) "(eval code)"
53+
["line"]=>
54+
int(2)
55+
["char"]=>
56+
int(15)
57+
}
58+
["right"]=>
59+
array(6) {
60+
["type"]=>
61+
string(17) "bitwise_shiftleft"
62+
["left"]=>
63+
array(5) {
64+
["type"]=>
65+
string(8) "variable"
66+
["value"]=>
67+
string(1) "v"
68+
["file"]=>
69+
string(11) "(eval code)"
70+
["line"]=>
71+
int(2)
72+
["char"]=>
73+
int(20)
74+
}
75+
["right"]=>
76+
array(5) {
77+
["type"]=>
78+
string(3) "int"
79+
["value"]=>
80+
string(1) "7"
81+
["file"]=>
82+
string(11) "(eval code)"
83+
["line"]=>
84+
int(2)
85+
["char"]=>
86+
int(23)
87+
}
88+
["file"]=>
89+
string(11) "(eval code)"
90+
["line"]=>
91+
int(2)
92+
["char"]=>
93+
int(23)
94+
}
95+
["file"]=>
96+
string(11) "(eval code)"
97+
["line"]=>
98+
int(2)
99+
["char"]=>
100+
int(23)
101+
}
102+
["file"]=>
103+
string(11) "(eval code)"
104+
["line"]=>
105+
int(2)
106+
["char"]=>
107+
int(23)
108+
}
109+
}
110+
["file"]=>
111+
string(11) "(eval code)"
112+
["line"]=>
113+
int(3)
114+
["char"]=>
115+
int(1)
116+
}
117+
}
118+
["file"]=>
119+
string(11) "(eval code)"
120+
["line"]=>
121+
int(1)
122+
["char"]=>
123+
int(9)
124+
}
125+
}

zephir_parser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern zend_module_entry zephir_parser_module_entry;
1515
#define phpext_zephir_parser_ptr &zephir_parser_module_entry
1616

1717
#define PHP_ZEPHIR_PARSER_NAME "Zephir Parser"
18-
#define PHP_ZEPHIR_PARSER_VERSION "1.3.3"
18+
#define PHP_ZEPHIR_PARSER_VERSION "1.3.4"
1919
#define PHP_ZEPHIR_PARSER_AUTHOR "Zephir Team and contributors"
2020
#define PHP_ZEPHIR_PARSER_DESCRIPTION "The Zephir Parser delivered as a C extension for the PHP language."
2121

0 commit comments

Comments
 (0)