Skip to content
  • Jonas Maebe's avatar
    + merged nestedprocvars branch · 57bd6d26
    Jonas Maebe authored
      + support for nested procedural variables:
        o activate using {$modeswitch nestedprocvars} (compatible with all
          regular syntax modes, enabled by default for MacPas mode)
        o activating this mode switch changes the way the frame pointer is
          passed to nested routines into the same way that Delphi uses (always
          passed via the stack, and if necessary removed from the stack by
          the caller) -- Todo: possibly also allow using this parameter
          passing convention without enabling nested procvars, maybe even
          by default in Delphi mode, see mantis #9432
        o both global and nested routines can be passed to/assigned to a
          nested procvar (and called via them). Note that converting global
          *procvars* to nested procvars is intentionally not supported, so
          that this functionality can also be implemented via compile-time
          generated trampolines if necessary (e.g. for LLVM or CIL backends
          as long as they don't support the aforementioned parameter passing
          convention)
        o a nested procvar can both be declared using a Mac/ISO Pascal style
          "inline" type declaration as a parameter type, or as a stand-alone
          type (in the latter case, add "is nested" at the end in analogy to
          "of object" for method pointers -- note that using variables of
          such a type is dangerous, because if you call them once the enclosing
          stack frame no longer exists on the stack, the results are
          undefined; this is however allowed for Metaware Pascal compatibility)
    
    git-svn-id: trunk@15694 -
    57bd6d26