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