public CustomElementDescriptor WithHint(CompletionHint hint) { if (this.CompletionHint == hint) { return(this); } return(new CustomElementDescriptor(this.Name, hint, this.IsOptional)); }
/// <summary> /// Creates a new version of the parser with the CompletionHint annotation set. /// </summary> public static Parser <LexicalToken, TElement> WithCompletionHint <TElement>(this Parser <LexicalToken, TElement> parser, CompletionHint hint) { return(parser.WithAnnotations(parser.Annotations.Where(a => !(a is CompletionHint)).Concat(new[] { (object)hint }))); }
public CustomElementDescriptor(CompletionHint hint, bool isOptional = false) : this("", hint, isOptional) { }
public CustomElementDescriptor(string name, CompletionHint hint, bool isOptional = false) { this.Name = name ?? ""; this.IsOptional = isOptional; this.CompletionHint = hint; }