| Index: src/scanner-base.h
|
| diff --git a/src/scanner-base.h b/src/scanner-base.h
|
| index 1024ad18582e3c078793d2295fe3cb8a92d23b18..02b747c5b8ed71f8432a4ce0f24319da4567ad03 100644
|
| --- a/src/scanner-base.h
|
| +++ b/src/scanner-base.h
|
| @@ -271,10 +271,19 @@ class Scanner {
|
| struct Location {
|
| Location(int b, int e) : beg_pos(b), end_pos(e) { }
|
| Location() : beg_pos(0), end_pos(0) { }
|
| +
|
| + bool IsValid() const {
|
| + return beg_pos >= 0 && end_pos >= beg_pos;
|
| + }
|
| +
|
| int beg_pos;
|
| int end_pos;
|
| };
|
|
|
| + static Location NoLocation() {
|
| + return Location(-1, -1);
|
| + }
|
| +
|
| // Returns the location information for the current token
|
| // (the token returned by Next()).
|
| Location location() const { return current_.location; }
|
|
|