From 7025b2c547d3611301e3e6fde8422aaba2acfd3f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 7 May 2015 06:39:07 -0700 Subject: * Makefile (LISP_TO_C_STRING): Strip comments, but not comment lines, so line numbers don't change. * eval.c (eval_init): Fix registrations of lisp-parse and read. * lisplib.c (place_instantiate): Give name to parsed string stream using new lisp_parse argument. * parser.c (lisp_parse): Takes new argument to override name. * parser.h (lisp_parse): Declaration updated. * txr.c (txr_main): Call lisp_parse with four args, defaulting the new one. * txr.1: Documented new argument. --- parser.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'parser.c') diff --git a/parser.c b/parser.c index 8a2a5d5b..4bed7be9 100644 --- a/parser.c +++ b/parser.c @@ -118,7 +118,7 @@ val regex_parse(val string, val error_stream) return parser.errors ? nil : parser.syntax_tree; } -val lisp_parse(val source_in, val error_stream, val error_return_val) +val lisp_parse(val source_in, val error_stream, val error_return_val, val name_in) { uses_or2; val source = default_bool_arg(source_in); @@ -126,9 +126,10 @@ val lisp_parse(val source_in, val error_stream, val error_return_val) make_string_byte_input_stream(source), or2(source, std_input)); val secret_token_stream = make_string_byte_input_stream(lit("@\x01" "E")); - val name = if3(stringp(source), - lit("string"), - stream_get_prop(input_stream, name_k)); + val name = or2(default_bool_arg(name_in), + if3(stringp(source), + lit("string"), + stream_get_prop(input_stream, name_k))); val stream = make_catenated_stream(list(secret_token_stream, input_stream, nao)); val saved_dyn = dyn_env; parser_t parser; -- cgit v1.2.3