mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 12:34:35 +04:00
python-pycparser: new package
From the README: pycparser is a parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. This depends on python-ply, which is in PR #1956 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
41
lang/python-pycparser/patches/001-use-external-ply.patch
Normal file
41
lang/python-pycparser/patches/001-use-external-ply.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
|
||||
index cbb9d26..cbd7742 100644
|
||||
--- a/pycparser/c_lexer.py
|
||||
+++ b/pycparser/c_lexer.py
|
||||
@@ -9,8 +9,8 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
-from .ply import lex
|
||||
-from .ply.lex import TOKEN
|
||||
+from ply import lex
|
||||
+from ply.lex import TOKEN
|
||||
|
||||
|
||||
class CLexer(object):
|
||||
diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
|
||||
index f4f7453..5c0ca88 100644
|
||||
--- a/pycparser/c_parser.py
|
||||
+++ b/pycparser/c_parser.py
|
||||
@@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
import re
|
||||
|
||||
-from .ply import yacc
|
||||
+from ply import yacc
|
||||
|
||||
from . import c_ast
|
||||
from .c_lexer import CLexer
|
||||
diff --git a/setup.py b/setup.py
|
||||
index fdccbb3..036a10b 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -49,7 +49,7 @@ setup(
|
||||
classifiers = [
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 3',],
|
||||
- packages=['pycparser', 'pycparser.ply'],
|
||||
+ packages=['pycparser'],
|
||||
package_data={'pycparser': ['*.cfg']},
|
||||
cmdclass={'install': install, 'sdist': sdist},
|
||||
)
|
||||
Reference in New Issue
Block a user