/// <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); }
/// <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)); }
/// <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); }