New Upstream Release - python-rply
Ready changes
Summary
Merged new upstream version: 0.7.8 (was: 0.7.7).
Resulting package
Built on 2023-05-21T09:15 (took 5m43s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases python3-rply
Lintian Result
Diff
diff --git a/PKG-INFO b/PKG-INFO
index f96548c..1fffa2b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: rply
-Version: 0.7.7
+Version: 0.7.8
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
@@ -118,7 +118,7 @@ Description: RPLY
Python compatibility
--------------------
- RPly is tested and known to work under Python 2.6, 2.7, 3.4+, and PyPy. It is
+ RPly is tested and known to work under Python 2.7, 3.4+, and PyPy. It is
also valid RPython for PyPy checkouts from ``6c642ae7a0ea`` onwards.
Links
diff --git a/README.rst b/README.rst
index d45ecf4..611e7fa 100644
--- a/README.rst
+++ b/README.rst
@@ -110,7 +110,7 @@ exception. It receives the ``Token`` object that the parser errored on.
Python compatibility
--------------------
-RPly is tested and known to work under Python 2.6, 2.7, 3.4+, and PyPy. It is
+RPly is tested and known to work under Python 2.7, 3.4+, and PyPy. It is
also valid RPython for PyPy checkouts from ``6c642ae7a0ea`` onwards.
Links
diff --git a/debian/changelog b/debian/changelog
index 44efd38..27f216f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
-python-rply (0.7.7-4) UNRELEASED; urgency=medium
+python-rply (0.7.8-1) UNRELEASED; urgency=medium
* Update standards version to 4.6.2, no changes needed.
+ * New upstream release.
- -- Debian Janitor <janitor@jelmer.uk> Wed, 11 Jan 2023 00:32:50 -0000
+ -- Debian Janitor <janitor@jelmer.uk> Sun, 21 May 2023 09:10:43 -0000
python-rply (0.7.7-3) unstable; urgency=medium
diff --git a/rply.egg-info/PKG-INFO b/rply.egg-info/PKG-INFO
index f96548c..1fffa2b 100644
--- a/rply.egg-info/PKG-INFO
+++ b/rply.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: rply
-Version: 0.7.7
+Version: 0.7.8
Summary: A pure Python Lex/Yacc that works with RPython
Home-page: UNKNOWN
Author: Alex Gaynor
@@ -118,7 +118,7 @@ Description: RPLY
Python compatibility
--------------------
- RPly is tested and known to work under Python 2.6, 2.7, 3.4+, and PyPy. It is
+ RPly is tested and known to work under Python 2.7, 3.4+, and PyPy. It is
also valid RPython for PyPy checkouts from ``6c642ae7a0ea`` onwards.
Links
diff --git a/rply/__init__.py b/rply/__init__.py
index ba80481..9d5034c 100644
--- a/rply/__init__.py
+++ b/rply/__init__.py
@@ -3,7 +3,7 @@ from rply.lexergenerator import LexerGenerator
from rply.parsergenerator import ParserGenerator
from rply.token import Token
-__version__ = '0.7.7'
+__version__ = '0.7.8'
__all__ = [
"LexerGenerator", "LexingError", "ParserGenerator", "ParsingError",
diff --git a/rply/lexer.py b/rply/lexer.py
index 8d02783..82e6447 100644
--- a/rply/lexer.py
+++ b/rply/lexer.py
@@ -18,6 +18,7 @@ class LexerStream(object):
self.idx = 0
self._lineno = 1
+ self._colno = 1
def __iter__(self):
return self
@@ -47,14 +48,15 @@ class LexerStream(object):
match = rule.matches(self.s, self.idx)
if match:
lineno = self._lineno
- colno = self._update_pos(match)
- source_pos = SourcePosition(match.start, lineno, colno)
+ self._colno = self._update_pos(match)
+ source_pos = SourcePosition(match.start, lineno, self._colno)
token = Token(
rule.name, self.s[match.start:match.end], source_pos
)
return token
else:
- raise LexingError(None, SourcePosition(self.idx, -1, -1))
+ raise LexingError(None, SourcePosition(
+ self.idx, self._lineno, self._colno))
def __next__(self):
return self.next()
diff --git a/rply/lexergenerator.py b/rply/lexergenerator.py
index 102f382..e0e402b 100644
--- a/rply/lexergenerator.py
+++ b/rply/lexergenerator.py
@@ -21,7 +21,6 @@ class Rule(object):
self.name = name
self.re = re.compile(pattern, flags=flags)
if rpython:
- self.flags = flags
self._pattern = get_code(pattern, flags)
def _freeze_(self):
@@ -33,7 +32,7 @@ class Rule(object):
return Match(*m.span(0)) if m is not None else None
else:
assert pos >= 0
- ctx = rsre_core.StrMatchContext(s, pos, len(s), self.flags)
+ ctx = rsre_core.StrMatchContext(s, pos, len(s))
matched = rsre_core.match_context(ctx, self._pattern)
if matched:
diff --git a/rply/parsergenerator.py b/rply/parsergenerator.py
index 2500e1e..f94671d 100644
--- a/rply/parsergenerator.py
+++ b/rply/parsergenerator.py
@@ -42,15 +42,15 @@ class ParserGenerator(object):
def production(self, rule, precedence=None):
"""
- A decorator that defines a production rule and registers the decorated
- function to be called with the terminals and non-terminals matched by
- that rule.
+ A decorator that defines one or many production rules and registers
+ the decorated function to be called with the terminals and
+ non-terminals matched by those rules.
A `rule` should consist of a name defining the non-terminal returned
- by the decorated function and a sequence of non-terminals and terminals
- that are supposed to be replaced::
+ by the decorated function and one or more sequences of pipe-separated
+ non-terminals and terminals that are supposed to be replaced::
- replacing_non_terminal : ATERMINAL non_terminal
+ replacing_non_terminal : TERMINAL1 non_term1 | TERMINAL2 non_term2
The name of the non-terminal replacing the sequence is on the left,
separated from the sequence by a colon. The whitespace around the colon
@@ -75,10 +75,14 @@ class ParserGenerator(object):
production_name = parts[0]
if parts[1] != ":":
raise ParserGeneratorError("Expecting :")
- syms = parts[2:]
+
+ body = " ".join(parts[2:])
+ prods = body.split("|")
def inner(func):
- self.productions.append((production_name, syms, func, precedence))
+ for production in prods:
+ syms = production.split()
+ self.productions.append((production_name, syms, func, precedence))
return func
return inner
diff --git a/setup.py b/setup.py
index 792523d..a9c6d4e 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ setup(
description="A pure Python Lex/Yacc that works with RPython",
long_description=readme,
# duplicated in docs/conf.py and rply/__init__.py
- version="0.7.7",
+ version="0.7.8",
author="Alex Gaynor",
author_email="alex.gaynor@gmail.com",
packages=["rply"],
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.8.egg-info/PKG-INFO -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.8.egg-info/dependency_links.txt -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.8.egg-info/requires.txt -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.8.egg-info/top_level.txt
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.7.egg-info/PKG-INFO -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.7.egg-info/dependency_links.txt -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.7.egg-info/requires.txt -rw-r--r-- root/root /usr/lib/python3/dist-packages/rply-0.7.7.egg-info/top_level.txt
No differences were encountered in the control files