summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-03 20:07:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-03 20:07:30 -0700
commit3ce8999b2cc9c2aa04805141af9cb449d92fa89e (patch)
treef4aefbf47c4743ee70e4ccf0864dfdc3eb14616f /parser.c
parentbd799f60625bea91facb671f4082ad04a8f59380 (diff)
downloadtxr-3ce8999b2cc9c2aa04805141af9cb449d92fa89e.tar.gz
txr-3ce8999b2cc9c2aa04805141af9cb449d92fa89e.tar.bz2
txr-3ce8999b2cc9c2aa04805141af9cb449d92fa89e.zip
compiler: first cut compile-file implementation.
* lisplib.c (compiler_set_entries): Autoload on compile-file. * parser.c (parse_init): Expose get-parser, parser-errors and parser-eof intrinsics in system package. * share/txr/stdlib/compiler.tl (compiler): Wrap defstruct form in compile-only. What this means is that when we invoke comile-file on compiler.tl, the compiler will only compile this defstruct and not evaluate it. I.e. it will not try to redefine the structure. Redefining the core structure of the compiler while it is compiling itself wreaks havoc on the compilation. (%fille-suff-rx%, *emit*, *eval*): New variables. (open-compile-streams, list-from-vm-desc, usr:compile-file): New functions. * vm.c (vm_desc_nlevels, vm_desc_nregs): New static functions. (vm_init): Register new intrinsics vm-desc-nlevels and vn-desc-nregs in system package.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index cbd2f4fe..0d0151d5 100644
--- a/parser.c
+++ b/parser.c
@@ -1386,4 +1386,7 @@ void parse_init(void)
reg_var(listener_greedy_eval_s, nil);
reg_var(rec_source_loc_s, nil);
reg_fun(circref_s, func_n1(circref));
+ reg_fun(intern(lit("get-parser"), system_package), func_n1(get_parser));
+ reg_fun(intern(lit("parser-errors"), system_package), func_n1(parser_errors));
+ reg_fun(intern(lit("parser-eof"), system_package), func_n1(parser_eof));
}