Displaying 10 results from an estimated 10 matches for "evalfun".
Did you mean:
evalfunc
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Do not allow break to break across function calls
...ert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/eval.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index ccd5e0c0..204f1e57 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -928,9 +928,11 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
struct jmploc jmploc;
int e;
int savefuncline;
+ int saveloopnest;
saveparam = shellparam;
savefuncline = funcline;
+ saveloopnest = loopnest;
savehandler = handler;
if ((e = setjmp(jmploc.loc))) {
goto funcdone;
@@ -940,6...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Do not allow break to break across function calls
...ert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/eval.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 1c76d4c5..e0c21f94 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -928,9 +928,11 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
struct jmploc jmploc;
int e;
int savefuncline;
+ int saveloopnest;
saveparam = shellparam;
savefuncline = funcline;
+ saveloopnest = loopnest;
savehandler = handler;
if ((e = setjmp(jmploc.loc))) {
goto funcdone;
@@ -940,6...
2002 Nov 04
2
Sweave - documenting a long function
...st part of the function
<<defFunBodyPt1, eval=FALSE>>=
{ a <- a+1
@
% Explain the code in the second part of the function
<<defFunBodyPt2, eval=FALSE>>=
a <- a^2
a
} # end of function
@
% now bring the chunks together so that Sweave evaluates the function.
<<evalFun, echo=FALSE>>=
<<defFunHdr>>
<<defFunBodyPt1>>
<<defFunBodyPt2>>
@
% Finally, show an example of the function
<<exampleFun>>=
x(3)
@
===========
eval=FALSE doesnt seem to prevent the code being evaluated,
as I get an error with the first chunk...
2019 Jan 25
0
[klibc:update-dash] eval: Variable assignments on functions are no longer persistent
...;ben at decadent.org.uk>
---
usr/dash/eval.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index 5fd1c7c1..2f662e3e 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -886,7 +886,6 @@ raise:
break;
case CMDFUNCTION:
- poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TEST...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Variable assignments on functions are no longer persistent
...;ben at decadent.org.uk>
---
usr/dash/eval.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index e28e56cb..722066e5 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -886,7 +886,6 @@ raise:
break;
case CMDFUNCTION:
- poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
break;
@@ -971,9 +970,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
shellparam.p = argv + 1;
shellparam.optind = 1;
shellparam.optoff = -1;
- pushlocalvars();
evaltree(func->n.ndefun.body, flags & EV_TEST...
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...id evalcommand(union node *, int, struct backcmd *);
+STATIC int evalcommand(union node *, int, struct backcmd *);
#else
-STATIC void evalcommand(union node *, int);
+STATIC int evalcommand(union node *, int);
#endif
STATIC int evalbltin(const struct builtincmd *, int, char **, int);
STATIC int evalfun(struct funcnode *, int, char **, int);
@@ -170,11 +170,13 @@ evalstring(char *s, int flags)
setstackmark(&smark);
status = 0;
- while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT));
+ for (; (n = parsecmd(0)) != NEOF; popstackmark(&smark)) {
+...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...id evalcommand(union node *, int, struct backcmd *);
+STATIC int evalcommand(union node *, int, struct backcmd *);
#else
-STATIC void evalcommand(union node *, int);
+STATIC int evalcommand(union node *, int);
#endif
STATIC int evalbltin(const struct builtincmd *, int, char **, int);
STATIC int evalfun(struct funcnode *, int, char **, int);
@@ -170,11 +170,13 @@ evalstring(char *s, int flags)
setstackmark(&smark);
status = 0;
- while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, flags & ~(parser_eof() ? 0 : EV_EXIT));
+ for (; (n = parsecmd(0)) != NEOF; popstackmark(&smark)) {
+...
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...:
if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) {
if (exception == EXERROR && spclbltin <= 0) {
FORCEINTON;
- goto readstatus;
+ break;
}
raise:
longjmp(handler->loc, 1);
}
- goto readstatus;
+ break;
case CMDFUNCTION:
poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
-readstatus:
- status = exitstatus;
break;
}
+ status = waitforjob(jp);
+
out:
if (cmd->ncmd.redirect)
popredir(execcmd);
diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index a2602bae..4548ae69 100644
--- a/usr/dash/jobs.c
+++ b/...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...:
if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) {
if (exception == EXERROR && spclbltin <= 0) {
FORCEINTON;
- goto readstatus;
+ break;
}
raise:
longjmp(handler->loc, 1);
}
- goto readstatus;
+ break;
case CMDFUNCTION:
poplocalvars(1);
if (evalfun(cmdentry.u.func, argc, argv, flags))
goto raise;
-readstatus:
- status = exitstatus;
break;
}
+ status = waitforjob(jp);
+
out:
if (cmd->ncmd.redirect)
popredir(execcmd);
diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index 333a2a22..3ea7e122 100644
--- a/usr/dash/jobs.c
+++ b/...
2002 Nov 05
0
summary: Sweave - documenting a long function
...st part of the function
<<defFunBodyPt1, eval=FALSE>>=
{ a <- a+1
@
% Explain the code in the second part of the function
<<defFunBodyPt2, eval=FALSE>>=
a <- a^2
a
} # end of function
@
% now bring the chunks together so that Sweave evaluates the function.
<<evalFun, echo=FALSE>>=
<<defFunHdr>>
<<defFunBodyPt1>>
<<defFunBodyPt2>>
@
% Finally, show an example of the function
<<exampleFun>>=
x(3)
@
===========
eval=FALSE doesnt seem to prevent the code being evaluated,
as I get an error with the first chunk...