StepfenShawn / Cantonese

粤语編程語言.The Cantonese programming language.
https://cantonese-community.github.io/
MIT License
1.15k stars 46 forks source link

Is the interactive interpreter (REPL) supposed to work? #54

Open dosentmatter opened 2 years ago

dosentmatter commented 2 years ago
% Cantonese 
早晨!
> 畀我睇下 " Hello World! " 点样先?
> 
> 收工
> 
> Traceback (most recent call last):
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/bin/Cantonese", line 8, in <module>
    sys.exit(main())
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 3125, in main
    sys.exit(开始交互())
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/site-packages/src/cantonese.py", line 3089, in 开始交互
    交互().cmdloop("早晨!")
  File "/Users/dosentmatter/.pyenv/versions/3.9.6/lib/python3.9/cmd.py", line 126, in cmdloop
    line = input(self.prompt)
KeyboardInterrupt
StepfenShawn commented 2 years ago

it is fixed in the new version!

pip install -U Cantonese
C:\Users\Administrator>cantonese
Cantonese 1.0 Copyright (C) 2020-2022 StepfenShawn
Tue Jan 25 19:58:56 2022
> 畀我睇下 "Hello World" 点样先?
Hello World
>收工
C:\Users\Administrator>
nobodxbodon commented 2 years ago

刚用 python src/cantonese.py 启动repl 测了,确认已修复。

dosentmatter commented 2 years ago

@StepfenShawn, thanks for the quick fix. I can also confirm that it works better now.

But now it seems like there's another bug. After entering a command and then just hitting <ENTER> a bunch of times, it increasingly prints more output.

% cantonese
Cantonese 1.0 Copyright (C) 2020-2022 StepfenShawn
Tue Jan 25 21:43:46 2022
> 畀我睇下 "Hello World" 点样先?
Hello World
> 
Hello World
Hello World
> 
Hello World
Hello World
Hello World
> 
Hello World
Hello World
Hello World
Hello World
> 
Hello World
Hello World
Hello World
Hello World
Hello World
> 
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
> 
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World