From 172b5c42010d329e84e498e9347c7f09c9b923e2 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Thu, 23 Nov 2023 08:08:26 +1000 Subject: expr: better error message on nested $() And explain in the manual that it isn't allowed. Fixes: #285 Signed-off-by: Steve Bennett --- jim_tcl.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'jim_tcl.txt') diff --git a/jim_tcl.txt b/jim_tcl.txt index 8684ed9..2c5409e 100644 --- a/jim_tcl.txt +++ b/jim_tcl.txt @@ -2489,6 +2489,23 @@ The following two are identical. set x $(3 * 2 + 1) ---- +However note that the expr shorthand syntax may not be nested in an expression. +This is to prevent the common mistake of writing: + +---- + if {$(1 + 2) == 3) { + ... + } +---- + +rather than: + +---- + if {(1 + 2) == 3) { + ... + } +---- + file ~~~~ +*file* 'option name ?arg\...?'+ -- cgit v1.1