Skip to content

Commit 5f65387

Browse files
author
whitequark
committedMay 25, 2015
Rename to pythonparser (pyparser is occupied in pypi).
1 parent 9ffba43 commit 5f65387

20 files changed

+53
-53
lines changed
 

Diff for: ‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ _build/
44
*.egg-info/
55
/build/
66
/dist/
7-
/pyparser/coverage/parser.py
7+
/pythonparser/coverage/parser.py
88
/doc/coverage/*

Diff for: ‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See http://m-labs.hk/pyparser/.
1+
See http://m-labs.hk/pythonparser/.

Diff for: ‎doc/index.rst

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
PyParser documentation
2-
======================
1+
PythonParser documentation
2+
==========================
33

4-
PyParser is a Python parser written specifically for use in tooling.
4+
PythonParser is a Python parser written specifically for use in tooling.
55
It parses source code into an AST that is a superset of Python's
66
built-in :mod:`ast` module, but returns precise location information
77
for every token.
88

9-
The most useful APIs of PyParser are :meth:`pyparser.parse`,
10-
which parses the source, :mod:`pyparser.ast`, which provides access
9+
The most useful APIs of PyParser are :meth:`pythonparser.parse`,
10+
which parses the source, :mod:`pythonparser.ast`, which provides access
1111
to the semantic and location information in the AST, and
12-
:mod:`pyparser.diagnostic.Engine`, which provides a unified way
12+
:mod:`pythonparser.diagnostic.Engine`, which provides a unified way
1313
to report errors and warnings both to PyParser itself and to any
14-
code that consumes the ASTs. The :class:`pyparser.source.Range` class,
14+
code that consumes the ASTs. The :class:`pythonparser.source.Range` class,
1515
instances of which are contained in the AST, allows to extract
1616
location information in various convenient formats.
1717

18-
The :mod:`pyparser.algorithm` module contains some useful algorithms
18+
The :mod:`pythonparser.algorithm` module contains some useful algorithms
1919
to manipulate ASTs.
2020

2121
If a consumer of ASTs wishes to modify the original source without
22-
losing formatting, it can use :class:`pyparser.source.Rewriter`
22+
losing formatting, it can use :class:`pythonparser.source.Rewriter`
2323
to insert code fragments around or instead of a known
24-
:class:`pyparser.source.Range`. If the AST is not expected to
24+
:class:`pythonparser.source.Range`. If the AST is not expected to
2525
change after the modification, it is recommended to re-parse
2626
the result and compare it to the original AST using
27-
:meth:`pyparser.algorithm.compare`.
27+
:meth:`pythonparser.algorithm.compare`.
2828

2929
For some applications, e.g. syntax highlighting,
30-
:class:`pyparser.lexer.Lexer` will be able to provide a raw
30+
:class:`pythonparser.lexer.Lexer` will be able to provide a raw
3131
stream of tokens.
3232

3333
PyParser is licensed under 3-clause BSD.
3434

35-
:mod:`pyparser` Module
36-
----------------------
35+
:mod:`pythonparser` Module
36+
--------------------------
3737

38-
.. automodule:: pyparser
38+
.. automodule:: pythonparser
3939
:members:
4040

41-
:mod:`pyparser.source` Module
42-
-----------------------------
41+
:mod:`pythonparser.source` Module
42+
---------------------------------
4343

44-
.. automodule:: pyparser.source
44+
.. automodule:: pythonparser.source
4545
:members:
4646
:show-inheritance:
4747

48-
:mod:`pyparser.diagnostic` Module
49-
---------------------------------
48+
:mod:`pythonparser.diagnostic` Module
49+
-------------------------------------
5050

51-
.. automodule:: pyparser.diagnostic
51+
.. automodule:: pythonparser.diagnostic
5252
:members:
5353
:show-inheritance:
5454

55-
:mod:`pyparser.lexer` Module
56-
----------------------------
55+
:mod:`pythonparser.lexer` Module
56+
--------------------------------
5757

58-
.. automodule:: pyparser.lexer
58+
.. automodule:: pythonparser.lexer
5959
:members:
6060
:show-inheritance:
6161

62-
:mod:`pyparser.ast` Module
63-
--------------------------
62+
:mod:`pythonparser.ast` Module
63+
------------------------------
6464

65-
.. automodule:: pyparser.ast
65+
.. automodule:: pythonparser.ast
6666
:members: commonloc, beginendloc, keywordloc,
6767
AST,
6868
alias,
@@ -87,9 +87,9 @@ PyParser is licensed under 3-clause BSD.
8787
withitem
8888
:show-inheritance:
8989

90-
:mod:`pyparser.algorithm` Module
91-
--------------------------------
90+
:mod:`pythonparser.algorithm` Module
91+
------------------------------------
9292

93-
.. automodule:: pyparser.algorithm
93+
.. automodule:: pythonparser.algorithm
9494
:members:
9595
:show-inheritance:

Diff for: ‎examples/quot_to_dquot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys, re
2-
from pyparser import source, lexer
2+
from pythonparser import source, lexer
33

44
buf = None
55
with open(sys.argv[1]) as f:

Diff for: ‎pyparser/__init__.py renamed to ‎pythonparser/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import absolute_import, division, print_function, unicode_literals
2-
import sys, pyparser.source, pyparser.lexer, pyparser.parser, pyparser.diagnostic
2+
import sys, pythonparser.source, pythonparser.lexer, pythonparser.parser, pythonparser.diagnostic
33

44
def parse(source, filename='<unknown>', mode='exec',
55
flags=[], version=None, engine=None):
@@ -28,15 +28,15 @@ def parse(source, filename='<unknown>', mode='exec',
2828
version = sys.version_info[0:2]
2929

3030
if engine is None:
31-
engine = pyparser.diagnostic.Engine()
31+
engine = pythonparser.diagnostic.Engine()
3232

33-
buffer = pyparser.source.Buffer(source, filename)
33+
buffer = pythonparser.source.Buffer(source, filename)
3434

35-
lexer = pyparser.lexer.Lexer(buffer, version, engine)
35+
lexer = pythonparser.lexer.Lexer(buffer, version, engine)
3636
if mode in ('single', 'eval'):
3737
lexer.interactive = True
3838

39-
parser = pyparser.parser.Parser(lexer, version, engine)
39+
parser = pythonparser.parser.Parser(lexer, version, engine)
4040
parser.add_flags(flags)
4141

4242
if mode == 'exec':
File renamed without changes.
File renamed without changes.

Diff for: ‎pyparser/ast.py renamed to ‎pythonparser/ast.py

File renamed without changes.

Diff for: ‎pyparser/coverage/__init__.py renamed to ‎pythonparser/coverage/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,6 @@ def report(parser, name='parser'):
175175
file=os.path.basename(_buf.name),
176176
content=content))
177177

178-
# Create the instrumented parser when `import pyparser.coverage.parser`
178+
# Create the instrumented parser when `import pythonparser.coverage.parser`
179179
# is invoked. Not intended for any use except running the internal testsuite.
180180
instrument()

Diff for: ‎pyparser/diagnostic.py renamed to ‎pythonparser/diagnostic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class Diagnostic:
1414
:ivar level: (one of ``LEVELS``) severity level
1515
:ivar reason: (format string) diagnostic message
1616
:ivar arguments: (dictionary) substitutions for ``reason``
17-
:ivar location: (:class:`pyparser.source.Range`) most specific
17+
:ivar location: (:class:`pythonparser.source.Range`) most specific
1818
location of the problem
19-
:ivar highlights: (list of :class:`pyparser.source.Range`)
19+
:ivar highlights: (list of :class:`pythonparser.source.Range`)
2020
secondary locations related to the problem that are
2121
likely to be on the same line
2222
:ivar notes: (list of :class:`Diagnostic`)

Diff for: ‎pyparser/lexer.py renamed to ‎pythonparser/lexer.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Token:
1616
The :class:`Token` encapsulates a single lexer token and its location
1717
in the source code.
1818
19-
:ivar loc: (:class:`pyparser.source.Range`) token location
19+
:ivar loc: (:class:`pythonparser.source.Range`) token location
2020
:ivar kind: (string) token kind
2121
:ivar value: token value; None or a kind-specific class
2222
"""
@@ -29,15 +29,15 @@ def __repr__(self):
2929
class Lexer:
3030
"""
3131
The :class:`Lexer` class extracts tokens and comments from
32-
a :class:`pyparser.source.Buffer`.
32+
a :class:`pythonparser.source.Buffer`.
3333
3434
:class:`Lexer` is an iterable.
3535
3636
:ivar version: (tuple of (*major*, *minor*))
3737
the version of Python, determining the grammar used
38-
:ivar source_buffer: (:class:`pyparser.source.Buffer`)
38+
:ivar source_buffer: (:class:`pythonparser.source.Buffer`)
3939
the source buffer
40-
:ivar diagnostic_engine: (:class:`pyparser.diagnostic.Engine`)
40+
:ivar diagnostic_engine: (:class:`pythonparser.diagnostic.Engine`)
4141
the diagnostic engine
4242
:ivar offset: (integer) character offset into ``source_buffer``
4343
indicating where the next token will be recognized
@@ -118,7 +118,7 @@ def __init__(self, source_buffer, version, diagnostic_engine, interactive=False)
118118
try:
119119
reserved = self._reserved[version]
120120
except KeyError:
121-
raise NotImplementedError("pyparser.lexer.Lexer cannot lex Python %s" % str(version))
121+
raise NotImplementedError("pythonparser.lexer.Lexer cannot lex Python %s" % str(version))
122122

123123
# Sort for the regexp to obey longest-match rule.
124124
re_reserved = sorted(reserved, reverse=True, key=len)
@@ -207,7 +207,7 @@ def next(self, eof_token=False):
207207
Returns token at ``offset`` as a :class:`Token` and advances ``offset``
208208
to point past the end of the token, where the token has:
209209
210-
- *range* which is a :class:`pyparser.source.Range` that includes
210+
- *range* which is a :class:`pythonparser.source.Range` that includes
211211
the token but not surrounding whitespace,
212212
- *kind* which is a string containing one of Python keywords or operators,
213213
``newline``, ``float``, ``int``, ``complex``, ``strbegin``,

Diff for: ‎pyparser/parser.py renamed to ‎pythonparser/parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def _init_version(self, version):
454454
self.yield_expr = self.yield_expr__33
455455
return
456456

457-
raise NotImplementedError("pyparser.parser.Parser cannot parse Python %s" %
457+
raise NotImplementedError("pythonparser.parser.Parser cannot parse Python %s" %
458458
str(version))
459459

460460
def _arguments(self, args=None, defaults=None, kwonlyargs=None, kw_defaults=None,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: ‎setup.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ def initialize_options(self):
99
def finalize_options(self):
1010
pass
1111
def run(self):
12-
os.system('rsync -avz doc/_build/html/ shell.serverraum.org:~/web/m-labs.hk/pyparser')
12+
os.system('rsync -avz doc/_build/html/ shell.serverraum.org:~/web/m-labs.hk/pythonparser')
1313

1414
setup(
15-
name="pyparser",
15+
name="pythonparser",
1616
version="0.0+dev",
1717
author="whitequark",
1818
author_email="whitequark@whitequark.org",
19-
url="http://m-labs.hk/pyparser",
19+
url="http://m-labs.hk/pythonparser",
2020
description="A Python parser intended for use in tooling",
21-
long_description=open("README.rst").read(),
21+
long_description=open("README.md").read(),
2222
license="BSD",
2323
install_requires=['regex'],
2424
extras_require={},
2525
dependency_links=[],
2626
packages=find_packages(exclude=['tests*']),
2727
namespace_packages=[],
28-
test_suite="pyparser.test",
28+
test_suite="pythonparser.test",
2929
package_data={},
3030
ext_modules=[],
3131
entry_points={},

0 commit comments

Comments
 (0)
Please sign in to comment.