示例#1
0
 public CustomElementDescriptor WithHint(CompletionHint hint)
 {
     if (this.CompletionHint == hint)
     {
         return(this);
     }
     return(new CustomElementDescriptor(this.Name, hint, this.IsOptional));
 }
示例#2
0
 /// <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 })));
 }
示例#3
0
 public CustomElementDescriptor(CompletionHint hint, bool isOptional = false)
     : this("", hint, isOptional)
 {
 }
示例#4
0
 public CustomElementDescriptor(string name, CompletionHint hint, bool isOptional = false)
 {
     this.Name           = name ?? "";
     this.IsOptional     = isOptional;
     this.CompletionHint = hint;
 }