#include "node.h"
#include "parser.h"
#include "errcode.h"
+#include "graminit.h"
#ifdef Py_DEBUG
/* Push non-terminal */
int nt = (x >> 8) + NT_OFFSET;
int arrow = x & ((1<<7)-1);
- dfa *d1 = PyGrammar_FindDFA(
+ dfa *d1;
+ if (nt == func_body_suite && !(ps->p_flags & PyCF_TYPE_COMMENTS)) {
+ D(printf(" [switch func_body_suite to suite]"));
+ nt = suite;
+ }
+ d1 = PyGrammar_FindDFA(
ps->p_grammar, nt);
if ((err = push(&ps->p_stack, nt, d1,
arrow, lineno, col_offset,
D(printf(" MemError: push\n"));
return err;
}
- D(printf(" Push ...\n"));
+ D(printf(" Push '%s'\n", d1->d_name));
continue;
}
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
if (*flags & PyPARSE_BARRY_AS_BDFL)
ps->p_flags |= CO_FUTURE_BARRY_AS_BDFL;
+ if (*flags & PyPARSE_TYPE_COMMENTS)
+ ps->p_flags |= PyCF_TYPE_COMMENTS;
#endif
for (;;) {