summaryrefslogtreecommitdiffstats
path: root/parser.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-30 23:07:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-30 23:07:32 -0700
commit1bf965ceb66aa0ebc0404df306b6563253af9f1a (patch)
treef825d9b58a109e689714caebe1077deef954be4f /parser.h
parentc91af9a17b0533c6df846ff712e7ade306c7b38a (diff)
downloadtxr-1bf965ceb66aa0ebc0404df306b6563253af9f1a.tar.gz
txr-1bf965ceb66aa0ebc0404df306b6563253af9f1a.tar.bz2
txr-1bf965ceb66aa0ebc0404df306b6563253af9f1a.zip
Refactoring hash bang support; hash bang null hack.
The hash bang mechanism is handled in one place, and disentangled from all parsing logic. It is also endowed with special powers. * eval.c (load): Pass one less argument to read_eval_stream. * match.c (v_load): Likewise. * parser.c (read_eval_stream): hash_bang_support Boolean argument removed. Hash bang logic removed. (load_rcfile): Pass only two arguments to read_eval_stream. * parser.h (read_eval_stream): Declaration updated. * txr.c (remove_hash_bang_line): Function removed. (check_hash_bang): New static function. (txr_main): Recognize the script file name while still inside the argument processing loop. Open the file, and check for a hash bang line, doing the special processing which can generate more arguments from material after a null byte in the hash bang line. The parse_stream variable is now initialized to nil and doubles as a Boolean indicating whether a stream has been opened. After the loop, we remove the script file from the arguments, if we have an open stream and the spec_file_str matches. read_eval_stream is called only with two arguments. * txr.1: Revised existing documentation and described new features.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.h b/parser.h
index 41969c3f..aedec088 100644
--- a/parser.h
+++ b/parser.h
@@ -116,7 +116,7 @@ val lisp_parse(val source_in, val error_stream, val error_return_val,
val name_in, val lineno);
val iread(val source_in, val error_stream, val error_return_val,
val name_in, val lineno);
-val read_eval_stream(val stream, val error_stream, val hash_bang_support);
+val read_eval_stream(val stream, val error_stream);
#if HAVE_TERMIOS
val repl(val bindings, val in_stream, val out_stream);
#endif