com php-src: Reindent zend_yytnamerr: Zend/zend_languag e_parser.y
| From: | Anatol Belski | Date: | Sun, 18 Oct 2015 10:41:26 +0000 |
| Subject: | com php-src: Reindent zend_yytnamerr: Zend/zend_languag e_parser.y | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89514@lists.php.net to get a copy of this message | ||
Commit: d449c527bc168a8aef4779a541c84f3b93bc514a
Author: Nikita Popov <nikic@php.net> Thu, 15 Oct 2015 21:23:29 +0200
Committer: Anatol Belski <ab@php.net> Sun, 18 Oct 2015 12:41:26 +0200
Parents: 63730a698177fe706a8d35754d5202c1437afa0c
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d449c527bc168a8aef4779a541c84f3b93bc514a
Log:
Reindent zend_yytnamerr
Separating this whitespace change from the next diff.
Changed paths:
M Zend/zend_language_parser.y
Diff:
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index dde7635..a253a76 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -1281,46 +1281,44 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
if (!yyres) {
return yystrlen(yystr);
}
- {
- if (CG(parse_error) == 0) {
- char buffer[120];
- const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
- unsigned int len = 0, toklen = 0, yystr_len;
-
- CG(parse_error) = 1;
-
- if (LANG_SCNG(yy_text)[0] == 0 &&
- LANG_SCNG(yy_leng) == 1 &&
- memcmp(yystr, "\"end of file\"", sizeof("\"end of
file\"") - 1) == 0) {
- yystpcpy(yyres, "end of file");
- return sizeof("end of file")-1;
- }
-
- str = LANG_SCNG(yy_text);
- end = memchr(str, '\n', LANG_SCNG(yy_leng));
- yystr_len = (unsigned int)yystrlen(yystr);
-
- if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
- && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
- toklen = (tok2 - tok1) + 1;
- } else {
- tok1 = tok2 = NULL;
- toklen = 0;
- }
-
- if (end == NULL) {
- len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
- } else {
- len = (end - str) > 30 ? 30 : (end - str);
- }
- if (toklen) {
- snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
- } else {
- snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
- }
- yystpcpy(yyres, buffer);
- return len + (toklen ? toklen + 1 : 0) + 2;
+ if (CG(parse_error) == 0) {
+ char buffer[120];
+ const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
+ unsigned int len = 0, toklen = 0, yystr_len;
+
+ CG(parse_error) = 1;
+
+ if (LANG_SCNG(yy_text)[0] == 0 &&
+ LANG_SCNG(yy_leng) == 1 &&
+ memcmp(yystr, "\"end of file\"", sizeof("\"end of
file\"") - 1) == 0) {
+ yystpcpy(yyres, "end of file");
+ return sizeof("end of file")-1;
}
+
+ str = LANG_SCNG(yy_text);
+ end = memchr(str, '\n', LANG_SCNG(yy_leng));
+ yystr_len = (unsigned int)yystrlen(yystr);
+
+ if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
+ && (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
+ toklen = (tok2 - tok1) + 1;
+ } else {
+ tok1 = tok2 = NULL;
+ toklen = 0;
+ }
+
+ if (end == NULL) {
+ len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
+ } else {
+ len = (end - str) > 30 ? 30 : (end - str);
+ }
+ if (toklen) {
+ snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
+ } else {
+ snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
+ }
+ yystpcpy(yyres, buffer);
+ return len + (toklen ? toklen + 1 : 0) + 2;
}
if (*yystr == '"') {
YYSIZE_T yyn = 0;