equal
deleted
inserted
replaced
138 static final int LEAD_SURROGATE_SHIFT = 10; |
138 static final int LEAD_SURROGATE_SHIFT = 10; |
139 static final int SURROGATE_OFFSET = SURROGATE_START - (LEAD_START << LEAD_SURROGATE_SHIFT) - TAIL_START; |
139 static final int SURROGATE_OFFSET = SURROGATE_START - (LEAD_START << LEAD_SURROGATE_SHIFT) - TAIL_START; |
140 |
140 |
141 static final int DONE = -1; |
141 static final int DONE = -1; |
142 |
142 |
143 final int nextCodePoint() { |
143 int nextCodePoint() { |
144 return nextCodePoint(limit); |
144 return nextCodePoint(limit); |
145 } |
145 } |
146 |
146 |
147 final int nextCodePoint(int lim) { |
147 int nextCodePoint(int lim) { |
148 if (pos >= lim) { |
148 if (pos >= lim) { |
149 return DONE; |
149 return DONE; |
150 } |
150 } |
151 int ch = text[pos++]; |
151 int ch = text[pos++]; |
152 if (ch >= LEAD_START && ch < LEAD_LIMIT && pos < lim) { |
152 if (ch >= LEAD_START && ch < LEAD_LIMIT && pos < lim) { |
157 } |
157 } |
158 } |
158 } |
159 return ch; |
159 return ch; |
160 } |
160 } |
161 |
161 |
162 final void pushback(int ch) { |
162 void pushback(int ch) { |
163 if (ch >= 0) { |
163 if (ch >= 0) { |
164 if (ch >= 0x10000) { |
164 if (ch >= 0x10000) { |
165 pos -= 2; |
165 pos -= 2; |
166 } else { |
166 } else { |
167 pos -= 1; |
167 pos -= 1; |