summaryrefslogtreecommitdiffstats
path: root/Parser/grammar1.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-09 16:14:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-09 16:14:21 (GMT)
commit7f14f0d8a0228c50d5b5de2acbfe9a64ebc6749a (patch)
treed25489e9531c01f1e9244012bbfaa929f382883e /Parser/grammar1.c
parentb7d943625cf4353f6cb72df16252759f2dbd8e06 (diff)
downloadcpython-7f14f0d8a0228c50d5b5de2acbfe9a64ebc6749a.zip
cpython-7f14f0d8a0228c50d5b5de2acbfe9a64ebc6749a.tar.gz
cpython-7f14f0d8a0228c50d5b5de2acbfe9a64ebc6749a.tar.bz2
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
Diffstat (limited to 'Parser/grammar1.c')
-rw-r--r--Parser/grammar1.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/Parser/grammar1.c b/Parser/grammar1.c
index b76719a..1f7d264 100644
--- a/Parser/grammar1.c
+++ b/Parser/grammar1.c
@@ -11,47 +11,47 @@
dfa *
PyGrammar_FindDFA(grammar *g, register int type)
{
- register dfa *d;
+ register dfa *d;
#if 1
- /* Massive speed-up */
- d = &g->g_dfa[type - NT_OFFSET];
- assert(d->d_type == type);
- return d;
+ /* Massive speed-up */
+ d = &g->g_dfa[type - NT_OFFSET];
+ assert(d->d_type == type);
+ return d;
#else
- /* Old, slow version */
- register int i;
-
- for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) {
- if (d->d_type == type)
- return d;
- }
- assert(0);
- /* NOTREACHED */
+ /* Old, slow version */
+ register int i;
+
+ for (i = g->g_ndfas, d = g->g_dfa; --i >= 0; d++) {
+ if (d->d_type == type)
+ return d;
+ }
+ assert(0);
+ /* NOTREACHED */
#endif
}
char *
PyGrammar_LabelRepr(label *lb)
{
- static char buf[100];
-
- if (lb->lb_type == ENDMARKER)
- return "EMPTY";
- else if (ISNONTERMINAL(lb->lb_type)) {
- if (lb->lb_str == NULL) {
- PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type);
- return buf;
- }
- else
- return lb->lb_str;
- }
- else {
- if (lb->lb_str == NULL)
- return _PyParser_TokenNames[lb->lb_type];
- else {
- PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)",
- _PyParser_TokenNames[lb->lb_type], lb->lb_str);
- return buf;
- }
- }
+ static char buf[100];
+
+ if (lb->lb_type == ENDMARKER)
+ return "EMPTY";
+ else if (ISNONTERMINAL(lb->lb_type)) {
+ if (lb->lb_str == NULL) {
+ PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type);
+ return buf;
+ }
+ else
+ return lb->lb_str;
+ }
+ else {
+ if (lb->lb_str == NULL)
+ return _PyParser_TokenNames[lb->lb_type];
+ else {
+ PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)",
+ _PyParser_TokenNames[lb->lb_type], lb->lb_str);
+ return buf;
+ }
+ }
}