File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/main/java/com/github/sgreben/regex_builder/charclass Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11package com .github .sgreben .regex_builder .charclass ;
22
33import com .github .sgreben .regex_builder .CharClass ;
4- import com .github .sgreben .regex_builder .tokens .*;
4+ import com .github .sgreben .regex_builder .tokens .CARET ;
5+ import com .github .sgreben .regex_builder .tokens .DASH ;
6+ import com .github .sgreben .regex_builder .tokens .END_CHAR_CLASS ;
7+ import com .github .sgreben .regex_builder .tokens .RAW ;
8+ import com .github .sgreben .regex_builder .tokens .START_CHAR_CLASS ;
9+ import com .github .sgreben .regex_builder .tokens .TOKEN ;
510
611public class RangeComplement extends Nullary {
712 private final char [] range ;
13+
814 public RangeComplement (char ... range ) {
915 this .range = range ;
1016 }
1117
1218 @ Override
13- public CharClass complement () { return new RawComplement (this ); }
19+ public CharClass complement () {
20+ return new Range (range );
21+ }
1422
1523 @ Override
1624 public void compile (java .util .List <TOKEN > output ) {
1725 output .add (new START_CHAR_CLASS ());
1826 output .add (new CARET ());
19- for (int i = 0 ; i < range .length ; i += 2 ) {
20- output .add (new RAW ("" + range [i ]));
27+ for (int i = 0 ; i < range .length ; i += 2 ) {
28+ output .add (new RAW ("" + range [i ]));
2129 output .add (new DASH ());
22- output .add (new RAW ("" + range [i + 1 ]));
30+ output .add (new RAW ("" + range [i + 1 ]));
2331
2432 }
2533 output .add (new END_CHAR_CLASS ());
You can’t perform that action at this time.
0 commit comments