[Doc/Bug] you may omit a single "end", but not two of them

This issue has been tracked since 2022-07-29.

According to the overview it is allowed to omit the end which terminates a feature or a statement if a new feature starts.

The following code, however

  <script type="text/hyperscript">
  on mousemove  if (event.target is not me) log 'delegated mousemove'
  on mouseenter if (event.target is not me) log 'delegated mouseenter'

fails to parse with the following error message

VM2252 about:srcdoc:167 hyperscript errors were found on the following element: <script type=​"text/​hyperscript">​…​</script>​ 

 Expected 'end' but found 'on'

  on mouseenter if (event.target is not me) log 'delegated mouseenter'

 Error: Expected 'end' but found 'on'

  on mouseenter if (event.target is not me) log 'delegated mouseenter'

    at a.raiseParseError (https://unpkg.com/hyperscript.org:1:11785)
    at i.raiseError (https://unpkg.com/hyperscript.org:1:5948)
    at i.requireToken (https://unpkg.com/hyperscript.org:1:6848)
    at https://unpkg.com/hyperscript.org:1:67955
    at n (https://unpkg.com/hyperscript.org:1:10985)
    at https://unpkg.com/hyperscript.org:1:8962
    at a.parseElement (https://unpkg.com/hyperscript.org:1:10515)
    at https://unpkg.com/hyperscript.org:1:9180
    at a.parseElement (https://unpkg.com/hyperscript.org:1:10515)
    at a.requireElement (https://unpkg.com/hyperscript.org:1:10706)

(and parsing seems to take longer than normal)

Adding an end after each if statement satisfies the parser, though

For me, it's unclear whether this is a bug or just a problem with the documentation which may be too unspecific here

More Details About Repo
Owner Name bigskysoftware
Repo Name _hyperscript
Full Name bigskysoftware/_hyperscript
Language JavaScript
Created Date 2020-05-27
Updated Date 2022-11-25
Star Count 1265
Watcher Count 18
Fork Count 75
Issue Count 86


Issue Title Created Date Updated Date