mirror of
https://github.com/actions/runner.git
synced 2025-12-17 15:59:37 +00:00
GitHub Actions Runner
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using GitHub.DistributedTask.ObjectTemplating.Tokens;
|
||||
|
||||
namespace GitHub.DistributedTask.ObjectTemplating.Schema
|
||||
{
|
||||
internal sealed class NullDefinition : ScalarDefinition
|
||||
{
|
||||
internal NullDefinition()
|
||||
{
|
||||
}
|
||||
|
||||
internal NullDefinition(MappingToken definition)
|
||||
: base(definition)
|
||||
{
|
||||
foreach (var definitionPair in definition)
|
||||
{
|
||||
var definitionKey = definitionPair.Key.AssertString($"{TemplateConstants.Definition} key");
|
||||
switch (definitionKey.Value)
|
||||
{
|
||||
case TemplateConstants.Null:
|
||||
var mapping = definitionPair.Value.AssertMapping($"{TemplateConstants.Definition} {TemplateConstants.Null}");
|
||||
foreach (var mappingPair in mapping)
|
||||
{
|
||||
var mappingKey = mappingPair.Key.AssertString($"{TemplateConstants.Definition} {TemplateConstants.Null} key");
|
||||
switch (mappingKey.Value)
|
||||
{
|
||||
default:
|
||||
mappingKey.AssertUnexpectedValue($"{TemplateConstants.Definition} {TemplateConstants.Null} key");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
definitionKey.AssertUnexpectedValue($"{TemplateConstants.Definition} key");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal override DefinitionType DefinitionType => DefinitionType.Null;
|
||||
|
||||
internal override Boolean IsMatch(LiteralToken literal)
|
||||
{
|
||||
return literal is NullToken;
|
||||
}
|
||||
|
||||
internal override void Validate(
|
||||
TemplateSchema schema,
|
||||
String name)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user