dabeaz / sly

Sly Lex Yacc
Other
817 stars 108 forks source link

Problem where import Lexer and/or parser #54

Closed balmha closed 4 years ago

balmha commented 4 years ago

Hi, how are you?. I have a problem when import lexer, parser or both. both in py 2.7 and 3.5.

pyton3 import-test.py: Traceback (most recent call last): File "import-test.py", line 1, in <module> from sly import Lexer, Parser File "/home/nbalmaceda/.local/lib/python3.5/site-packages/sly/__init__.py", line 2, in <module> from .lex import * File "/home/nbalmaceda/.local/lib/python3.5/site-packages/sly/lex.py", line 78 return f'Token(type={self.type!r}, value={self.value!r}, lineno={self.lineno}, index={self.index})' ^ SyntaxError: invalid syntax pyton import-test.py: Traceback (most recent call last): File "import-test.py", line 1, in <module> from sly import Lexer, Parser File "/home/nbalmaceda/.local/lib/python2.7/site-packages/sly/__init__.py", line 6 __all__ = [ *lex.__all__, *yacc.__all__ ] ^ SyntaxError: invalid syntax

dabeaz commented 4 years ago

SLY uses f-strings and requires Python 3.6 or newer.