Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(REPL): improve interactive experience #362

Merged
merged 57 commits into from
Feb 8, 2023
Merged

Conversation

C-BJ
Copy link
Member

@C-BJ C-BJ commented Jan 16, 2023

Change

1.Fixes #216 (modify the tip of failed to dump a. pyc file)
2.Fixes #26
3.Fixes #62
4.Fixes #56
5.Support up key browsing history
6.Added the paste function for Windows, WSL, Linux(need to install xsel) and MacOS
7.Fixed countless crash bugs
8.improve the multi-line REPL operation
9.Improve REPL testing
10.add --features full
11.Update README

Direct dependent change

add optional crossterm = "0.25.0" to erg_common

@C-BJ C-BJ marked this pull request as draft January 16, 2023 01:14
@mtshiba mtshiba marked this pull request as ready for review January 16, 2023 02:14
@C-BJ C-BJ marked this pull request as draft January 16, 2023 02:19
@mtshiba mtshiba self-requested a review January 16, 2023 02:20
@mtshiba
Copy link
Member

mtshiba commented Jan 16, 2023

:clear is already implemented.

":clear" => {

@C-BJ
Copy link
Member Author

C-BJ commented Jan 16, 2023

:clear is already implemented.

":clear" => {

sorry

@C-BJ C-BJ requested a review from GreasySlug January 16, 2023 10:16
@C-BJ C-BJ requested a review from GreasySlug January 17, 2023 06:07
@C-BJ C-BJ marked this pull request as ready for review January 17, 2023 09:40
@C-BJ
Copy link
Member Author

C-BJ commented Jan 17, 2023

It's so weird.
I just run cargo fmt and CI fails
Restore it and CI is successful again

@mtshiba

@C-BJ C-BJ marked this pull request as draft January 17, 2023 14:18
@C-BJ C-BJ marked this pull request as ready for review January 17, 2023 14:35
@C-BJ C-BJ marked this pull request as draft January 17, 2023 14:44
@C-BJ C-BJ marked this pull request as ready for review January 18, 2023 02:49
@GreasySlug
Copy link
Member

Please squash commits that don't make much sense

@C-BJ
Copy link
Member Author

C-BJ commented Jan 18, 2023

Yes, In merge commit

@C-BJ C-BJ marked this pull request as draft January 18, 2023 06:10
crates/erg_common/stdin.rs Outdated Show resolved Hide resolved
crates/erg_common/stdin.rs Outdated Show resolved Hide resolved
crates/erg_common/traits.rs Outdated Show resolved Hide resolved
@C-BJ
Copy link
Member Author

C-BJ commented Jan 21, 2023

Before this PR the Ubuntu CI also has a probability faild:https://github.com/erg-lang/erg/actions/runs/3984374464/jobs/6830520255

Local tests passed, but CI failed @mtshiba

@C-BJ C-BJ marked this pull request as ready for review January 21, 2023 07:35
@C-BJ C-BJ requested a review from GreasySlug January 21, 2023 07:36
GreasrySlug added 2 commits January 31, 2023 09:12
Arrow keys could not be used on Linux
so, add REPL input handling by `crossterm`
Improvement of detailed usability
- possible to use arrow keys on Linux
- Cursor shape change block to line
- Ctrl+c is disable
- Ctrl+z is the exit key command
src/dummy.rs Outdated Show resolved Hide resolved
@C-BJ C-BJ changed the title Improve REPL feat(REPL): improve interactive experience Feb 4, 2023
crates/erg_common/traits.rs Outdated Show resolved Hide resolved
@mtshiba
Copy link
Member

mtshiba commented Feb 5, 2023

>>> C = Class {x = Int}

>>> C.
...     method self = None
...
Error[#0126]: File <stdin>, line 1,

1 |
  : -
  : `- exists a similar name variable:

NameError: C is not defined

>>> @Inheritable
... D = Class {x = Int}
... D.
...     method self = None
...
...
>>>

This is not a mistake, but a request for improvement. If a class has a decorator, it is supposed to accept subsequent method definitions. I would like this to be the case even when decorators are not attached.

P.S.

>>> @id
... f x = x
...

The behavior seems to be that if a decorator is attached, the methods' definition is expected, but this behavior is not strictly correct, since non-classes can also have decorators. It would be necessary to determine the class definition. It would be difficult to implement in earnest, but as a simple implementation, if a Class is placed immediately after the =, it can be judged as a class definition.

@C-BJ
Copy link
Member Author

C-BJ commented Feb 5, 2023

I have found a problem that if you type anything other than English in the repl, there will be a lot of problems (I will solve this problem).

@mtshiba
Copy link
Member

mtshiba commented Feb 6, 2023

Decorators not working properly.

スクリーンショット_20230206_145017

@mtshiba mtshiba merged commit 72b4425 into erg-lang:main Feb 8, 2023
@mtshiba
Copy link
Member

mtshiba commented Feb 8, 2023

Thank you so much!

@C-BJ C-BJ deleted the improve-repl branch February 8, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants