emberjs / emberjs/ember.js

[syntax] Repeated `<`s before a valid tag are silently ignored

Open
#21,027 0 comments 1 reaction 0 assignees View on GitHub
glimmervm
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

In `@glimmer/syntax`, the string `<` is parsed the same as the string `< Foo />` — any number of repeated `<` characters before the start of the tag name end up being silently dropped. As an example, the JSON output in these two ASTExplorer gists is identical:
- https://astexplorer.net/#/gist/f1ee151b94b7ec56ed4fcbc63d1f3beb
- https://astexplorer.net/#/gist/a19af922f163c413da9474c41a08cc6a

I spent a bit of time last week [exploring how an error-recovery parse mode might look](https://github.com/glimmerjs/glimmer-vm/compare/master...dfreeman:error-recovery), but since this situation doesn't throw an error, there's nothing to recover from. It seems like this should produce a syntax error?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.