Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

Error: 'then' expected #23

@tobiasvl

Description

@tobiasvl

Does picolove not support the one-liner if?

Error: Error loading lua: patrick.p8:75: 'then' expected near 'menu_selection'
stack traceback:
        [string "boot.lua"]:637: in function <[string "boot.lua"]:633>
        [C]: in function 'error'
        cart.lua:429: in function 'load_p8'
        main.lua:140: in function '_load'
        main.lua:348: in function 'load'
        main.lua:719: in function <main.lua:711>
        [C]: in function 'xpcall'
        [string "boot.lua"]:650: in function <[string "boot.lua"]:639>
        [C]: in function 'xpcall'

Here's line 75:

    if (button==4) menu_selection=menu_selection==1 and #menu or menu_selection-1

I tried to replace it with a full if/end block but that just made it complain on another similar line.

The cart in question is here on GitHub, but I have the same problem with all my carts since I use the same boilerplate menu system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions