Skip to content

Enhancement: allow a list of interval specifications #539

@andrewsf

Description

@andrewsf

Extend

trigger : EVERY interval DO block END #TimerTrigger

to:

trigger : EVERY interval (COMMA interval)* DO block END           #TimerTrigger

And then just process the block as multiple entries, as if each has been written out fully.

Example:

EVERY 20 TICKS, 20+5 TICKS, 20+10 TICKS, 20+15 TICKS DO
    foo
END

--
-- Equivalent to:
--
-- EVERY 20 TICKS DO
--    foo
-- END
-- EVERY 20+5 TICKS DO
--    foo
-- END
-- EVERY 20+10 TICKS DO
--    foo
-- END
-- EVERY 20+15 TICKS DO
--    foo
-- END

Yes, this does let people easily bypass the usual minimum. But they can already do that by writing multiple blocks, or as I see constantly in ATM10-land, they use EVERY REDSTONE PULSE DO and throw it up against a timer -- which is less flexible than, say, EVERY 20G + 3 TICKS, 20G + 16 TICKS DO.

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