Skip to content

Commit 9ebae9c

Browse files
committed
Implement feature
1 parent b0d2bc0 commit 9ebae9c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

NanoArguments/Tree/Nodes/Branch/LiteralNode.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
using System;
2+
using System.Collections.Generic;
23

34
namespace NanoArguments.Tree.Nodes.Branch;
45

5-
public class LiteralNode(string literal) : BranchNode
6+
public class LiteralNode(ISet<string> literal) : BranchNode
67
{
8+
public LiteralNode(string literal) : this(new HashSet<string> { literal }) { }
9+
710
public override bool Check(ParsingContext context, uint pos)
811
{
9-
return context.ParserResult.PositionalArgs[pos] == literal;
12+
return literal.Contains(context.ParserResult.PositionalArgs[pos]);
1013
}
1114

1215
public override Action<ParsingContext> Parse(ParsingContext context, uint pos)

0 commit comments

Comments
 (0)