Skip to content

Commit a0910bb

Browse files
committed
Add Ascii range to Token.
1 parent a371656 commit a0910bb

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/org/joni/Lexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ private void fetchTokenFor_openBrace() {
756756

757757
private void fetchTokenFor_anchor(int subType) {
758758
token.type = TokenType.ANCHOR;
759-
token.setAnchor(subType);
759+
token.setAnchorSubtype(subType);
760760
}
761761

762762
private void fetchTokenFor_xBrace() {

src/org/joni/Parser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ private Node parseExp(TokenType term) {
865865
break;
866866

867867
case ANCHOR:
868-
node = new AnchorNode(token.getAnchor()); // possible bug in oniguruma
868+
node = new AnchorNode(token.getAnchorSubtype());
869869
break;
870870

871871
case OP_REPEAT:

src/org/joni/Token.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ void setCode(int code) {
4646
INT1 = code;
4747
}
4848

49-
int getAnchor() {
49+
int getAnchorSubtype() {
5050
return INT1;
5151
}
52-
void setAnchor(int anchor) {
52+
void setAnchorSubtype(int anchor) {
5353
INT1 = anchor;
5454
}
5555

56-
int getSubtype() {
57-
return INT1;
56+
boolean getAnchorASCIIRange() {
57+
return INT2 == 1;
5858
}
59-
void setSubtype(int subtype) {
60-
INT1 = subtype;
59+
60+
void setAnchorASCIIRange(boolean ascii) {
61+
INT2 = ascii ? 1 : 0;
6162
}
6263

6364
// repeat union member

0 commit comments

Comments
 (0)