public static string AcceptIdentifier(this ParserContext context) { // Identifier Start is a proper subset of Identifier Part, so this will also parse the start character if (ParserHelpers.IsIdentifierStart(context.CurrentCharacter)) { return(context.AcceptWhile(c => ParserHelpers.IsIdentifierPart(c))); } return(null); }
public static string AcceptUntil(this ParserContext context, Predicate <char> condition) { return(context.AcceptWhile(c => !condition(c))); }