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