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): add imports, funcs, commands, etc #886

Merged
merged 11 commits into from
Jun 19, 2023

Conversation

moul
Copy link
Member

@moul moul commented Jun 10, 2023

Still buggy, but better:

$ go run ./gnovm/cmd/gno repl --verbose --imports gno.land/p/demo/ufmt --skip-usage
gno:1> println(42, 43)
42 43
gno:2> println(ufmt.Sprintf("hello %d", 1337))
hello 1337
gno:3> /import gno.land/r/demo/art/millipede
gno:4> println(millipede.Draw(10))   
    ╚⊙ ⊙╝
  ╚═(███)═╝
 ╚═(███)═╝
╚═(███)═╝
 ╚═(███)═╝
  ╚═(███)═╝
   ╚═(███)═╝
    ╚═(███)═╝
    ╚═(███)═╝
   ╚═(███)═╝
  ╚═(███)═╝

gno:5> /src
package test
import "gno.land/p/demo/ufmt"
import "gno.land/r/demo/art/millipede"

func repl_5() {
println(millipede.Draw(10))
}
gno:6> 

ps: I don't like my code, but I prefer adding more features before trying to find the best code architecture for the repl.

Contributors Checklist

  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests

Maintainers Checklist

  • Checked that the author followed the guidelines in CONTRIBUTING.md
  • Checked the conventional-commit (especially PR title and verb, presence of BREAKING CHANGE: in the body)
  • Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul self-assigned this Jun 10, 2023
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jun 10, 2023
moul added 4 commits June 10, 2023 12:10
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul marked this pull request as ready for review June 10, 2023 11:12
@moul moul requested a review from a team as a code owner June 10, 2023 11:12
@zivkovicmilos zivkovicmilos self-requested a review June 10, 2023 20:38
gnovm/cmd/gno/repl.go Outdated Show resolved Hide resolved
gnovm/cmd/gno/repl.go Outdated Show resolved Hide resolved
gnovm/cmd/gno/repl.go Outdated Show resolved Hide resolved
moul added 6 commits June 18, 2023 23:05
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@thehowl thehowl merged commit fb0c2a1 into gnolang:master Jun 19, 2023
44 checks passed
Doozers pushed a commit to Doozers/gno that referenced this pull request Aug 31, 2023
* feat(repl): add imports, funcs, commands, etc

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: support piped commands

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: use passed stdout + add generated comment

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: support quoted and unquoted imports

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: handle initial command

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

* chore: fixup

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>

---------

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul added this to the 🌟 main.gno.land (wanted) milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants