Skip to content

Commit dd9fb8e

Browse files
committed
Add re2c patches
1 parent 90a0495 commit dd9fb8e

File tree

3 files changed

+198
-0
lines changed

3 files changed

+198
-0
lines changed

patches/8.3/re2c.patch

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From: Peter Kokot <[email protected]>
2+
Subject: Fix re2c -Wuseless-escape warnings
3+
4+
re2c version 4 enables some warnigns by default. This fixes the
5+
-Wuseless-escape warnings.
6+
---
7+
Zend/zend_ini_scanner.l | 6 +++---
8+
Zend/zend_language_scanner.l | 4 ++--
9+
sapi/phpdbg/phpdbg_lexer.l | 2 +-
10+
3 files changed, 6 insertions(+), 6 deletions(-)
11+
12+
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
13+
index 44159297a0..b87f4e33cc 100644
14+
--- a/Zend/zend_ini_scanner.l
15+
+++ b/Zend/zend_ini_scanner.l
16+
@@ -352,16 +352,16 @@ restart:
17+
/*!re2c
18+
re2c:yyfill:check = 0;
19+
LNUM [0-9]+
20+
-DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
21+
+DNUM ([0-9]*[.][0-9]+)|([0-9]+[.][0-9]*)
22+
NUMBER [-]?{LNUM}|{DNUM}
23+
ANY_CHAR (.|[\n\t])
24+
NEWLINE ("\r"|"\n"|"\r\n")
25+
TABS_AND_SPACES [ \t]
26+
WHITESPACE [ \t]+
27+
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
28+
-LABEL_CHAR [^=\n\r\t;&|^$~(){}!"\[\]\x00]
29+
+LABEL_CHAR [^=\n\r\t;&|^$~(){}!"[\]\x00]
30+
LABEL ({LABEL_CHAR}+)
31+
-TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
32+
+TOKENS [:,.[\]"'()&|^+-/*=%$!~<>?@{}]
33+
OPERATORS [&|^~()!]
34+
DOLLAR_CURLY "${"
35+
36+
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
37+
index 25e1ecbca6..3ea51fe7c9 100644
38+
--- a/Zend/zend_language_scanner.l
39+
+++ b/Zend/zend_language_scanner.l
40+
@@ -1801,11 +1801,11 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
41+
RETURN_TOKEN(T_MUL_EQUAL);
42+
}
43+
44+
-<ST_IN_SCRIPTING>"*\*" {
45+
+<ST_IN_SCRIPTING>"**" {
46+
RETURN_TOKEN(T_POW);
47+
}
48+
49+
-<ST_IN_SCRIPTING>"*\*=" {
50+
+<ST_IN_SCRIPTING>"**=" {
51+
RETURN_TOKEN(T_POW_EQUAL);
52+
}
53+
54+
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
55+
index 6245262a00..bcfefcba81 100644
56+
--- a/sapi/phpdbg/phpdbg_lexer.l
57+
+++ b/sapi/phpdbg/phpdbg_lexer.l
58+
@@ -77,7 +77,7 @@ T_IF 'if'
59+
T_RUN 'run'
60+
T_RUN_SHORT "r"
61+
WS [ \r\t]+
62+
-DIGITS [-]?[0-9\.]+
63+
+DIGITS [-]?[0-9.]+
64+
ID [^ \r\n\t:#\000]+
65+
GENERIC_ID ([^ \r\n\t:#\000"']|":\\")+|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+[']
66+
ADDR [0][x][a-fA-F0-9]+

patches/8.4/re2c.patch

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From: Peter Kokot <[email protected]>
2+
Subject: Fix re2c -Wuseless-escape warnings
3+
4+
re2c version 4 enables some warnigns by default. This fixes the
5+
-Wuseless-escape warnings.
6+
---
7+
Zend/zend_ini_scanner.l | 6 +++---
8+
Zend/zend_language_scanner.l | 4 ++--
9+
sapi/phpdbg/phpdbg_lexer.l | 2 +-
10+
3 files changed, 6 insertions(+), 6 deletions(-)
11+
12+
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
13+
index 44159297a0..b87f4e33cc 100644
14+
--- a/Zend/zend_ini_scanner.l
15+
+++ b/Zend/zend_ini_scanner.l
16+
@@ -352,16 +352,16 @@ restart:
17+
/*!re2c
18+
re2c:yyfill:check = 0;
19+
LNUM [0-9]+
20+
-DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
21+
+DNUM ([0-9]*[.][0-9]+)|([0-9]+[.][0-9]*)
22+
NUMBER [-]?{LNUM}|{DNUM}
23+
ANY_CHAR (.|[\n\t])
24+
NEWLINE ("\r"|"\n"|"\r\n")
25+
TABS_AND_SPACES [ \t]
26+
WHITESPACE [ \t]+
27+
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
28+
-LABEL_CHAR [^=\n\r\t;&|^$~(){}!"\[\]\x00]
29+
+LABEL_CHAR [^=\n\r\t;&|^$~(){}!"[\]\x00]
30+
LABEL ({LABEL_CHAR}+)
31+
-TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
32+
+TOKENS [:,.[\]"'()&|^+-/*=%$!~<>?@{}]
33+
OPERATORS [&|^~()!]
34+
DOLLAR_CURLY "${"
35+
36+
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
37+
index 7ae7387592..988ec6366a 100644
38+
--- a/Zend/zend_language_scanner.l
39+
+++ b/Zend/zend_language_scanner.l
40+
@@ -1813,11 +1813,11 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
41+
RETURN_TOKEN(T_MUL_EQUAL);
42+
}
43+
44+
-<ST_IN_SCRIPTING>"*\*" {
45+
+<ST_IN_SCRIPTING>"**" {
46+
RETURN_TOKEN(T_POW);
47+
}
48+
49+
-<ST_IN_SCRIPTING>"*\*=" {
50+
+<ST_IN_SCRIPTING>"**=" {
51+
RETURN_TOKEN(T_POW_EQUAL);
52+
}
53+
54+
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
55+
index 6245262a00..bcfefcba81 100644
56+
--- a/sapi/phpdbg/phpdbg_lexer.l
57+
+++ b/sapi/phpdbg/phpdbg_lexer.l
58+
@@ -77,7 +77,7 @@ T_IF 'if'
59+
T_RUN 'run'
60+
T_RUN_SHORT "r"
61+
WS [ \r\t]+
62+
-DIGITS [-]?[0-9\.]+
63+
+DIGITS [-]?[0-9.]+
64+
ID [^ \r\n\t:#\000]+
65+
GENERIC_ID ([^ \r\n\t:#\000"']|":\\")+|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+[']
66+
ADDR [0][x][a-fA-F0-9]+

patches/8.5/re2c.patch

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
From: Peter Kokot <[email protected]>
2+
Subject: Fix re2c -Wuseless-escape warnings
3+
4+
re2c version 4 enables some warnigns by default. This fixes the
5+
-Wuseless-escape warnings.
6+
---
7+
Zend/zend_ini_scanner.l | 6 +++---
8+
Zend/zend_language_scanner.l | 4 ++--
9+
sapi/phpdbg/phpdbg_lexer.l | 2 +-
10+
3 files changed, 6 insertions(+), 6 deletions(-)
11+
12+
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
13+
index 44159297a0..b87f4e33cc 100644
14+
--- a/Zend/zend_ini_scanner.l
15+
+++ b/Zend/zend_ini_scanner.l
16+
@@ -352,16 +352,16 @@ restart:
17+
/*!re2c
18+
re2c:yyfill:check = 0;
19+
LNUM [0-9]+
20+
-DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*)
21+
+DNUM ([0-9]*[.][0-9]+)|([0-9]+[.][0-9]*)
22+
NUMBER [-]?{LNUM}|{DNUM}
23+
ANY_CHAR (.|[\n\t])
24+
NEWLINE ("\r"|"\n"|"\r\n")
25+
TABS_AND_SPACES [ \t]
26+
WHITESPACE [ \t]+
27+
CONSTANT [a-zA-Z_][a-zA-Z0-9_]*
28+
-LABEL_CHAR [^=\n\r\t;&|^$~(){}!"\[\]\x00]
29+
+LABEL_CHAR [^=\n\r\t;&|^$~(){}!"[\]\x00]
30+
LABEL ({LABEL_CHAR}+)
31+
-TOKENS [:,.\[\]"'()&|^+-/*=%$!~<>?@{}]
32+
+TOKENS [:,.[\]"'()&|^+-/*=%$!~<>?@{}]
33+
OPERATORS [&|^~()!]
34+
DOLLAR_CURLY "${"
35+
36+
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
37+
index 7ae7387592..988ec6366a 100644
38+
--- a/Zend/zend_language_scanner.l
39+
+++ b/Zend/zend_language_scanner.l
40+
@@ -1813,11 +1813,11 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
41+
RETURN_TOKEN(T_MUL_EQUAL);
42+
}
43+
44+
-<ST_IN_SCRIPTING>"*\*" {
45+
+<ST_IN_SCRIPTING>"**" {
46+
RETURN_TOKEN(T_POW);
47+
}
48+
49+
-<ST_IN_SCRIPTING>"*\*=" {
50+
+<ST_IN_SCRIPTING>"**=" {
51+
RETURN_TOKEN(T_POW_EQUAL);
52+
}
53+
54+
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
55+
index 6245262a00..bcfefcba81 100644
56+
--- a/sapi/phpdbg/phpdbg_lexer.l
57+
+++ b/sapi/phpdbg/phpdbg_lexer.l
58+
@@ -77,7 +77,7 @@ T_IF 'if'
59+
T_RUN 'run'
60+
T_RUN_SHORT "r"
61+
WS [ \r\t]+
62+
-DIGITS [-]?[0-9\.]+
63+
+DIGITS [-]?[0-9.]+
64+
ID [^ \r\n\t:#\000]+
65+
GENERIC_ID ([^ \r\n\t:#\000"']|":\\")+|["]([^\n\000"\\]|"\\\\"|"\\"["])+["]|[']([^\n\000'\\]|"\\\\"|"\\"['])+[']
66+
ADDR [0][x][a-fA-F0-9]+

0 commit comments

Comments
 (0)