summaryrefslogtreecommitdiffstats
path: root/Parser/acceler.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/acceler.c')
-rw-r--r--Parser/acceler.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Parser/acceler.c b/Parser/acceler.c
index 9417b76..9b72023 100644
--- a/Parser/acceler.c
+++ b/Parser/acceler.c
@@ -68,6 +68,26 @@ PyGrammar_AddAccelerators(g)
#endif
}
+void
+PyGrammar_RemoveAccelerators(g)
+ grammar *g;
+{
+ dfa *d;
+ int i;
+ g->g_accel = 0;
+ d = g->g_dfa;
+ for (i = g->g_ndfas; --i >= 0; d++) {
+ state *s;
+ int j;
+ s = d->d_state;
+ for (j = 0; j < d->d_nstates; j++, s++) {
+ if (s->s_accel)
+ PyMem_DEL(s->s_accel);
+ s->s_accel = NULL;
+ }
+ }
+}
+
static void
fixdfa(g, d)
grammar *g;