Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 701878 | Differences between
and this patch

Collapse All | Expand All

(-)a/pycparser/_build_tables.py (+2 lines)
Lines 25-30 from pycparser import c_parser Link Here
25
25
26
# Generates the tables
26
# Generates the tables
27
#
27
#
28
print(">>> calling cparser")
28
c_parser.CParser(
29
c_parser.CParser(
29
    lex_optimize=True,
30
    lex_optimize=True,
30
    yacc_debug=False,
31
    yacc_debug=False,
Lines 32-37 c_parser.CParser( Link Here
32
33
33
# Load to compile into .pyc
34
# Load to compile into .pyc
34
#
35
#
36
print(">>> importing")
35
import lextab
37
import lextab
36
import yacctab
38
import yacctab
37
import c_ast
39
import c_ast
(-)a/pycparser/ply/lex.py (+6 lines)
Lines 204-209 class Lexer: Link Here
204
            for statename, ef in self.lexstateeoff.items():
204
            for statename, ef in self.lexstateeoff.items():
205
                tabeof[statename] = ef.__name__ if ef else None
205
                tabeof[statename] = ef.__name__ if ef else None
206
            tf.write('_lexstateeoff = %s\n' % repr(tabeof))
206
            tf.write('_lexstateeoff = %s\n' % repr(tabeof))
207
        print(f">>> written into {filename}")
207
208
208
    # ------------------------------------------------------------
209
    # ------------------------------------------------------------
209
    # readtab() - Read lexer information from a tab file
210
    # readtab() - Read lexer information from a tab file
Lines 862-867 class LexerReflect(object): Link Here
862
# -----------------------------------------------------------------------------
863
# -----------------------------------------------------------------------------
863
def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab',
864
def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab',
864
        reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None):
865
        reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None):
866
    print(">>> in ply.lex")
865
867
866
    if lextab is None:
868
    if lextab is None:
867
        lextab = 'lextab'
869
        lextab = 'lextab'
Lines 910-915 def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', Link Here
910
            raise SyntaxError("Can't build lexer")
912
            raise SyntaxError("Can't build lexer")
911
913
912
    if optimize and lextab:
914
    if optimize and lextab:
915
        print(f">>> reading {lextab}")
913
        try:
916
        try:
914
            lexobj.readtab(lextab, ldict)
917
            lexobj.readtab(lextab, ldict)
915
            token = lexobj.token
918
            token = lexobj.token
Lines 918-923 def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', Link Here
918
            return lexobj
921
            return lexobj
919
922
920
        except ImportError:
923
        except ImportError:
924
            print(">>> import failed")
921
            pass
925
            pass
922
926
923
    # Dump some basic debugging information
927
    # Dump some basic debugging information
Lines 1040-1047 def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', Link Here
1040
                    srcfile = getattr(sys.modules[pkgname], '__file__', '')
1044
                    srcfile = getattr(sys.modules[pkgname], '__file__', '')
1041
            outputdir = os.path.dirname(srcfile)
1045
            outputdir = os.path.dirname(srcfile)
1042
        try:
1046
        try:
1047
            print(f">>> writing {lextab}")
1043
            lexobj.writetab(lextab, outputdir)
1048
            lexobj.writetab(lextab, outputdir)
1044
        except IOError as e:
1049
        except IOError as e:
1050
            print(f">>> failed: {e}")
1045
            errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e))
1051
            errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e))
1046
1052
1047
    return lexobj
1053
    return lexobj
(-)a/setup.py (+2 lines)
Lines 21-28 def _run_build_tables(dir): Link Here
21
class install(_install):
21
class install(_install):
22
    def run(self):
22
    def run(self):
23
        _install.run(self)
23
        _install.run(self)
24
        print(">>> before exec")
24
        self.execute(_run_build_tables, (self.install_lib,),
25
        self.execute(_run_build_tables, (self.install_lib,),
25
                     msg="Build the lexing/parsing tables")
26
                     msg="Build the lexing/parsing tables")
27
        print(">>> after exec")
26
28
27
29
28
class sdist(_sdist):
30
class sdist(_sdist):

Return to bug 701878