Mercurial > hg > octave-nkf
comparison libinterp/parse-tree/lex.h @ 16209:e7ff32e7cf82
move global promptflag variable to octave_reader class
* input.h, input.cc (promptflag): Declare as member of
octave_base_reader and rename to pflag.
(octave_base_reader::reset, octave_base_reader::promptflag,
octave_base_reader::increment_promptflag,
octave_reader::decrement_promptflag, octave_reader::promptflag,
octave_reader::increment_promptflag,
octave_reader::decrement_promptflag): New functions.
* lex.ll (octave_lexer::decrement_promptflag,
octave_lexer::promptflag, octave_lexer::increment_promptflag,
octave_lexer::decrement_promptflag): New functions. Use them instead
of global promptflag variable.
(octave_lexer::reset): Call input_reader.reset.
* oct-parse.in.yy (input): Don't reset promptflag here.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 06 Mar 2013 20:20:35 -0500 |
parents | 0467d68ca891 |
children | d2b268936783 4a848eb52de2 |
comparison
equal
deleted
inserted
replaced
16208:ed91ab4d4515 | 16209:e7ff32e7cf82 |
---|---|
494 // Object that reads and buffers input. | 494 // Object that reads and buffers input. |
495 input_buffer input_buf; | 495 input_buffer input_buf; |
496 | 496 |
497 octave_input_reader input_reader; | 497 octave_input_reader input_reader; |
498 | 498 |
499 void increment_promptflag (void) { input_reader.increment_promptflag (); } | |
500 | |
501 void decrement_promptflag (void) { input_reader.decrement_promptflag (); } | |
502 | |
503 int promptflag (void) const { return input_reader.promptflag (); } | |
504 | |
505 int promptflag (int n) { return input_reader.promptflag (n); } | |
506 | |
499 std::string input_source (void) const | 507 std::string input_source (void) const |
500 { | 508 { |
501 return input_reader.input_source (); | 509 return input_reader.input_source (); |
502 } | 510 } |
503 | 511 |