mirror of
https://github.com/python/cpython.git
synced 2025-11-09 14:06:30 +00:00
Reverting last change so we don't have to think about the assert macro
redefinition problem.
This commit is contained in:
parent
350306953a
commit
5947af5ac3
1 changed files with 4 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#include "Python.h"
|
|
||||||
/* Grammar subroutines needed by parser */
|
/* Grammar subroutines needed by parser */
|
||||||
|
|
||||||
#include "pgenheaders.h"
|
#include "pgenheaders.h"
|
||||||
|
|
@ -39,7 +39,7 @@ PyGrammar_LabelRepr(label *lb)
|
||||||
return "EMPTY";
|
return "EMPTY";
|
||||||
else if (ISNONTERMINAL(lb->lb_type)) {
|
else if (ISNONTERMINAL(lb->lb_type)) {
|
||||||
if (lb->lb_str == NULL) {
|
if (lb->lb_str == NULL) {
|
||||||
PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type);
|
sprintf(buf, "NT%d", lb->lb_type);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -49,9 +49,8 @@ PyGrammar_LabelRepr(label *lb)
|
||||||
if (lb->lb_str == NULL)
|
if (lb->lb_str == NULL)
|
||||||
return _PyParser_TokenNames[lb->lb_type];
|
return _PyParser_TokenNames[lb->lb_type];
|
||||||
else {
|
else {
|
||||||
PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)",
|
sprintf(buf, "%.32s(%.32s)",
|
||||||
_PyParser_TokenNames[lb->lb_type],
|
_PyParser_TokenNames[lb->lb_type], lb->lb_str);
|
||||||
lb->lb_str);
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue