private static Parser <TResult> DefIdentifierPropertyDeclarations <TResult>( string symbol, Func <Identifier, IEnumerable <PropertyDeclaration>, TResult> selectFunction) { return((from declaration in Symbol(symbol).Token() from name in CSharpGrammar.Identifier().Token() from propertyDeclarations in PropertyDeclarations select selectFunction(name, propertyDeclarations)) .Contained(TokenGrammar.LeftParen, TokenGrammar.RightParen) .Named(symbol)); }
public void Identifier_ValidSingleLetter_ShouldParse() { var actual = SystemUnderTest.Identifier().Parse("x"); Assert.That(actual.Name, Is.EqualTo("x")); }