typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
108 stars 50 forks source link

Parse error on `{{!` mustache comment in `.gts` #706

Closed chancancode closed 3 months ago

chancancode commented 3 months ago
<template>
  {{!
    like this
  }}
</template>
Parse error on line 2:
...                  {{!                  
-----------------------^
Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'glint
chancancode commented 3 months ago

@NullVoxPopuli you tried this on #655? I would think the problem is that Glint is using too old a version of @glimmer/syntax, not because of the stuff content-tag would fix

chancancode commented 3 months ago

I think prettier wants to format into this style out of the box so this is somewhat of a blocker in converting .hbs files with comments

dfreeman commented 3 months ago

We have examples of this parsing fine in general (e.g. here), so this may need a more detailed reproduction

chancancode commented 3 months ago

Aha, you are right, it requires a back tick inside the comment, so @NullVoxPopuli is right that this is in fact #655 territories

export default class Foo {
  <template>{{! ` }}</template>
}