billroy / bitlash

Bitlash: a programmable command shell for arduino
http://bitlash.net
MIT License
341 stars 73 forks source link

Blank user function causes following functions not to appear #46

Open Drachenkaetzchen opened 9 years ago

Drachenkaetzchen commented 9 years ago

When one accidentally declares an empty function, additional functions don't show up in the list.

> function foo {}
saved
> function bar { print "foo"; }
saved
> ls
function foo {};
function  print "foo";  {};
billroy commented 9 years ago

Hi, Timo:

Thanks for your note. You’ve found a good little bug here. I’m not clear whether it’s a bug in cmd_ls() or whether the function definition is broken, but something is definitely wrong. Unfortulately, I’m away from my workbench this week so I can’t debug it first-hand. Can you please send the results of a “peep” at the eeprom after you create that situation?

-br

On Jun 15, 2015, at 1:04 PM, Timo A. Hummel notifications@github.com wrote:

When one accidentally declares an empty function, additional functions don't show up in the list.

function foo {} saved function bar { print "foo"; } saved ls function foo {}; function print "foo"; {}; — Reply to this email directly or view it on GitHub https://github.com/billroy/bitlash/issues/46.

Drachenkaetzchen commented 8 years ago

Here's the dump:

E000:  .... ....  .... ....  .... ....  .... ....  .... ....  ..fo o$$b  ar$  prin  t "f oo";
E040:   $.. ....  .... ....  .... ....  .... ....  .... ....  .... ....  .... ....  .... ....

It doesn't seem to be the cmd_ls() function, because I'm not able to call the function "bar" in that example:

> function foo {}
saved
> function bar { print "foo"; }
saved
> bar()

-----^
unexpected number
> ls
function foo {};
function  print "foo";  {};
> rm foo
> ls
function bar { print "foo"; };
> bar
foo

As soon as I remove the empty function foo, the call to bar works again.