コード例 #1
0
ファイル: SyntaxValidator.cs プロジェクト: VRCMG/CumLoader
 public override void Visit(BareKeySyntax bareKey)
 {
     if (bareKey.Key == null)
     {
         _diagnostics.Error(bareKey.Span, $"A BareKeySyntax must have a non null property Key");
     }
     base.Visit(bareKey);
 }
コード例 #2
0
 /// <summary>
 /// Creates an instance of <see cref="DottedKeyItemSyntax"/>
 /// </summary>
 /// <param name="key">The key used after the `.`</param>
 public DottedKeyItemSyntax(string key) : this()
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     Dot = SyntaxFactory.Token(TokenKind.Dot);
     Key = BareKeySyntax.IsBareKey(key) ? (BareKeyOrStringValueSyntax) new BareKeySyntax(key) : new StringValueSyntax(key);
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of a <see cref="KeySyntax"/>
 /// </summary>
 /// <param name="key">the base key</param>
 /// <param name="dotKey1">the key after the dot</param>
 public KeySyntax(string key, string dotKey1) : this()
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     if (dotKey1 == null)
     {
         throw new ArgumentNullException(nameof(dotKey1));
     }
     Key = BareKeySyntax.IsBareKey(key) ? (BareKeyOrStringValueSyntax) new BareKeySyntax(key) : new StringValueSyntax(key);
     DotKeys.Add(new DottedKeyItemSyntax(dotKey1));
 }
コード例 #4
0
 public virtual void Visit(BareKeySyntax bareKey)
 {
     DefaultVisit(bareKey);
 }
コード例 #5
0
 /// <summary>
 /// Creates a new instance of a <see cref="KeySyntax"/>
 /// </summary>
 /// <param name="key">A simple name of this key</param>
 public KeySyntax(string key) : this()
 {
     Key = BareKeySyntax.IsBareKey(key) ? (BareKeyOrStringValueSyntax) new BareKeySyntax(key) : new StringValueSyntax(key);
 }