Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry BLIND2018-11-14 11:07:12 -0500
committerThierry BLIND2018-12-24 08:20:23 -0500
commitc59437dee2b66db1fa876a1957bdf17e13addd7d (patch)
tree1a6d08a453570b8ad7dfce372df8e59a24576f89
parent7d9ec7107c33ed767796eacd62e79eb2f45f19e0 (diff)
downloadorg.eclipse.pdt-c59437dee2b66db1fa876a1957bdf17e13addd7d.tar.gz
org.eclipse.pdt-c59437dee2b66db1fa876a1957bdf17e13addd7d.tar.xz
org.eclipse.pdt-c59437dee2b66db1fa876a1957bdf17e13addd7d.zip
No bug - various parser rule simplifications and fixes
Change-Id: I4ac2795ead247a66a6a75702c252ed6692ecd992 Signed-off-by: Thierry BLIND <thierryblind@msn.com>
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php5/highlighting_scanner.jflex36
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php53/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php54/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php55/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php56/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php7/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php71/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php72/highlighting_scanner.jflex50
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php73/highlighting_scanner.jflex2
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php53/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php54/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php55/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php56/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php7/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php71/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php72/ast_scanner.flex6
-rw-r--r--plugins/org.eclipse.php.core/Resources/parserTools/parser/php73/ast_scanner.flex4
17 files changed, 88 insertions, 346 deletions
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php5/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php5/highlighting_scanner.jflex
index 236ab7fd9..c2ed119bf 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php5/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php5/highlighting_scanner.jflex
@@ -865,36 +865,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
+ // we must (at least) push the newline character back
+ yypushback(1);
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_DOUBLE_QUOTES,ST_PHP_BACKQUOTE,ST_PHP_HEREDOC,ST_PHP_QUOTES_AFTER_VARIABLE>"{$" {
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php53/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php53/highlighting_scanner.jflex
index de98b7f49..3a92da856 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php53/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php53/highlighting_scanner.jflex
@@ -907,50 +907,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -981,7 +943,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1071,7 +1033,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php54/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php54/highlighting_scanner.jflex
index 0b5dc9b04..513d46f8f 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php54/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php54/highlighting_scanner.jflex
@@ -924,50 +924,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -998,7 +960,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1088,7 +1050,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php55/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php55/highlighting_scanner.jflex
index 7b07fed05..28f80d629 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php55/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php55/highlighting_scanner.jflex
@@ -932,50 +932,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -1006,7 +968,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1096,7 +1058,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php56/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php56/highlighting_scanner.jflex
index 4beb6af6b..6e272f14f 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php56/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php56/highlighting_scanner.jflex
@@ -932,50 +932,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -1006,7 +968,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1096,7 +1058,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php7/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php7/highlighting_scanner.jflex
index e5f212f36..0fc3edb7b 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php7/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php7/highlighting_scanner.jflex
@@ -966,50 +966,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -1040,7 +1002,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1130,7 +1092,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php71/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php71/highlighting_scanner.jflex
index bd1970bb5..366f24fd3 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php71/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php71/highlighting_scanner.jflex
@@ -970,50 +970,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -1044,7 +1006,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1134,7 +1096,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php72/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php72/highlighting_scanner.jflex
index bc69533cb..1ce5acc72 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php72/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php72/highlighting_scanner.jflex
@@ -974,50 +974,12 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_END_HEREDOC>{NEWLINE}*({ANY_CHAR}[^\n\r;])*{LABEL}";"?[\n\r] {
- String yytext = yytext();
- int label_len = yylength() - 1;
- int startIndex = 0;
- if (yytext.charAt(label_len - 1) == ';') {
- label_len--;
- }
- while (yytext.charAt(startIndex) == '\r'
- || yytext.charAt(startIndex) == '\n') {
- startIndex++;
- }
-
- String heredoc = getHeredocId();
- int heredoc_len = heredoc.length();
- if (label_len > heredoc_len && startIndex > 0
- && yytext.substring(startIndex, label_len).equals(
- heredoc)
- && (yytext.charAt(startIndex - 1) == '\n'
- || yytext.charAt(startIndex - 1) == '\r')) {
- // we must (at least) push the newline character back
- yypushback(1);
- popHeredocId();
- popState();
- return PHP_HEREDOC_CLOSE_TAG;
- } else {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
- }
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*{LABEL}({TABS_AND_SPACES}[^\n\r])+";"?[\n\r] {
+<ST_PHP_END_HEREDOC>{NEWLINE}{LABEL}";"?[\n\r] {
// we must (at least) push the newline character back
yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
-}
-
-<ST_PHP_END_HEREDOC>{NEWLINE}*({TABS_AND_SPACES}[^\n\r])+{LABEL}";"?[\n\r] {
- // we must (at least) push the newline character back
- yypushback(1);
- yybegin(ST_PHP_HEREDOC);
- return PHP_ENCAPSED_AND_WHITESPACE;
+ popHeredocId();
+ popState();
+ return PHP_HEREDOC_CLOSE_TAG;
}
<ST_PHP_START_NOWDOC>{ANY_CHAR} {
@@ -1048,7 +1010,7 @@ PHP_OPERATOR="=>"|"++"|"--"|"==="|"!=="|"=="|"!="|"<>"|"<="|">="|"+="|"-="|"*="|
}
}
-<ST_PHP_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int label_len = yylength() - 1;
@@ -1138,7 +1100,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({HEREDOC_NEWLINE}+({LABEL}";"?)?)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php73/highlighting_scanner.jflex b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php73/highlighting_scanner.jflex
index ebfdaca75..e033d5e35 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php73/highlighting_scanner.jflex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/highlighting/php73/highlighting_scanner.jflex
@@ -1097,7 +1097,7 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return PHP_ENCAPSED_AND_WHITESPACE;
}
-<ST_PHP_NOWDOC>{NOWDOC_CHARS}*(({HEREDOC_NEWLINE}{TABS_AND_SPACES})+)? {
+<ST_PHP_NOWDOC>{NOWDOC_CHARS}*(({NEWLINE}{TABS_AND_SPACES})+)? {
return PHP_CONSTANT_ENCAPSED_STRING;
}
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php53/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php53/ast_scanner.flex
index 08bc09a41..8d602aeda 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php53/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php53/ast_scanner.flex
@@ -1142,7 +1142,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1226,6 +1226,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php54/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php54/ast_scanner.flex
index c557c2bba..92c59b0c5 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php54/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php54/ast_scanner.flex
@@ -1159,7 +1159,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1243,6 +1243,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php55/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php55/ast_scanner.flex
index 7cecd480e..ce45257e7 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php55/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php55/ast_scanner.flex
@@ -1167,7 +1167,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1251,6 +1251,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php56/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php56/ast_scanner.flex
index 13edc6a54..34d545971 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php56/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php56/ast_scanner.flex
@@ -1177,7 +1177,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1261,6 +1261,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php7/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php7/ast_scanner.flex
index 704680dfc..2007e6334 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php7/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php7/ast_scanner.flex
@@ -1189,7 +1189,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1273,6 +1273,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php71/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php71/ast_scanner.flex
index 308bb6857..1dcde6f6f 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php71/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php71/ast_scanner.flex
@@ -1189,7 +1189,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1273,6 +1273,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php72/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php72/ast_scanner.flex
index 30c244b03..1338b109e 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php72/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php72/ast_scanner.flex
@@ -1189,7 +1189,7 @@ if (parsePHPDoc()) {
}
}
-<ST_NOWDOC>({NOWDOC_CHARS}+{NEWLINE}+|{NEWLINE}+){LABEL}";"?[\n\r] {
+<ST_NOWDOC>{NOWDOC_CHARS}*{NEWLINE}+{LABEL}";"?[\n\r] {
String yytext = yytext();
int nb_pushback;
if (yytext.charAt(yytext.length() - 2) == ';') {
@@ -1273,6 +1273,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*({NEWLINE}+({LABEL}";"?)?)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);
diff --git a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php73/ast_scanner.flex b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php73/ast_scanner.flex
index b2bfadce5..eae4a7288 100644
--- a/plugins/org.eclipse.php.core/Resources/parserTools/parser/php73/ast_scanner.flex
+++ b/plugins/org.eclipse.php.core/Resources/parserTools/parser/php73/ast_scanner.flex
@@ -1275,6 +1275,10 @@ but jflex doesn't support a{n,} so we changed a{2,} to aa+
return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
}
+<ST_NOWDOC>{NOWDOC_CHARS}*(({NEWLINE}{TABS_AND_SPACES})+)? {
+ return createFullSymbol(ParserConstants.T_ENCAPSED_AND_WHITESPACE);
+}
+
<ST_DOUBLE_QUOTES>[\"] {
yybegin(ST_IN_SCRIPTING);
return createSymbol(ParserConstants.T_QUATE);

Back to the top