| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* stream.c (run): Implement using _wspawnvp on MinGW.
|
|
|
|
| |
continuator is also deleted in string literals.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in the SPECIAL, NESTED and BRACED states, do not pop the state in all
three, only in SPECIAL (to terminate the @\ continuation).
* txr.1: Eliminate wrong claim that string literals do not split across lines,
which is directly contradicted two paragraphs later. Document that
quasiliterals also split.
* genvim.txr (txr_regex, txl_regex): These definitions change from "syn match"
to "syn region" so that the backslash-newline continuation can be properly
handled.
(txr_string, txr_quasilit): Correctly handle split literals.
* txr.vim: Regenerated.
|
|
|
|
|
|
| |
to be a text.
* txr.1: Documented @(empty).
|
|
|
|
|
|
|
|
| |
optional arguments. This problem can cause the symbol : to be
planted as the std_error stream, resulting in an error loop
that blows the stack.
* regex.c (regex_compile): Likewise.
|
|
|
|
|
| |
have similar functions in the MSVCRT library used by MinGW,
so if _WIN32 is defined, our functions now just wrap those.
|
|
|
|
| |
work right with arguments, though: the win command line is broken.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* rand.c (make_random_state): Do argument defaulting on seed.
Also, mix getpid() into the seed.
(random_fixnum): Bugfix: do proper defaulting on optional
agument, rather than relying on nil.
(random): Fix 2014-02-05 regression. This was totally broken,
ignoring the random state passed in and using the global
random state. This function must only use the state passed in;
there is no defaulting to the global random state.
* txr.1: Documenting that seed is optional in make-random-state.
Describing what guarantees can be expected with regard to
calls made close together temporally.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Input side for now; output later.
* parser.y (if_clause, elif_clauses_opt, else_clause_opt): New nonterminals.
(IF, ELIF, ELSE): New tokens.
(yybadtoken): Handle IF, ELIF, ELSE.
* parser.l: Recognize and return new tokens IF, ELIF and ELSE.
* txr.1: Documented.
* genvim.txr: Updated with if, elsif and else directive keywords.
* txr.vim: Regenerated
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
segmentation fault that occurs when running out of stack space,
and escape by throwing an exception.
Also, bugfix: save and restore the gc enable/disable state. Without
this, if we are ever running cod in a gc disabled state and it jumps
out, gc stays disabled.
* configure: added check for sigaltstack.
* gc.h (gc_enabled): Declaration added for existing variable.
* signal.c (is_cpu_exception): New static function.
(sig_handler): For cpu_exception type signals that pertain
to the execution of some instruction, turn on async_sig_enabled,
so that the signal is not deferred. Otherwise we will just
return without calling the user-defined handler, restart
the instruction and get into a loop. Also, disable gc around
the handler just in case. One issue is that we might be on
an alternate stack, which gc won't like.
(setup_alt_stack, teardown_alt_stack): New static functions.
(set_sig_handler): If we have sigaltstack, and are asked
to set up a SEGV handler, then set it up on the alternate
stack.
* signal.h (extended_jmp_buf): Adding new member, gc.
(extended_setjmp, extended_longjmp): use gc member
to save and restore the gc_enable state across
setjmp and longjmp.
|
|
|
|
|
|
| |
exit status.
(sh, run): New static functions.
(stream_init): sh and run registered as intrinsics.
|
|
|
|
| |
argument defaulting logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(op_prof, me_pprof): New static functions.
(eval_init): Intern prof symbol, store in prof_s.
Captured interned + symbol in plus_s. Register prof operator and pprof
macro.
* gc.c (gc_bytes): New global variable.
(more): Use nse function chk_malloc_gc_more instead of chk_malloc.
(make_obj): Increment gc_bytes.
* lib.c (malloc_bytes): New global variable.
(chk_malloc, chk_realloc): Increment malloc_bytes.
(chk_calloc): Bugfix: incorrect size in recursion into oom_realloc.
Incorrect calculation of malloc_high_bound. Increment malloc_bytes.
(chk_malloc_gc_more): New function.
* lib.h (alloc_bytes_t): New typedef.
(malloc_bytes, gc_bytes): Declared.
(chk_malloc_gc_more): Declared.
* stream.c (format_s): New symbol global.
(stream_init): format_s inited.
format_s used to register formatv function.
* stream.h (format_s): Declared.
* txr.1: Documented prof and pprof.
* genvim.txr: Recognize reg_fun calls with intern
followed by a preceding assignment or other syntax.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (open_process): Fixed off-by one erroneous value of nargs,
causing memory leak of one string. Fixed memory leak on fork failure.
Fixed a deadlock that can occur in the pipe close function when
multiple pipes are in existence. This is fixed by setting the
FD_CLOEXEC flag on the pipe file descriptor. Without this, one child
process can hold another's pipe open, causing that other one not to
terminate when we're trying to shut it down, resulting in that child
blocked on a write, while we block on waitpid.
|
|
|
|
|
|
| |
kill the child process less abruptly by hitting it with SIGINT and
SIGTERM, rather than with SIGKILL. Also, collect the child
process with waitpid.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
moved to filter.c.
* filter.c (trie_compress_intrinsic, html_encode, html_decode): New
static functions.
(filter_init): Register make_trie, trie_add, trie_compress_intrinsic,
filter_string_tree, filter_equal, html_encode and html_decode
as intrinsics. Move registration of url_encode and url_decode here.
* genvim.txr: Look for registrations in filter.c too.
* txr.1: Documented.
* txr.vim: Updated.
|
|
|
|
|
| |
in the child process after dup2-ing it to standard input or standard
output, so the child doesn't have to references to the pipe.
|
|
|
|
|
|
|
|
|
|
| |
Do not throw exceptions for normal process terminations, only for
abnormal ones (terminated by a signal). Return the termination
status instead of just t.
* txr.1: Fixed the neglected documentation of the optional boolean
argument of close-stream. Described the behaviors with regard
to pipes in more detail.
|
|
|
|
|
|
| |
helps implement the special interaction between @(accept) and
@(trailer) was not handling the situation when there is not
current unwind exit point.
|
|
|
|
|
|
|
| |
constituent chars # or ^ to start the symbol name after an @.
Prior to this change @^a is a "meta-symbol" whose name is "^a",
but ^a is the ^ quasiquote notation followed by symbol a.
After this change @^a is meta, applied to quasiquote-a.
|
|
|
|
|
|
|
| |
in the adjustment of the "to" value.
* match.c (search_form): Use predefined constants for -1 and 1
instead of calling num.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
long lines produced by @(freeform). Once the matching
passes about 4000 characters, the "consume_prefix"
function kicks in to save memory. Then any code which is
not properly written to handle this displaced situation
will break.
* match.c (h_text, h_var, h_coll, h_parallel, h_fun): Bugfix.
The recursive calls to match_line return an absolute position.
From this value we must subtract c->base if we are to
compare it with c->pos, or update c->pos. If we use the
absolute value, we are abruptly jumping ahead in the data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to the regex machine even when there is no transition available. This
was due to the broken return value protocol of regex_machine_feed. For
instance for the regex / +/ (one or more spaces), after matching some
spaces, it would report REGM_INCOMPLETE for additional non-space
characters, never reporting REGM_FAIL.
* regex.c (regm_result_t): Block comment added, documenting protocol.
(regex_machine_feed): Return REGM_FAIL if there are no transitions for
the given character, even a partial match has been recorded. This is
a signal to stop feeding more characters. At that point, the function
can be called with a null character to distinguish the three cases:
fail, partial or full match.
(search_regex): Now when the search loop gets a REGM_FAIL, it can
no longer assume that nothing was matched and the search must restart
at the next position. Upon the REGM_FAIL signal, it is necesary to
seal the search by feeding in the 0 character. Only if that returns
REGM_FAIL is it a no match situation. Otherwise it is actually a match!
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
broke the symbol module: two intern calls in consecutive
lines, one for the name without "earmuffs", one with,
leading to the situation that the C code looks for a
dynamic variable that does not exist.
|
|
|
|
|
|
|
|
| |
the format strings in these macros contained a workaround for
the broken * variable field width syntax, specifying
~*~a where the extra ~ in the middle just feeds a character
that the broken state machine expects. These workarounds broke when I
fixed the formatting, making -v mode useless.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (upop): Declared.
* txr.c (txr_main): Two bugfixes. One is that the argument -
was being pushed back twice resulting in *args* being ("-" "-").
This is because the option processing loop checked for "-" and pushed
it back into args, and then some logic after the loop pushed arg back
into args again. But, these pushes were wrong because they push
back a different cons cell; we would like to be able to
do (ldiff *full-args* *args*). This is solved by upop, which provides
one element of undo. After upop, we can restore the prior list
from the undo save location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(obj_init): Intern assert symbol, store in assert_s.
* lib.h (assert_s): Declared.
* match.c (typed_error, v_assert, h_assert): New static functions.
(dir_tables_init): Register v_assert and h_assert.
Register assert_s as non-data-matching directive.
* unwind.c (uw_init): Register assert as a subtype
of error.
* txr.1: Describe assert.
|
|
|
|
|
|
| |
scanning environment.
(open_data_source): Regression: was not setting c->curfile when opening
anything.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.h (apply_intrinsic, lazy_mapcar): Declarations added.
* stream.c (open_files, open_file_star): New functions.
(stream_init): Registered new functions as intrinsics.
* txr.1: Documented open-files and open-files*. Added to make-catenated-stream documentation.
* genvim.txr: Replace bunch of code with open-files.
* txr.vim: Regenerated.
|
|
|
|
| |
can occur from an interactive/real-time stream.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (env_k): Duplicate global variable definition removed.
* lib.c (vector, vec_set_length): Fixed signed/unsigned comparison
warnings.
* stream.h (stdin_s, stdout_s, stddebug_s, stderr_s, stdnull_s):
Declarations were definitions due to missing extern.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
issue ...").
* match.c (open_data_source): if c->data is t, but c->files
is nil, set c->data to nil: we cannot possibly open anything later.
(match_files): We need to call open_data_source one more time just
before processing a line with horizontal material. The previous
call(s) to open_data_source might not have opened anything. Before
accesing car(c.data) the correct test is consp(c.data), not c.data. In
the else clause, we now specificially check for nilp(c.data) which is
the correct indicator of no more data. If c.data is any other atom at
that point, we have an internal error, for which an assertion is added
now.
|
|
|
|
|
|
|
|
|
|
|
|
| |
precision (i.e. given by *). The simplest way to do this is to add a
state vf_star which is similar to vf_digits, and reuses much of the
logic via a goto. Fixing forgotten --fmt (push back char) when moving
from vf_precision to vf_spec state due to unhandled character.
Also, allowing a leading zero before a precision given as *
so that computed precisions can be combined with zero padding.
* txr.1: Documented leading zero better so it is clear it
combines with *. Restructured documentation.
|
|
|
|
|
|
|
| |
(stream_init): Change how put_line is registered to take advantage of
new optional parameter.
* txr.1: Updated.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): logten registered as intrinsic.
* lib.h (logten): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of identifiers to rule this out from being the first character of a
symbol which has no prefix. Recognize the ^ character as a token in the
NESTED state.
* lib.c (obj_print, obj_pprint): Render sys:qquote as ^.
* parser.y (choose_quote): Function removed.
(n_expr): Recognize '^' as quasiquote. Removed all the "smart quote"
hacks that try to make quote behave as quote or quasiquote, or try to
cancel out unquotes and quotes.
* tests/009/json.txr: Fixed to ^ quasiquote.
* tests/010/reghash.txr: Likewise.
* tests/011/macros-2.txr: Likewise.
* tests/011/mandel.txr: Likewise.
* tests/011/special-1.txr: Likewise.
* txr.1: Updated docs.
* genvim.txr: Revamped definitions for txr_ident and txl_ident so that
unqualified identifiers cannot start with # or ^, but ones with @ or :
in front can start with these characters.
* txr.vim: Regenerated.
|
| |
|
|
|
|
|
|
| |
(y.tab.c, y.tab.h): Remove y.tab.c before running yacc. Write-protect
y.tab.c, not $@, which could expand to the y.tab.h target if that is
what triggered the rule.
|
| |
|
|
|
|
|
|
| |
(eval_init): Register new intrinsics make-env, env-fbind and env-vbind.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated
* dep.mk: Updated.
|
|
|
|
|
|
| |
the variable as special at expansion time. Without this, binding
forms in other parts of the tree won't be expanded properly
to bring about the special semantics.
|
|
|
|
|
|
|
|
|
| |
which breaks backquote, caught by tests/010/reghash.txr.
I thought fixed this already! But I must have made the change to y.tab.c
rather than parser.y.
* Makefile (lex.yy.c, y.tab.c): Make these files readonly to prevent
unintended edits.
|