summaryrefslogtreecommitdiffstats
path: root/Parser/pgen/grammar.py
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/pgen/grammar.py')
-rw-r--r--Parser/pgen/grammar.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Parser/pgen/grammar.py b/Parser/pgen/grammar.py
index 56188db..ce40e16 100644
--- a/Parser/pgen/grammar.py
+++ b/Parser/pgen/grammar.py
@@ -61,13 +61,14 @@ class Grammar:
def produce_graminit_c(self, writer):
writer("/* Generated by Parser/pgen */\n\n")
+ writer('#include "exports.h"\n')
writer('#include "grammar.h"\n')
- writer("grammar _PyParser_Grammar;\n")
+ writer("Py_EXPORTED_SYMBOL grammar _PyParser_Grammar;\n")
self.print_dfas(writer)
self.print_labels(writer)
- writer("grammar _PyParser_Grammar = {\n")
+ writer("Py_EXPORTED_SYMBOL grammar _PyParser_Grammar = {\n")
writer(" {n_dfas},\n".format(n_dfas=len(self.dfas)))
writer(" dfas,\n")
writer(" {{{n_labels}, labels}},\n".format(n_labels=len(self.labels)))