Skip to content

Commit

Permalink
gh-40 work with any version of sly
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Dec 5, 2022
1 parent 8f7ba11 commit 2347cbb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "sly<0.5" coverage regex pytest
python -m pip install sly coverage regex pytest
- name: Test with coverage/pytest
run: |
Expand Down
1 change: 1 addition & 0 deletions json5/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ class tok:
value=None
lineno=None
index=None
end=None
return JSON5Token(tok(), None)
elif self.last_token:
doc = self.last_token.doc
Expand Down
5 changes: 3 additions & 2 deletions json5/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ def __init__(self, tok, doc):
self.lineno = tok.lineno
self.index = tok.index
self.doc = doc
__slots__ = ('type', 'value', 'lineno', 'index', 'doc')
self.end = getattr(tok, 'end', None)
__slots__ = ('type', 'value', 'lineno', 'index', 'doc', 'end')

def __repr__(self):
return f'JSON5Token(type={self.type!r}, value={self.value!r}, lineno={self.lineno}, index={self.index})'
return f'JSON5Token(type={self.type!r}, value={self.value!r}, lineno={self.lineno}, index={self.index}, end={self.end})'


class JSONLexer(Lexer):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='json-five',
version='0.7.6',
version='0.8.0',
packages=['json5'],
url='https://github.com/spyoungtech/json-five',
license='Apache',
Expand All @@ -15,7 +15,7 @@
description='A JSON5 parser that, among other features, supports round-trip preservation of comments',
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=['sly<0.5', 'regex'],
install_requires=['sly', 'regex'],
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3 :: Only',
Expand Down

0 comments on commit 2347cbb

Please sign in to comment.