-
Notifications
You must be signed in to change notification settings - Fork 223
DirectiveDescriptorBuild should throw for directives that wouldn't be parsed correctly #981
Comments
Wouldn't this parse as |
It could, but that's not what we've allowed in Razor in the past. We should enforce a convention. Up till today we've followed the camel case convention for Razor directives, i.e. |
I think it parsed it as two separate tokens when I tried this in a test. We should either support it in the parser or throw ahead of time. I assumed we were 🐫 casers, hence the work item. |
tl,dr: 🐫 > 🐍 |
Ah I see. We should define the set of characters that are allowed in directives and validate that. Conventions are just conventions, not rules. |
For now I'm only going to allow letters here. If someone comes up with a killer use case later we can make it full c# identifiers. |
For instance
DirectiveDescriptorBuilder.Create("my-directive").Build()
works correctly, but the parser requires an identifier token to be a descriptor name.The text was updated successfully, but these errors were encountered: