giann / croissant Goto Github PK
View Code? Open in Web Editor NEWπ₯ A Lua REPL and debugger
License: MIT License
π₯ A Lua REPL and debugger
License: MIT License
I installed croissant with LuaRocks, but got the following error:
/usr/local/bin/lua53: /usr/local/share/lua/5.3/croissant/init.lua:2: module 'croissant.conf' not found:No LuaRocks module found for croissant.conf
no field package.preload['croissant.conf']
...
stack traceback:
[C]: in function 'require'
/usr/local/share/lua/5.3/croissant/init.lua:2: in main chunk
[C]: in function 'require'
...l/lib/luarocks/rocks-5.3/croissant/0.0.1-4/bin/croissant:3: in main chunk
[C]: in ?
For some reason conf.lua isn't included in the LuaRocks package but croissant expects it. Is this a mistake or is there a way to generate this file?
Hello! I own https://github.com/tilkinsc/LuaConsole
A next-gen, Cross-Platform [Lua-5.1.x, LuaJIT-2.0, Lua-5.2.x, Lua5.3.x]-supporting CLI made to supersede PUC-Lua and LuaJIT CLI http://tilkinsc.github.io/LuaConsole/
I like croissant's style. I would appreciate contributions to my REPL portion of my project in any way you can think of to improve the project. Such as pretty printing return values. That would be amazing.
Thanks
Hi there,
I'm enjoying croissant so far, the only thing it's bugging me is the history being saved in $HOME
Following XDG_BASE_DIR spec, the following directories should be used:
config_file=${XDG_CONFIG_HOME:-$HOME/.config}/croissant/config
hist_file=${XDG_DATA_HOME:-$HOME/.local/share}/croissant/history
Could this be configurable?
I'm running git HEAD from https://github.com/LuaJIT/LuaJIT/tree/v2.1/ so my LuaJIT banner is
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/
but croissant prints out
LuaJIT Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
There's no way to programmatically discover the correct banner to print AFAIK. Maybe it should just print out _VERSION
if PUC-Rio Lua and jit.version
if LuaJIT.
I'm happy to send a patch btw.
One of the features in the readme says
From what I see in the screencap it doesn't seem like the code is really interpreted, but just parsed to catch syntax errors ;)
When I type, for example, utf8.
and press tab I get a list of the members of that table. But I can't actually auto-complete them. Pressing tab doesn't do anything.
When I run croissant it displays Lua 5.3, but when I ask Lua what version is actually running, it says Lua 5.4:
$ sudo luarocks --lua-version 5.4 install croissant
...
$ croissant
π₯ Croissant 0.0.1 (C) 2019 Benoit Giannangeli
Lua 5.3 Copyright (C) 1994-2018 Lua.org, PUC-Rio
β _VERSION
"Lua 5.4"
β
I just got croissant installed, run croissant
from zsh shell, and croissant breaks on the first command I type printing the same stack trace as giann/sirocco#2
β― croissant
π₯ Croissant 0.0.1 (C) 2019 Benoit Giannangeli
Lua 5.1 Copyright (C) 1994-2018 Lua.org, PUC-Rio
myvar = "banana"
/usr/bin/lua5.1: ...3.8.0/./lua_modules/share/lua/5.1/sirocco/prompt.lua:355: attempt to perform arithmetic on field 'y' (a nil value)
stack traceback:
[C]: ?
...3.8.0/./lua_modules/share/lua/5.1/sirocco/prompt.lua:355: in function 'update'
...3.8.0/./lua_modules/share/lua/5.1/sirocco/prompt.lua:429: in function 'ask'
...3.8.0/./lua_modules/share/lua/5.1/croissant/repl.lua:29: in function <...3.8.0/./lua_modules/share/lua/5.1/croissant/repl.lua:10>
...b/luarocks/rocks-5.1/croissant/0.0.1-6/bin/croissant:52: in function 'route'
...b/luarocks/rocks-5.1/croissant/0.0.1-6/bin/croissant:56: in main chunk
[C]: ?
β΅ Error. Exit status 1.
When croissant
first loads, it presents the characters ^[[28;1R
at the top just after the copyright info.
If I delete those characters then type myvar = "random string"
then I get that stacktrace when I hit Enter key.
If I hit Enter key without deleting those characters, then I get:
β― croissant
π₯ Croissant 0.0.1 (C) 2019 Benoit Giannangeli
Lua 5.1 Copyright (C) 1994-2018 Lua.org, PUC-Rio
β
/usr/bin/env: βsttyβ: No such file or directory
β
/usr/bin/env: βsttyβ: No such file or directory
^[[34;1Rcl^C
...notice how ^C
(Ctrl C) did not cancel/exit the process/thing.
9cfefa9#diff-b115353c6b250aac60c66fa392808ecdR319
local t = {
nil,
[false] = "Lua 5.1",
[true] = "Lua 5.2",
[1/"-0"] = "Lua 5.3", -- attempt to perform arithmetic on a string value
[1] = "LuaJIT"
}
% lua_modules/bin/croissant
/tmp/opt/bin/lua: ...uarocks-3.2.1/lua_modules/share/lua/5.3/croissant/do.lua:332: attempt to perform arithmetic on a string value
stack traceback:
...uarocks-3.2.1/lua_modules/share/lua/5.3/croissant/do.lua:332: in upvalue 'luaVersion'
...uarocks-3.2.1/lua_modules/share/lua/5.3/croissant/do.lua:340: in function 'croissant.do.banner'
...rocks-3.2.1/lua_modules/share/lua/5.3/croissant/repl.lua:19: in function 'croissant.repl'
...s/lib/luarocks/rocks-5.3/croissant/0.0.1-6/bin/croissant:52: in local 'route'
...s/lib/luarocks/rocks-5.3/croissant/0.0.1-6/bin/croissant:56: in main chunk
[C]: in ?
# 5.3.5 -DLUA_NOCVTS2N
% /tmp/opt/bin/lua
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> 1/"-0"
stdin:1: attempt to perform arithmetic on a string value
stack traceback:
stdin:1: in main chunk
[C]: in ?
# 5.4.0 beta rc2 -DLUA_NOCVTS2N
% /tmp/p/lua-5.4.0-beta/src/lua
Lua 5.4.0 Copyright (C) 1994-2019 Lua.org, PUC-Rio
> 1/"-0"
stdin:1: attempt to perform arithmetic on a string value (constant '-0')
stack traceback:
stdin:1: in main chunk
[C]: in ?
>
See giann/sirocco#2. When I paste multiple lines of codes into the REPL of croissant, even in a do...end block, I got the same problem.
Problem exists on macOS 12.4 with Terminal/iTerm2/VSCode.
lua: /usr/local/lib/sirocco/prompt.lua:355: attempt to perform arithmetic on a nil value (field 'y')
stack traceback:
/usr/local/lib/sirocco/prompt.lua:355: in function 'croissant.luaprompt.update'
/usr/local/lib/sirocco/prompt.lua:431: in function 'croissant.luaprompt.ask'
/usr/local/lib/croissant/repl.lua:22: in function 'croissant.repl'
/usr/local/bin/croissant:52: in local 'route'
/usr/local/bin/croissant:56: in main chunk
[C]: in ?
# rachel @ ZhengPro in ~[22:55:25]
$ echo -e "\033[6n" | cat
# rachel @ ZhengPro in ~[22:55:28]
$ ;1R
# rachel @ ZhengPro in ~[22:56:01]
$ echo $TERM
xterm-256color
# rachel @ ZhengPro in ~ [23:02:56]
$ echo -e "\033[6n" | cat
^[[5;1R%
# rachel @ ZhengPro in ~ [23:02:58]
$ 1R
# rachel @ ZhengPro in ~ [23:02:58]
$ echo $TERM
xterm-256color
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.