RASP icon indicating copy to clipboard operation
RASP copied to clipboard

Deprecated use of typing.io in the lexer

Open alexanderkoller opened this issue 7 months ago • 1 comments

Hi Gail,

I'd like to develop a clearer understanding of RASP and was happy to discover that you already made an interpreter for it. However, I get the following error message (after running setup.sh):

(base) riemann:RASP koller$ ./rasp.sh 
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/Users/koller/Documents/workspace/RASP/RASP_support/__init__.py", line 1, in <module>
    from .REPL import REPL
  File "/Users/koller/Documents/workspace/RASP/RASP_support/REPL.py", line 4, in <module>
    from .zzantlr.RASPLexer import RASPLexer
  File "/Users/koller/Documents/workspace/RASP/RASP_support/zzantlr/RASPLexer.py", line 4, in <module>
    from typing.io import TextIO
ModuleNotFoundError: No module named 'typing.io'; 'typing' is not a package

This is caused by the attempt to import typing.io in RASPLexer.py, which has been deprecated since Python 3.8; changing it to from typing import TextIO makes RASP work on my Python 3.9.13.

Would you consider either manually editing RASPLexer.py to adapt to the Python version (as in lines 6-9 of RASPParser.py) or updating to a newer version of Antlr? This would make RASP easier to use with current versions of Python.

alexanderkoller avatar Jul 18 '25 07:07 alexanderkoller

Hi, thanks for telling me about this! I will be afk for about a month now, but I’ll try to handle this (and similar issues) on my return!

gailweiss avatar Jul 18 '25 07:07 gailweiss