Skip to content

Commit

Permalink
Update description of emphasis parsing algorithm in spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Jun 17, 2021
1 parent 5ddde19 commit a3ab74d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9706,8 +9706,7 @@ just above `stack_bottom` (or the first element if `stack_bottom`
is NULL).

We keep track of the `openers_bottom` for each delimiter
type (`*`, `_`) and each length of the closing delimiter run
(modulo 3). Initialize this to `stack_bottom`.
type (`*`, `_`). Initialize this to `stack_bottom`.

Then we repeat the following until we run out of potential
closers:
Expand Down Expand Up @@ -9741,9 +9740,13 @@ closers:

- If none is found:

+ Set `openers_bottom` to the element before `current_position`.
(We know that there are no openers for this kind of closer up to and
including this point, so this puts a lower bound on future searches.)
+ Set `openers_bottom` for this delimiter type to the element
before the first potential opener that was rejected solely
because of the "multiple of 3" rule, or to the element
before `current_position`, if there are no such potential
openers. (We know that there are no openers for this kind
of closer up to and including this point, so this puts a
lower bound on future searches.)

+ If the closer at `current_position` is not a potential opener,
remove it from the delimiter stack (since we know it can't
Expand Down

0 comments on commit a3ab74d

Please sign in to comment.