Giter VIP home page Giter VIP logo

croissant's Introduction

Benoit Giannangeli's github stats

croissant's People

Contributors

giann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

croissant's Issues

Attempt to perform arithmetic on a nil value (field 'y')

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 ?

iTerm2

# 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

Terminal

# 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

Possible inaccuracy in readme

One of the features in the readme says

  • Code interpreted as you type

From what I see in the screencap it doesn't seem like the code is really interpreted, but just parsed to catch syntax errors ;)

Lua 5.3 -DLUA_NOCVTS2N does not work

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 ?
> 

module 'croissant.conf' not found

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?

xdg base dir compliance

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?

How does the completion work?

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.

croissant breaks with sirocco error

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.

Hello from LuaConsole

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

Prints out wrong LuaJIT banner

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.