From 5bb39bb1995cb12d8da76b1d482df9be1acc2eb4 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Tue, 15 Mar 2011 15:52:05 +0800 Subject: [SHELL] Improve LINENO support This patch improves LINENO support by storing line numbers in the parse tree, for commands as well as for function definitions. It makes LINENO behaves properly when calling functions, and has the added benefit of improved line numbers in error messages when the last-parsed command is not the last-executed one. It removes the earlier LINENO support, and instead sets LINENO from evaltree when a command is executed Signed-off-by: Harald van Dijk Signed-off-by: Herbert Xu --- src/nodetypes | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/nodetypes') diff --git a/src/nodetypes b/src/nodetypes index 17a7b3c..ceaf478 100644 --- a/src/nodetypes +++ b/src/nodetypes @@ -51,6 +51,7 @@ NCMD ncmd # a simple command type int + linno int assign nodeptr # variable assignments args nodeptr # the arguments redirect nodeptr # list of file redirections @@ -62,6 +63,7 @@ NPIPE npipe # a pipeline NREDIR nredir # redirection (of a complex command) type int + linno int n nodeptr # the command redirect nodeptr # list of file redirections @@ -87,12 +89,14 @@ NUNTIL nbinary # the until statement NFOR nfor # the for statement type int + linno int args nodeptr # for var in args body nodeptr # do body; done var string # the for variable NCASE ncase # a case statement type int + linno int expr nodeptr # the word to switch on cases nodeptr # the list of cases (NCLIST nodes) @@ -103,8 +107,11 @@ NCLIST nclist # a case body nodeptr # code to execute for this case -NDEFUN narg # define a function. The "next" field contains - # the body of the function. +NDEFUN ndefun # a function + type int + linno int + text string + body nodeptr NARG narg # represents a word type int -- cgit 1.4.1 ut type='submit' value='search'/>
Commit message (Expand)Author
2021-05-25import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe
2021-05-08Import LibreSSL 3.3.3June McEnroe
2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe
2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe
2021-04-18Import LibreSSL 3.3.2June McEnroe
2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe
2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe
2020-12-15Import LibreSSL 3.3.1June McEnroe
2020-11-24Import LibreSSL 3.3.0June McEnroe
2020-10-22Import LibreSSL 3.2.2June McEnroe
2020-09-29Import LibreSSL 3.2.1June McEnroe
2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe
2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe
2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe