Skip to content
  • Leon Arnott's avatar
    Implemented HookCommands, and converted a few macros to use their API. · 6bd997b33a40
    Leon Arnott authored
     * Commands now, contrary to previous plans, have a TwineScript_Run() that is separate from TwineScript_Print(). This is to clarify Harlowe's expression-printing logic and differentiate what exactly printing a data expression produces (currently, always a string of markup or a TwineError, with no side effects) vs. what running a command produces (either an earlyExit signal object or a ChangeDescriptor to permute the <tw-expression>, plus side effects). This forces one breaking change: (print:) no longer runs commands passed into it, instead merely printing a basic string representation.
    
     * (print:), (display:) and (link-goto:) are currently reimplemented as HookCommands, but they don't fully utilise their ChangeDescriptors yet.
    
     * Additionally, Macros now has addCommand(), which centralises the "command constructor" macro pattern. All other command macros' definitions (except for the (set:) bunch, whose commands need TwineScript_Unobservable) have been changed to use it.
    6bd997b33a40