Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src/bin/sh
Module Name: src
Committed By: kre
Date: Wed Jun 7 05:08:32 UTC 2017
Modified Files:
src/bin/sh: arith_token.c arith_tokens.h arithmetic.c arithmetic.h
eval.c exec.c exec.h expand.c expand.h input.c jobs.c nodetypes
option.list parser.c parser.h sh.1 show.c syntax.c syntax.h var.c
var.h
Log Message:
A better LINENO implementation. This version deletes (well, #if 0's out)
the LINENO hack, and uses the LINENO var for both ${LINENO} and $((LINENO)).
(Code to invert the LINENO hack when required, like when de-compiling the
execution tree to provide the "jobs" command strings, is still included,
that can be deleted when the LINENO hack is completely removed - look for
refs to VSLINENO throughout the code. The var funclinno in parser.c can
also be removed, it is used only for the LINENO hack.)
This version produces accurate results: $((LINENO)) was made as accurate
as the LINENO hack made ${LINENO} which is very good. That's why the
LINENO hack is not yet completely removed, so it can be easily re-enabled.
If you can tell the difference when it is in use, or not in use, then
something has broken (or I managed to miss a case somewhere.)
The way that LINENO works is documented in its own (new) section in the
man page, so nothing more about that, or the new options, etc, here.
This version introduces the possibility of having a "reference" function
associated with a variable, which gets called whenever the value of the
variable is required (that's what implements LINENO). There is just
one function pointer however, so any particular variable gets at most
one of the set function (as used for PATH, etc) or the reference function.
The VFUNCREF bit in the var flags indicates which func the variable in
question uses (if any - the func ptr, as before, can be NULL).
I would not call the results of this perfect yet, but it is close.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/sh/arith_token.c
cvs rdiff -u -r1.1 -r1.2 src/bin/sh/arith_tokens.h src/bin/sh/arithmetic.h
cvs rdiff -u -r1.2 -r1.3 src/bin/sh/arithmetic.c src/bin/sh/option.list
cvs rdiff -u -r1.142 -r1.143 src/bin/sh/eval.c
cvs rdiff -u -r1.48 -r1.49 src/bin/sh/exec.c
cvs rdiff -u -r1.25 -r1.26 src/bin/sh/exec.h
cvs rdiff -u -r1.112 -r1.113 src/bin/sh/expand.c
cvs rdiff -u -r1.22 -r1.23 src/bin/sh/expand.h
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/input.c
cvs rdiff -u -r1.85 -r1.86 src/bin/sh/jobs.c
cvs rdiff -u -r1.16 -r1.17 src/bin/sh/nodetypes
cvs rdiff -u -r1.133 -r1.134 src/bin/sh/parser.c
cvs rdiff -u -r1.21 -r1.22 src/bin/sh/parser.h
cvs rdiff -u -r1.148 -r1.149 src/bin/sh/sh.1
cvs rdiff -u -r1.42 -r1.43 src/bin/sh/show.c
cvs rdiff -u -r1.3 -r1.4 src/bin/sh/syntax.c
cvs rdiff -u -r1.7 -r1.8 src/bin/sh/syntax.h
cvs rdiff -u -r1.56 -r1.57 src/bin/sh/var.c
cvs rdiff -u -r1.29 -r1.30 src/bin/sh/var.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index