File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,7 +298,6 @@ class simplecpp::TokenList::Stream {
298298 virtual int get () = 0;
299299 virtual int peek () = 0;
300300 virtual void unget () = 0;
301- virtual bool good () = 0;
302301
303302 /* *
304303 * Read the next character. CR and CR LF are returned as LF.
@@ -454,9 +453,6 @@ namespace {
454453 void unget () override {
455454 istr.unget ();
456455 }
457- bool good () override {
458- return istr.good ();
459- }
460456
461457 private:
462458 std::istream &istr;
@@ -474,26 +470,22 @@ namespace {
474470
475471 int get () override {
476472 if (pos >= size)
477- return lastStatus = EOF ;
473+ return EOF ;
478474 return str[pos++];
479475 }
480476 int peek () override {
481477 if (pos >= size)
482- return lastStatus = EOF ;
478+ return EOF ;
483479 return str[pos];
484480 }
485481 void unget () override {
486482 --pos;
487483 }
488- bool good () override {
489- return lastStatus != EOF ;
490- }
491484
492485 private:
493486 const unsigned char *str;
494487 const std::size_t size;
495488 std::size_t pos{};
496- int lastStatus{};
497489 };
498490
499491 class FileStream : public simplecpp ::TokenList::Stream {
@@ -521,7 +513,7 @@ namespace {
521513 }
522514
523515 int get () override {
524- lastStatus = lastCh = fgetc (file);
516+ lastCh = fgetc (file);
525517 return lastCh;
526518 }
527519 int peek () override {
@@ -533,9 +525,6 @@ namespace {
533525 void unget () override {
534526 unget_internal (lastCh);
535527 }
536- bool good () override {
537- return lastStatus != EOF ;
538- }
539528
540529 private:
541530 void unget_internal (int ch) {
@@ -550,7 +539,6 @@ namespace {
550539
551540 FILE *file;
552541 int lastCh{};
553- int lastStatus{};
554542 };
555543}
556544
You can’t perform that action at this time.
0 commit comments