MSH function support

Denys Vlasenko vda.linux at googlemail.com
Thu Mar 19 11:53:27 UTC 2009


On Thu, Mar 19, 2009 at 5:48 AM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Thursday 19 March 2009 00:07:55 Denys Vlasenko wrote:
>> On Tuesday 17 March 2009 16:56, Michal Simek wrote:
>> > I look at shell folder and there is msh patch for function support.
>> > There is on the top comment that is buggy. What is buggy?
>> >
>> > Maybe I will have a time to clean it.
>>
>> hush code is cleaner (IMO), and it even has tiny rudiment
>> of function handling (so far commented out).
>>
>> The easiest way is to remember function body verbatim
>> as a string, and parse + execute it at the call site.
>> This is easy because similar code already exists -
>> the code which handles `cmd param param` thing.
>>
>> Harder part would be to implement "remember function body
>> verbatim as a string", you need to parse it
>> in order to find which one of "}" tokens
>> is an end of function. This code also exists,
>> it is needed to handle { cmd; cmd; } thing,
>> but it does not save the source string, it produces
>> a parsed tree. You can try remembering that tree instead,
>> but there was a reason why this may not work
>> (I forgot what exastly). Also, the tree will
>> for sure be _bigger_ than source string.
>
> what's the nommu status of hush ?  nommu is the only reason msh lives on.
> -mike

hush is working on NOMMU.

NOMMU situation is very simple: the only applet which is
completely off-limits for NOMMU is ash.
--
vda


More information about the busybox mailing list