Skip to content

Commit

Permalink
Add Ascii range to Token.
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Apr 3, 2015
1 parent a371656 commit a0910bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/org/joni/Lexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ private void fetchTokenFor_openBrace() {

private void fetchTokenFor_anchor(int subType) {
token.type = TokenType.ANCHOR;
token.setAnchor(subType);
token.setAnchorSubtype(subType);
}

private void fetchTokenFor_xBrace() {
Expand Down
2 changes: 1 addition & 1 deletion src/org/joni/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ private Node parseExp(TokenType term) {
break;

case ANCHOR:
node = new AnchorNode(token.getAnchor()); // possible bug in oniguruma
node = new AnchorNode(token.getAnchorSubtype());
break;

case OP_REPEAT:
Expand Down
13 changes: 7 additions & 6 deletions src/org/joni/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ void setCode(int code) {
INT1 = code;
}

int getAnchor() {
int getAnchorSubtype() {
return INT1;
}
void setAnchor(int anchor) {
void setAnchorSubtype(int anchor) {
INT1 = anchor;
}

int getSubtype() {
return INT1;
boolean getAnchorASCIIRange() {
return INT2 == 1;
}
void setSubtype(int subtype) {
INT1 = subtype;

void setAnchorASCIIRange(boolean ascii) {
INT2 = ascii ? 1 : 0;
}

// repeat union member
Expand Down

0 comments on commit a0910bb

Please sign in to comment.