Page MenuHomePhabricator

Stitching
Updated 2,305 Days AgoPublic

  1. The pass should search the model and find all of its substitutions (regex: {1:(?:\d-\d|[A-Z])(?::[prs])?}, with # being the pass number.
  2. The master index i and the substitution counter subcount should both be reset to 0
  3. For each substitution marker...
    1. Create a new Substitution object, storing all of the valid values in order, and the end-of-column behavior (rule). The object must be able to be looked up by its substitution.
    2. Increment the substitution counter subcount.
  4. Using regex, replace each relevant substitution marker with the appropriate replacements, probably using something like substitute("{1:A:r}", i). Resolving the index i to the proper value following rules must take place inside of the substitution object itself.
  5. Check each substitution object (probably with something like status("{1:A:r}") for completion Use return codes, such as 0=not done, 1=done, 2=done, force stop. Decrement subcount for each return 1, and drop to 0 upon encountering any return 2.
  6. Once subcount == 0, the pass is done. For each pre-result, repeat for the next pass from step 1.
NOTE: If there are still valid substitution markers, but none for a given pass, skip to the next. Don't require the user to always have the pass numbers in order. Mistakes happen - be nice.
Last Author
jcmcdonald
Last Edited
Apr 22 2016, 7:17 PM