Mercurial > hg > octave-nkf
changeset 16335:bef822a80ffb
if not interactive, bypass readline and read stdin as a file (bug #38520)
* parse.h (octave_parser::octave_parser (octave_lexer&)):
New constructor.
* toplev.cc (main_loop): If not interactive or forced interactive,
read from stdin as a file instead of creating interative lexer.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 19 Mar 2013 17:06:27 -0400 |
parents | 06aa4c0f2018 |
children | 0ce49f9fb171 |
files | libinterp/interpfcn/toplev.cc libinterp/parse-tree/parse.h |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -563,7 +563,11 @@ // octave_parser constructor sets this for us. frame.protect_var (LEXER); - octave_parser parser; + octave_lexer *lxr = ((interactive || forced_interactive) + ? new octave_lexer () + : new octave_lexer (stdin)); + + octave_parser parser (*lxr); int retval = 0; do