Skip to content

Commit e7362e0

Browse files
committed
notImmediatelyFollowedBy(CharacterSet)
1 parent d92ae76 commit e7362e0

File tree

1 file changed

+11
-0
lines changed
  • dot-parse/src/main/java/com/google/common/labs/parse

1 file changed

+11
-0
lines changed

dot-parse/src/main/java/com/google/common/labs/parse/Parser.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,17 @@ public final Parser<T> notImmediatelyFollowedBy(CharPredicate predicate, String
849849
return notFollowedBy(literally(single(predicate, name)), name);
850850
}
851851

852+
/**
853+
* A form of negative lookahead such that the match is rejected if <em>immediately</em> followed
854+
* by (no skippable characters as specified by {@link #parseSkipping parseSkipping()} in between)
855+
* a character contained in {@code characterSet}.
856+
*
857+
* @since 9.4
858+
*/
859+
public final Parser<T> notImmediatelyFollowedBy(CharacterSet characterSet) {
860+
return notImmediatelyFollowedBy(characterSet, characterSet.toString());
861+
}
862+
852863
/**
853864
* Starts a fluent chain for matching the current parser optionally. {@code defaultValue} will be
854865
* the result in case the current parser doesn't match.

0 commit comments

Comments
 (0)