Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Python3.2 fixes

  • Loading branch information...
commit b680111af209325e7707b803025f5a382715719d 1 parent c971fab
@dabeaz authored
Showing with 26 additions and 13 deletions.
  1. +4 −4 ANNOUNCE
  2. +9 −1 CHANGES
  3. +7 −7 README
  4. +6 −1 setup.py
View
8 ANNOUNCE
@@ -1,11 +1,11 @@
-September 2, 2009
+February 17, 2011
- Announcing : PLY-3.3 (Python Lex-Yacc)
+ Announcing : PLY-3.4 (Python Lex-Yacc)
http://www.dabeaz.com/ply
-I'm pleased to announce PLY-3.3--a pure Python implementation of the
-common parsing tools lex and yacc. PLY-3.3 is a minor bug fix
+I'm pleased to announce PLY-3.4--a pure Python implementation of the
+common parsing tools lex and yacc. PLY-3.4 is a minor bug fix
release. It supports both Python 2 and Python 3.
If you are new to PLY, here are a few highlights:
View
10 CHANGES
@@ -1,5 +1,13 @@
-Version (in progress)
+Version 3.4
---------------------
+02/17/11: beazley
+ Minor patch to make cpp.py compatible with Python 3. Note: This
+ is an experimental file not currently used by the rest of PLY.
+
+02/17/11: beazley
+ Fixed setup.py trove classifiers to properly list PLY as
+ Python 3 compatible.
+
01/02/11: beazley
Migration of repository to github.
View
14 README
@@ -1,6 +1,6 @@
-PLY (Python Lex-Yacc) Version 3.3
+PLY (Python Lex-Yacc) Version 3.4
-Copyright (C) 2001-2009,
+Copyright (C) 2001-2011,
David M. Beazley (Dabeaz LLC)
All rights reserved.
@@ -177,7 +177,7 @@ def t_newline(t):
t.lexer.lineno += t.value.count("\n")
def t_error(t):
- print "Illegal character '%s'" % t.value[0]
+ print("Illegal character '%s'" % t.value[0])
t.lexer.skip(1)
# Build the lexer
@@ -200,7 +200,7 @@ def p_statement_assign(p):
def p_statement_expr(p):
'statement : expression'
- print p[1]
+ print(p[1])
def p_expression_binop(p):
'''expression : expression PLUS expression
@@ -229,18 +229,18 @@ def p_expression_name(p):
try:
p[0] = names[p[1]]
except LookupError:
- print "Undefined name '%s'" % p[1]
+ print("Undefined name '%s'" % p[1])
p[0] = 0
def p_error(p):
- print "Syntax error at '%s'" % p.value
+ print("Syntax error at '%s'" % p.value)
import ply.yacc as yacc
yacc.yacc()
while 1:
try:
- s = raw_input('calc > ')
+ s = raw_input('calc > ') # use input() on Python 3
except EOFError:
break
yacc.parse(s)
View
7 setup.py
@@ -14,13 +14,18 @@
productions, precedence rules, error recovery, and support for ambiguous grammars.
PLY is extremely easy to use and provides very extensive error checking.
+It is compatible with both Python 2 and Python 3.
""",
license="""BSD""",
- version = "3.3",
+ version = "3.4",
author = "David Beazley",
author_email = "dave@dabeaz.com",
maintainer = "David Beazley",
maintainer_email = "dave@dabeaz.com",
url = "http://www.dabeaz.com/ply/",
packages = ['ply'],
+ classifiers = [
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 2',
+ ]
)
Please sign in to comment.
Something went wrong with that request. Please try again.