diff options
-rw-r--r-- | dep.mk | 2 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | txr.1 | 4 | ||||
-rw-r--r-- | txr.c | 4 | ||||
-rw-r--r-- | txr.h | 1 | ||||
-rw-r--r-- | txr.vim | 1 |
6 files changed, 17 insertions, 1 deletions
@@ -11,7 +11,7 @@ ./hash.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./gc.h $(top_srcdir)/./unwind.h $(top_srcdir)/./stream.h $(top_srcdir)/./hash.h ./utf8.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./unwind.h $(top_srcdir)/./utf8.h ./filter.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./hash.h $(top_srcdir)/./unwind.h $(top_srcdir)/./match.h $(top_srcdir)/./filter.h $(top_srcdir)/./gc.h $(top_srcdir)/./stream.h -./eval.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./gc.h $(top_srcdir)/./unwind.h $(top_srcdir)/./regex.h $(top_srcdir)/./stream.h $(top_srcdir)/./parser.h $(top_srcdir)/./hash.h $(top_srcdir)/./debug.h $(top_srcdir)/./match.h $(top_srcdir)/./rand.h $(top_srcdir)/./filter.h $(top_srcdir)/./eval.h +./eval.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./gc.h $(top_srcdir)/./unwind.h $(top_srcdir)/./regex.h $(top_srcdir)/./stream.h $(top_srcdir)/./parser.h $(top_srcdir)/./hash.h $(top_srcdir)/./debug.h $(top_srcdir)/./match.h $(top_srcdir)/./rand.h $(top_srcdir)/./filter.h $(top_srcdir)/./txr.h $(top_srcdir)/./eval.h ./rand.o: config.h $(top_srcdir)/./lib.h $(top_srcdir)/./unwind.h $(top_srcdir)/./gc.h $(top_srcdir)/./arith.h $(top_srcdir)/./rand.h mpi-1.8.6/mpi.o: $(top_srcdir)/mpi-1.8.6/../config.h $(top_srcdir)/mpi-1.8.6/mpi.h $(top_srcdir)/mpi-1.8.6/logtab.h mpi-1.8.6/mplogic.o: $(top_srcdir)/mpi-1.8.6/../config.h $(top_srcdir)/mpi-1.8.6/mplogic.h @@ -44,6 +44,7 @@ #include "match.h" #include "rand.h" #include "filter.h" +#include "txr.h" #include "eval.h" typedef val (*opfun_t)(val, val); @@ -2411,6 +2412,11 @@ void eval_init(void) reg_fun(intern(lit("time"), user_package), func_n0(time_sec)); reg_fun(intern(lit("time-usec"), user_package), func_n0(time_sec_usec)); + reg_fun(intern(lit("source-loc"), user_package), func_n1(source_loc)); + reg_fun(intern(lit("source-loc-str"), user_package), func_n1(source_loc_str)); + + reg_var(intern(lit("*self-path*"), user_package), &self_path); + eval_error_s = intern(lit("eval-error"), user_package); uw_register_subtype(eval_error_s, error_s); } @@ -7562,6 +7562,10 @@ Examples: .SS Functions time and time-usec +.SS Functions source-loc and source-loc-str + +.SS Variable *self-path* + .SH DEBUGGER .B TXR @@ -46,6 +46,7 @@ const wchli_t *version = wli("64"); const wchar_t *progname = L"txr"; const wchar_t *spec_file = L"stdin"; +val self_path; /* * Can implement an emergency allocator here from a fixed storage @@ -173,6 +174,7 @@ int txr_main(int argc, char **argv) int match_loglevel = opt_loglevel; prot1(&spec_file_str); + prot1(&self_path); yyin_stream = std_input; @@ -429,6 +431,8 @@ int txr_main(int argc, char **argv) format(std_error, lit("bindings:\n~s\n"), bindings, nao); } + self_path = spec_file_str; + { int retval; list_collect_decl(filenames, iter); @@ -35,3 +35,4 @@ extern int opt_vg_debug; extern int opt_derivative_regex; extern const wchli_t *version; extern const wchar_t *progname; +extern val self_path; @@ -93,6 +93,7 @@ syn keyword txl_keyword contained random-fixnum random rand syn keyword txl_keyword contained range range* generate repeat force syn keyword txl_keyword contained throw throwf error match-fun url-encode url-decode syn keyword txl_keyword contained time time-usec +syn keyword txl_keyword contained source-loc source-loc-str syn match txr_error "@[\t ]*[*]\?[\t ]*." syn match txr_nested_error "[^\t `]\+" contained |