forked from jasder/antlr
C++ target implementation for [c695ed2
].
This commit is contained in:
parent
fa14b9aad8
commit
9eb2a31179
|
@ -384,18 +384,17 @@ std::string BufferedTokenStream::getSourceName() const
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string BufferedTokenStream::getText() {
|
std::string BufferedTokenStream::getText() {
|
||||||
lazyInit();
|
|
||||||
fill();
|
|
||||||
return getText(misc::Interval(0U, size() - 1));
|
return getText(misc::Interval(0U, size() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string BufferedTokenStream::getText(const misc::Interval &interval) {
|
std::string BufferedTokenStream::getText(const misc::Interval &interval) {
|
||||||
|
lazyInit();
|
||||||
|
fill();
|
||||||
size_t start = interval.a;
|
size_t start = interval.a;
|
||||||
size_t stop = interval.b;
|
size_t stop = interval.b;
|
||||||
if (start == INVALID_INDEX || stop == INVALID_INDEX) {
|
if (start == INVALID_INDEX || stop == INVALID_INDEX) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
lazyInit();
|
|
||||||
if (stop >= _tokens.size()) {
|
if (stop >= _tokens.size()) {
|
||||||
stop = _tokens.size() - 1;
|
stop = _tokens.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue