예제 #1
0
 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);
 }
예제 #2
0
 public static string AcceptUntil(this ParserContext context, Predicate <char> condition)
 {
     return(context.AcceptWhile(c => !condition(c)));
 }