diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-04-11 10:58:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-04-11 10:58:40 -0700 |
commit | b43d605b8986b8ef2edd11abf7ed5b7e4313d318 (patch) | |
tree | 9ce7f29dc950cae340edd7477aff9a6f8e692729 /txr.c | |
parent | be004953796f8286ce614d40670b3b14d61d80ef (diff) | |
download | txr-b43d605b8986b8ef2edd11abf7ed5b7e4313d318.tar.gz txr-b43d605b8986b8ef2edd11abf7ed5b7e4313d318.tar.bz2 txr-b43d605b8986b8ef2edd11abf7ed5b7e4313d318.zip |
Provide access to line number info and source path.
* eval.c (eval_init): New intrinsic functions source-loc
and source-loc-str. New variable *self-path*.
* txr.1: Stub doc sections.
* txr.c (self_path): New variable.
* txr.h (self_path): Declared.
* txr.vim: Syntax highlighting for source-loc, source-loc-str
and *self-path*.
Diffstat (limited to 'txr.c')
-rw-r--r-- | txr.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |