Polyman Documentation - v3.0.0
    Preparing search index...

    Function toPolygonScript

    • Rewrites generator references for upload to Polygon.

      Locally a script line starts with Config.json.generators[].name, which is free-form (gen-random). Polygon resolves the same token against the uploaded source file name without its extension (gen for gen.cpp), so a script pushed verbatim breaks whenever the two differ. Comments, FreeMarker directives, arguments and targets are preserved byte-for-byte; only the leading generator token of each command line is swapped.

      Parameters

      • script: string

        raw local script text

      • generators: LocalGenerator[]

        configured generators used to map name -> source

      Returns string

      script text safe to send to problem.saveScript

      toPolygonScript('gen-random 10 > $', [
      { name: 'gen-random', source: './generators/gen.cpp' },
      ]);
      // Returns: 'gen 10 > $'