diff options
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | doc/ply.html | 9 | ||||
-rw-r--r-- | ply/yacc.py | 3 |
3 files changed, 22 insertions, 7 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b13d007 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +PYTHON ?= python + +test: + cd test && $(PYTHON) testlex.py + cd test && $(PYTHON) testyacc.py + +wheel: + $(PYTHON) setup.py bdist_wheel + +sdist: + $(PYTHON) setup.py sdist + +upload: wheel sdist + $(PYTHON) setup.py bdist_wheel upload + $(PYTHON) setup.py sdist upload + +.PHONY: test wheel sdist upload diff --git a/doc/ply.html b/doc/ply.html index 30905e2..b35ba44 100644 --- a/doc/ply.html +++ b/doc/ply.html @@ -558,15 +558,12 @@ column information as a separate step. For instance, just count backwards unti <blockquote> <pre> -# Compute column. +# Compute column. # input is the input text string # token is a token instance def find_column(input, token): - last_cr = input.rfind('\n', 0, token.lexpos) - if last_cr < 0: - last_cr = 0 - column = (token.lexpos - last_cr) + 1 - return column + line_start = input.rfind('\n', 0, token.lexpos) + 1 + return (token.lexpos - line_start) + 1 </pre> </blockquote> diff --git a/ply/yacc.py b/ply/yacc.py index 97c9a1e..ceaaefd 100644 --- a/ply/yacc.py +++ b/ply/yacc.py @@ -32,7 +32,7 @@ # ----------------------------------------------------------------------------- # # This implements an LR parser that is constructed from grammar rules defined -# as Python functions. The grammer is specified by supplying the BNF inside +# as Python functions. The grammar is specified by supplying the BNF inside # Python documentation strings. The inspiration for this technique was borrowed # from John Aycock's Spark parsing system. PLY might be viewed as cross between # Spark and the GNU bison utility. @@ -2733,6 +2733,7 @@ class LRGeneratedTable(LRTable): f.write(''' # %s # This file is automatically generated. Do not edit. +# pylint: disable=W,C,R _tabversion = %r _lr_method = %r |