-
Notifications
You must be signed in to change notification settings - Fork 223
Conversation
Unblocks #968 scenarios for Razor pages |
@@ -35,39 +37,58 @@ public DefaultDirectiveDescriptorBuilder(string name, DirectiveDescriptorKind ty | |||
_tokenDescriptors = new List<DirectiveTokenDescriptor>(); | |||
} | |||
|
|||
public IDirectiveDescriptorBuilder AddType() | |||
public IDirectiveDescriptorBuilder AddType(bool optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having each API specify whether its optional or not we could make an API that direct the user into a state where they can't fail easily. Aka:
builder
.AddType()
.RemainingTokensOptional()
.AddString()
.AddMember();
And
builder
.AddType()
.RemainingTokensOptional()
.AddString()
.RemainingTokensOptional() // Explode
.AddMember();
We all know I'm horrible at naming choices but you get the gist 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sounds work-able.
@@ -1549,7 +1553,13 @@ private void HandleDirective(DirectiveDescriptor descriptor) | |||
outputKind = SpanKind.Code; | |||
break; | |||
case DirectiveTokenKind.String: | |||
AcceptAndMoveNext(); | |||
if (!AcceptAndMoveNext()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AcceptAndMoveNext()
fails only at EOF right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, might be so.
@@ -734,6 +734,23 @@ public void SectionDirective() | |||
.Accepts(AcceptedCharacters.None))); | |||
} | |||
|
|||
[Fact(Skip = "I don't know how to write Razor tests"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow
4946cca
to
4621cc1
Compare
🆙 📅 Getting this in to unblock Mvc. We can rev on the design \ code in the PR for #968 |
No description provided.