News for hackers. Stuff that matters.
Re:Puffs: Parsing Untrusted File Formats Safely by evincarofautumn on Thursday November 16, 2017 @11:16AM (#15713815)
One way to do it would be to have a default associativity between different operators, but chains of the same operator can override it, e.g. suppose “⧺” means concatenation (rightward), “×” means repetition (leftward), and the default is leftward:

      [1, 2] ⧺  [3, 4] ⧺ [5, 6]   × 2  × 3
    (([1, 2] ⧺ ([3, 4] ⧺ [5, 6])) × 2) × 3

    [ [ [1…6], [1…6] ],
      [ [1…6], [1…6] ],
      [ [1…6], [1…6] ] ]
I dunno how good an idea that would be in practice, though.

There are no comments on this comment yet.