Import YamlDotNet.

This commit is contained in:
2022-12-12 22:23:49 +08:00
parent f559cea826
commit 1477e907e6
462 changed files with 27142 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents an anchor token.
/// </summary>
public class Anchor : Token
{
/// <summary>
/// Gets the value.
/// </summary>
/// <value>The value.</value>
public AnchorName Value { get; }
/// <summary>
/// Initializes a new instance of the <see cref="Anchor"/> class.
/// </summary>
/// <param name="value">The value.</param>
public Anchor(AnchorName value)
: this(value, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Anchor"/> class.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public Anchor(AnchorName value, Mark start, Mark end)
: base(start, end)
{
if (value.IsEmpty)
{
throw new ArgumentNullException(nameof(value));
}
this.Value = value;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 20dff0ad997e6bf4fb74167f52869056
timeCreated: 1427145263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,61 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents an alias token.
/// </summary>
public sealed class AnchorAlias : Token
{
/// <summary>
/// Gets the value of the alias.
/// </summary>
public AnchorName Value { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AnchorAlias"/> class.
/// </summary>
/// <param name="value">The value of the anchor.</param>
public AnchorAlias(AnchorName value)
: this(value, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AnchorAlias"/> class.
/// </summary>
/// <param name="value">The value of the anchor.</param>
/// <param name="start">The start position of the event.</param>
/// <param name="end">The end position of the event.</param>
public AnchorAlias(AnchorName value, Mark start, Mark end)
: base(start, end)
{
if (value.IsEmpty)
{
throw new ArgumentNullException(nameof(value));
}
this.Value = value;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5888a3fb8858cd9419759f27390f4801
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a block end token.
/// </summary>
public sealed class BlockEnd : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="BlockEnd"/> class.
/// </summary>
public BlockEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BlockEnd"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public BlockEnd(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0ac69775d00ee4d4ba4b918c06086302
timeCreated: 1427145262
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a block entry event.
/// </summary>
public sealed class BlockEntry : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="BlockEntry"/> class.
/// </summary>
public BlockEntry()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BlockEntry"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public BlockEntry(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c3a1850190300d5479da07fdb53767f0
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a block mapping start token.
/// </summary>
public sealed class BlockMappingStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="BlockMappingStart"/> class.
/// </summary>
public BlockMappingStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BlockMappingStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public BlockMappingStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9f8bc35d16193164aaee492bc767e9f8
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a block sequence start token.
/// </summary>
public sealed class BlockSequenceStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="BlockSequenceStart"/> class.
/// </summary>
public BlockSequenceStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="BlockSequenceStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public BlockSequenceStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 827b4413642f10d4891e4b1771c5ad45
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a comment
/// </summary>
public sealed class Comment : Token
{
/// <summary>
/// Gets the value of the comment
/// </summary>
public string Value { get; }
/// <summary>
/// Gets a value indicating whether the comment appears other tokens on that line.
/// </summary>
public bool IsInline { get; }
/// <summary>
/// Initializes a new instance of the <see cref="Comment"/> class.
/// </summary>
public Comment(string value, bool isInline)
: this(value, isInline, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Comment"/> class.
/// </summary>
public Comment(string value, bool isInline, Mark start, Mark end)
: base(start, end)
{
Value = value ?? throw new ArgumentNullException(nameof(value));
IsInline = isInline;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7faa8193237a87f41aa6e2a84836b348
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a document end token.
/// </summary>
public sealed class DocumentEnd : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="DocumentEnd"/> class.
/// </summary>
public DocumentEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentEnd"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public DocumentEnd(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b70a27ee4c4c7c24e9df5b0ec3a2c6da
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a document start token.
/// </summary>
public sealed class DocumentStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
public DocumentStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="DocumentStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public DocumentStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2c86a143ce13faf4e90cece89b865c8a
timeCreated: 1427145263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Base class for YAML tokens.
/// </summary>
internal class Error : Token
{
/// <summary>
/// Gets the value of the comment
/// </summary>
internal string Value { get; }
internal Error(string value, Mark start, Mark end)
: base(start, end)
{
Value = value;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e436b2b70e29aee4eb8759edbc3303de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a flow entry event.
/// </summary>
public sealed class FlowEntry : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowEntry"/> class.
/// </summary>
public FlowEntry()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FlowEntry"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public FlowEntry(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f6de9d5d89c756c49882403cf8b79eed
timeCreated: 1427145267
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a flow mapping end token.
/// </summary>
public sealed class FlowMappingEnd : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowMappingEnd"/> class.
/// </summary>
public FlowMappingEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FlowMappingEnd"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public FlowMappingEnd(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6e66c86850cf7a545bfa90d7c9b1831a
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a flow mapping start token.
/// </summary>
public sealed class FlowMappingStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowMappingStart"/> class.
/// </summary>
public FlowMappingStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FlowMappingStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public FlowMappingStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d357652b21a405949a837dbef084c7e3
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a flow sequence end token.
/// </summary>
public sealed class FlowSequenceEnd : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowSequenceEnd"/> class.
/// </summary>
public FlowSequenceEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FlowSequenceEnd"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public FlowSequenceEnd(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5338410489b921f4c873cbed0c5b7754
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a flow sequence start token.
/// </summary>
public sealed class FlowSequenceStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="FlowSequenceStart"/> class.
/// </summary>
public FlowSequenceStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="FlowSequenceStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public FlowSequenceStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8248df61d7f1e7e4fbd6db14a760c5cd
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a key token.
/// </summary>
public sealed class Key : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="Key"/> class.
/// </summary>
public Key()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Key"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public Key(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d3197efde30ce804d81b7698c3c9c5a6
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a scalar token.
/// </summary>
public sealed class Scalar : Token
{
/// <summary>
/// Gets the value.
/// </summary>
/// <value>The value.</value>
public string Value { get; }
/// <summary>
/// Gets the style.
/// </summary>
/// <value>The style.</value>
public ScalarStyle Style { get; }
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="value">The value.</param>
public Scalar(string value)
: this(value, ScalarStyle.Any)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="style">The style.</param>
public Scalar(string value, ScalarStyle style)
: this(value, style, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Scalar"/> class.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="style">The style.</param>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public Scalar(string value, ScalarStyle style, Mark start, Mark end)
: base(start, end)
{
this.Value = value ?? throw new ArgumentNullException(nameof(value));
this.Style = style;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d8a37767e1f6b1949b357766c6f98776
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a stream end event.
/// </summary>
public sealed class StreamEnd : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="StreamEnd"/> class.
/// </summary>
public StreamEnd()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamEnd"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public StreamEnd(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7f214337aa3dd71439c3a1ee6e5ef79d
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a stream start token.
/// </summary>
public sealed class StreamStart : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="StreamStart"/> class.
/// </summary>
public StreamStart()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="StreamStart"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public StreamStart(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c0787d33a81177840836ef7dba3d0b75
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a tag token.
/// </summary>
public sealed class Tag : Token
{
/// <summary>
/// Gets the handle.
/// </summary>
/// <value>The handle.</value>
public string Handle { get; }
/// <summary>
/// Gets the suffix.
/// </summary>
/// <value>The suffix.</value>
public string Suffix { get; }
/// <summary>
/// Initializes a new instance of the <see cref="Tag"/> class.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="suffix">The suffix.</param>
public Tag(string handle, string suffix)
: this(handle, suffix, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Tag"/> class.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="suffix">The suffix.</param>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public Tag(string handle, string suffix, Mark start, Mark end)
: base(start, end)
{
this.Handle = handle ?? throw new ArgumentNullException(nameof(handle));
this.Suffix = suffix ?? throw new ArgumentNullException(nameof(suffix));
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2c6cb793327f6a349964aa8538bc1e33
timeCreated: 1427145263
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,118 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
using System.Text.RegularExpressions;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a tag directive token.
/// </summary>
public class TagDirective : Token
{
/// <summary>
/// Gets the handle.
/// </summary>
/// <value>The handle.</value>
public string Handle { get; }
/// <summary>
/// Gets the prefix.
/// </summary>
/// <value>The prefix.</value>
public string Prefix { get; }
/// <summary>
/// Initializes a new instance of the <see cref="TagDirective"/> class.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="prefix">The prefix.</param>
public TagDirective(string handle, string prefix)
: this(handle, prefix, Mark.Empty, Mark.Empty)
{
}
private static readonly Regex TagHandlePattern = new Regex(@"^!([0-9A-Za-z_\-]*!)?$", StandardRegexOptions.Compiled);
/// <summary>
/// Initializes a new instance of the <see cref="TagDirective"/> class.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="prefix">The prefix.</param>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public TagDirective(string handle, string prefix, Mark start, Mark end)
: base(start, end)
{
if (string.IsNullOrEmpty(handle))
{
throw new ArgumentNullException(nameof(handle), "Tag handle must not be empty.");
}
if (!TagHandlePattern.IsMatch(handle))
{
throw new ArgumentException("Tag handle must start and end with '!' and contain alphanumerical characters only.", nameof(handle));
}
this.Handle = handle;
if (string.IsNullOrEmpty(prefix))
{
throw new ArgumentNullException(nameof(prefix), "Tag prefix must not be empty.");
}
this.Prefix = prefix;
}
/// <summary>
/// Determines whether the specified System.Object is equal to the current System.Object.
/// </summary>
/// <param name="obj">The System.Object to compare with the current System.Object.</param>
/// <returns>
/// true if the specified System.Object is equal to the current System.Object; otherwise, false.
/// </returns>
public override bool Equals(object? obj)
{
return obj is TagDirective other
&& Handle.Equals(other.Handle)
&& Prefix.Equals(other.Prefix);
}
/// <summary>
/// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
/// A hash code for the current <see cref="T:System.Object"/>.
/// </returns>
public override int GetHashCode()
{
return Handle.GetHashCode() ^ Prefix.GetHashCode();
}
/// <summary/>
public override string ToString()
{
return $"{Handle} => {Prefix}";
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: dc25c68d7148e424ba5d875871c1aec8
timeCreated: 1427145266
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
using System;
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Base class for YAML tokens.
/// </summary>
public abstract class Token
{
/// <summary>
/// Gets the start of the token in the input stream.
/// </summary>
public Mark Start { get; }
/// <summary>
/// Gets the end of the token in the input stream.
/// </summary>
public Mark End { get; }
/// <summary>
/// Initializes a new instance of the <see cref="Token"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
protected Token(Mark start, Mark end)
{
this.Start = start ?? throw new ArgumentNullException(nameof(start));
this.End = end ?? throw new ArgumentNullException(nameof(end));
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9674e003fb73bba4cbf5ab487614a0d8
timeCreated: 1427145265
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,47 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a value token.
/// </summary>
public sealed class Value : Token
{
/// <summary>
/// Initializes a new instance of the <see cref="Value"/> class.
/// </summary>
public Value()
: this(Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Value"/> class.
/// </summary>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public Value(Mark start, Mark end)
: base(start, end)
{
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0fe0dfc9c858f2248a691e2f52bdfdff
timeCreated: 1427145262
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,80 @@
// This file is part of YamlDotNet - A .NET library for YAML.
// Copyright (c) Antoine Aubry and contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace YamlDotNet.Core.Tokens
{
/// <summary>
/// Represents a version directive token.
/// </summary>
public sealed class VersionDirective : Token
{
/// <summary>
/// Gets the version.
/// </summary>
/// <value>The version.</value>
public Version Version { get; }
/// <summary>
/// Initializes a new instance of the <see cref="VersionDirective"/> class.
/// </summary>
/// <param name="version">The version.</param>
public VersionDirective(Version version)
: this(version, Mark.Empty, Mark.Empty)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="VersionDirective"/> class.
/// </summary>
/// <param name="version">The version.</param>
/// <param name="start">The start position of the token.</param>
/// <param name="end">The end position of the token.</param>
public VersionDirective(Version version, Mark start, Mark end)
: base(start, end)
{
this.Version = version;
}
/// <summary>
/// Determines whether the specified System.Object is equal to the current System.Object.
/// </summary>
/// <param name="obj">The System.Object to compare with the current System.Object.</param>
/// <returns>
/// true if the specified System.Object is equal to the current System.Object; otherwise, false.
/// </returns>
public override bool Equals(object? obj)
{
return obj is VersionDirective other
&& Version.Equals(other.Version);
}
/// <summary>
/// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
/// A hash code for the current <see cref="T:System.Object"/>.
/// </returns>
public override int GetHashCode()
{
return Version.GetHashCode();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5e236aab8cd03d94295778001f592ec1
timeCreated: 1427145264
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: