@@ -252,16 +252,16 @@ public static Parser<String> first(String target) {
252252 }
253253
254254 /** Matches a literal {@code string}. */
255- public static Parser <String > string (String value ) {
256- checkArgument (value .length () > 0 , "value cannot be empty" );
255+ public static Parser <String > string (String string ) {
256+ checkArgument (string .length () > 0 , "string cannot be empty" );
257257 return new Parser <>() {
258258 @ Override MatchResult <String > skipAndMatch (
259259 Parser <?> skip , CharInput input , int start , ErrorContext context ) {
260260 start = skipIfAny (skip , input , start );
261- if (input .startsWith (value , start )) {
262- return new MatchResult .Success <>(start , start + value .length (), value );
261+ if (input .startsWith (string , start )) {
262+ return new MatchResult .Success <>(start , start + string .length (), string );
263263 }
264- return context .expecting (value , start );
264+ return context .expecting (string , start );
265265 }
266266 };
267267 }
@@ -270,30 +270,29 @@ public static Parser<String> string(String value) {
270270 * Matches a literal {@code string} case insensitively.
271271 *
272272 * <p>If you need to access the input substring that matched case insensitively,
273- * you can use {@code .source()}.
273+ * consider using {@code .source()}.
274274 *
275275 * @since 9.9.3
276276 */
277277 public static Parser <?> caseInsensitive (String string ) {
278- checkArgument (string .length () > 0 , "value cannot be empty" );
278+ checkArgument (string .length () > 0 , "string cannot be empty" );
279279 return new Parser <String >() {
280280 @ Override MatchResult <String > skipAndMatch (
281281 Parser <?> skip , CharInput input , int start , ErrorContext context ) {
282282 start = skipIfAny (skip , input , start );
283283 if (input .startsWithCaseInsensitive (string , start )) {
284- return new MatchResult .Success <>(
285- start , start + string .length (), input .snippet (start , string .length ()));
284+ return new MatchResult .Success <>(start , start + string .length (), string );
286285 }
287286 return context .expecting (string , start );
288287 }
289288 };
290289 }
291290
292291 /**
293- * {@code caseInsensitiveWord("or")} matches "Or" and "OR", but not "orange", case insensitively .
292+ * {@code caseInsensitiveWord("or")} matches "Or" and "OR", but not "orange".
294293 *
295294 * <p>If you need to access the input substring that matched case insensitively,
296- * you can use {@code .source()}.
295+ * consider using {@code .source()}.
297296 *
298297 * @since 9.9.3
299298 */
0 commit comments