Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in symbolMatches when a production contains an <ins> tag #448

Closed
rbuckton opened this issue May 17, 2022 · 2 comments
Closed

crash in symbolMatches when a production contains an <ins> tag #448

rbuckton opened this issue May 17, 2022 · 2 comments

Comments

@rbuckton
Copy link
Contributor

I see the following crash if an SDO contains an <emu-grammar> with a nested <ins>:

Error: unimplemented: symbol matches ins
    at symbolMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1719:19)
    at symbolSpanMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1674:22)
    at symbolSpanMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1675:16)
    at symbolSpanMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1675:16)
    at symbolSpanMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1680:16)
    at symbolSpanMatches C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1675:16)
    at rhsMatches (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1666:12)
    at C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1367:63
    at Array.filter (<anonymous>)
    at Spec.generateSDOMap (C:\dev\proposal-foo\node_modules\ecmarkup\lib\Spec.js:1367:51)

Example:

<emu-clause id="sec-foo">
  <h1>Foo</h1>
  <emu-grammar type="definition">
    Foo :
      Bar <ins>`;`</ins>
  </emu-grammar>
</emu-clause>

<emu-clause id="sec-runtime-semantics-evaluation" type="sdo">
  <h1>
    Runtime Semantics: Evaluation (
      _arg_: unknown
    )
  </h1>
  <dl class="header">
  </dl>
  <emu-grammar>
    Foo : Bar <ins>`;`</ins>
  </emu-grammar>
  <emu-alg>
    1.
  </emu-alg>
</emu-clause>

The only workaround is to change the emu-grammar in the SDO to wrap the whole production:

  <emu-grammar>
    <del>Foo : Bar</del>
    <ins>Foo : Bar `;`</ins>
  </emu-grammar>
@bakkot
Copy link
Contributor

bakkot commented May 18, 2022

Thanks for the report, will fix. Fix will involve switching this logic to operate on grammarkdown nodes directly, which will avoid this problem.

@bakkot
Copy link
Contributor

bakkot commented May 19, 2022

Fixed by #449, published in 12.1.0.

@bakkot bakkot closed this as completed May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants