Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Unified Diff: Parser/grammar1.c

Issue 3353: make built-in tokenizer available via Python C API
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Parser/firstsets.c ('k') | Parser/grammar.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Parser/grammar1.c
+++ b/Parser/grammar1.c
@@ -14,7 +14,7 @@ PyGrammar_FindDFA(grammar *g, int type)
dfa *d;
#if 1
/* Massive speed-up */
- d = &g->g_dfa[type - NT_OFFSET];
+ d = &g->g_dfa[type - PYTOK_NT_OFFSET];
assert(d->d_type == type);
return d;
#else
@@ -35,9 +35,9 @@ PyGrammar_LabelRepr(label *lb)
{
static char buf[100];
- if (lb->lb_type == ENDMARKER)
+ if (lb->lb_type == PYTOK_ENDMARKER)
return "EMPTY";
- else if (ISNONTERMINAL(lb->lb_type)) {
+ else if (PYTOK_ISNONTERMINAL(lb->lb_type)) {
if (lb->lb_str == NULL) {
PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type);
return buf;
@@ -45,7 +45,7 @@ PyGrammar_LabelRepr(label *lb)
else
return lb->lb_str;
}
- else if (lb->lb_type < N_TOKENS) {
+ else if (lb->lb_type < PYTOK_N_TOKENS) {
if (lb->lb_str == NULL)
return _PyParser_TokenNames[lb->lb_type];
else {
« no previous file with comments | « Parser/firstsets.c ('k') | Parser/grammar.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+