[jruby-joni] 06/11: Add support for a, u, d, and l group matching flags.
Hideki Yamane
henrich at moszumanska.debian.org
Fri Mar 18 23:24:23 UTC 2016
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch debian/sid
in repository jruby-joni.
commit ac5ed3b3b1499448ced87cffea4dc0ebda6b4660
Author: Charles Oliver Nutter <headius at headius.com>
Date: Thu Mar 3 15:35:48 2016 -0600
Add support for a, u, d, and l group matching flags.
---
src/org/joni/Parser.java | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/org/joni/Parser.java b/src/org/joni/Parser.java
index 77352b7..e480afd 100644
--- a/src/org/joni/Parser.java
+++ b/src/org/joni/Parser.java
@@ -550,6 +550,10 @@ class Parser extends Lexer {
case 'm':
case 's':
case 'x':
+ case 'a':
+ case 'd':
+ case 'l':
+ case 'u':
boolean neg = false;
while (true) {
switch(c) {
@@ -587,8 +591,42 @@ class Parser extends Lexer {
case 'a': /* limits \d, \s, \w and POSIX brackets to ASCII range */
if ((syntax.op2OptionPerl() || syntax.op2OptionRuby()) && !neg) {
- option = bsOnOff(option, Option.ASCII_RANGE, neg);
+ option = bsOnOff(option, Option.ASCII_RANGE, false);
+ option = bsOnOff(option, Option.POSIX_BRACKET_ALL_RANGE, true);
+ option = bsOnOff(option, Option.WORD_BOUND_ALL_RANGE, true);
+ break;
+ } else {
+ newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+ }
+ case 'u':
+ if ((syntax.op2OptionPerl() || syntax.op2OptionRuby()) && !neg) {
+ option = bsOnOff(option, Option.ASCII_RANGE, true);
+ option = bsOnOff(option, Option.POSIX_BRACKET_ALL_RANGE, true);
+ option = bsOnOff(option, Option.WORD_BOUND_ALL_RANGE, true);
+ break;
+ } else {
+ newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+ }
+
+ case 'd':
+ if (syntax.op2OptionPerl() && !neg) {
+ option = bsOnOff(option, Option.ASCII_RANGE, true);
+ } else if (syntax.op2OptionRuby() && !neg) {
+ option = bsOnOff(option, Option.ASCII_RANGE, false);
+ option = bsOnOff(option, Option.POSIX_BRACKET_ALL_RANGE, false);
+ option = bsOnOff(option, Option.WORD_BOUND_ALL_RANGE, false);
+ } else {
+ newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
}
+ break;
+
+ case 'l':
+ if (syntax.op2OptionPerl() && !neg) {
+ option = bsOnOff(option, Option.ASCII_RANGE, true);
+ } else {
+ newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
+ }
+ break;
default:
newSyntaxException(ERR_UNDEFINED_GROUP_OPTION);
} // switch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git
More information about the pkg-java-commits
mailing list