[vlc-devel] [PATCH 3/3] Replace goto with gotoitem. goto is reserved in lua 5.2. luac will fail to compile the lua source files without this change.

Rafaël Carré funman at videolan.org
Fri Jan 6 01:27:39 CET 2012


Le 12-01-05 19:21, Kelly Anderson a écrit :
> On 01/05/2012 01:10 PM, Rafaël Carré wrote:
>> Le 2012-01-05 11:03, Antoine Cellerier a écrit :
>>> Hello,
>>>
>>> On Thu, Jan 05, 2012, Kelly Anderson wrote:
>>>> diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua
>>>> index 265b938..9f89d11 100644
>>>> --- a/share/lua/intf/cli.lua
>>>> +++ b/share/lua/intf/cli.lua
>>>> @@ -535,7 +535,7 @@ commands_ordered = {
>>>>       { "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } };
>>>>       { "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } };
>>>>       { "prev"; { func = skip2(vlc.playlist.prev); help = "previous playlist item" } };
>>>> -    { "goto"; { func = skip2(vlc.playlist.goto); help = "goto item at index" } };
>>>> +    { "gotoitem"; { func = skip2(vlc.playlist.gotoitem); help = "goto item at index" } };
>>>>       { "repeat"; { func = skip2(vlc.playlist.repeat_); args = "[on|off]"; help = "toggle playlist repeat" } };
>>>>       { "loop"; { func = skip2(vlc.playlist.loop); args = "[on|off]"; help = "toggle playlist loop" } };
>>>>       { "random"; { func = skip2(vlc.playlist.random); args = "[on|off]"; help = "toggle playlist random" } };
>>> This doesn't seem to be the correct solution. There is no reason to
>>> forbid using goto as a command in the cli interface. "repeat" is another
>>> case where we needed a different name for the function since it was
>>> already a reserved keyword in 5.1 but that didn't prevent keeping
>>> "repeat" as the cli instruction.
>> This seems weird indeed, can you paste the exact error you have with
>> luac 5.2 ?
> 
> 
> Making all in share
> make[2]: Entering directory `/home/kelly/Xilka/build/Vlc-git/Source/share'
>    LUAC   lua/intf/cli.luac
> /usr/bin/luac: lua/intf/cli.lua:538: <name> expected near 'goto'
> make[2]: *** [lua/intf/cli.luac] Error 1
>    LUAC   lua/intf/modules/httprequests.luac
> /usr/bin/luac: lua/intf/modules/httprequests.lua:96: <name> expected 
> near 'goto'
> make[2]: *** [lua/intf/modules/httprequests.luac] Error 1

I noticed this:

commit 62d4d133a9b5e66bba5545338219499133909a9b
Author: Antoine Cellerier <antoine at macbook.(none)>
Date:   Mon Dec 14 23:33:17 2009 +0100

    repeat is a reserved lua keyword

    Provide playlist._repeat() instead (and keep the old .repeat in case
    anybody was using playlist["repeat"] to workaround the reserved keyword
    issue).

IIUC it only applies to the function name though, not to the string
interpreted by cli.lua

So Kelly, your change shouldn't affect "goto" but only vlc.playlist.goto



More information about the vlc-devel mailing list