lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 31 January 2017 at 05:46, Martin <eden_martin_fuhrspam@gmx.de> wrote:
> On 01/29/2017 11:13 PM, Daurnimator wrote:
>>   - I'm not sure how to use your module with custom parameters (e.g.
>> indent_chunk): your global request function fails with lua:
>> /usr/share/lua/5.3/lcf/workshop/base.lua:128: module
>
> Could not reproduce.
>>Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
>> do
>>>   local lua_code_str = 'do return end' -- < fill it
>>>
>>>   require('lcf.workshop.base')
>>>   local get_formatted_ast = request('lcf.workshop.load_from.lua')
>>>   local get_formatted_code = request('lcf.workshop.save_to.lua')
>>>
>>>   return
>>>     get_formatted_code(
>>>       get_formatted_ast(lua_code_str),
>>>       {
>>>         indent_chunk = '!..',
>>>         right_margin = 100,
>>>         max_text_width = 65,
>>>       }
>>>     )
>>> end
> do
> !..return
> end
>>
>

Ah, that worked.
I had attempted to use the code out of 'lcf_reformat.lua':

Lua 5.3.4  Copyright (C) 1994-2017 Lua.org, PUC-Rio
> require('lcf.workshop.base')
true
> request('workshop.load_from.lua')
/usr/share/lua/5.3/lcf/workshop/base.lua:128: module
'workshop.load_from.lua' not found: