ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Editorial: Refactor PartitionPattern for simplicity and comprehensibility

Open gibson042 opened this issue 2 years ago • 1 comments
trafficstars

  • Adds a prose description explaining treatment of brace-wrapped placeholders and adjacent literal text in converting a String pattern into an equivalent List of Records.
  • Renames spec aliases (beginIndexplaceholderStart, endIndexplaceholderEnd, pplaceholderName).
  • Adopts ECMA-262 phrasing conventions (e.g., "the substring of S from inclusiveStart [to exclusiveEnd]" and <///> operators).
  • Reduces unnecessary repetition (e.g., "If beginIndex > nextIndex, then Let literal be the substring of pattern from nextIndex to beginIndex and Append the Record { [[Type]]: "literal", [[Value]]: literal } to result." → "Let literal be the substring of pattern from placeholderEnd + 1 to placeholderStart and If literal is not the empty String, then Append the Record { [[Type]]: "literal", [[Value]]: literal } to result.").
  • Makes more obvious the omission of zero-length literal Records.
  • Increases alias reference locality (e.g., checking for a literal part between a previous placeholderEnd } and current placeholderStart { before advancing placeholderEnd for the current placeholder part).

gibson042 avatar Nov 14 '23 06:11 gibson042

@ryzokuken ping

gibson042 avatar Dec 15 '23 19:12 gibson042