diff options
author | Steve Bennett <steveb@workware.net.au> | 2017-05-12 13:33:44 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2017-05-23 14:36:56 +1000 |
commit | bd5139c89e714bb7e10a0da55d9a10f51e93516c (patch) | |
tree | a1fb42986a3abc588e05f0b7eea4361c723f779c /regtest.tcl | |
parent | 7b2250a7e60968b0c3716a7caa780e6ca0a2ce9b (diff) | |
download | jimtcl-bd5139c89e714bb7e10a0da55d9a10f51e93516c.zip jimtcl-bd5139c89e714bb7e10a0da55d9a10f51e93516c.tar.gz jimtcl-bd5139c89e714bb7e10a0da55d9a10f51e93516c.tar.bz2 |
expr: Replace expression engine
Rework the expression engine to use recursive descent evaluation rather than
a shunting yard algorithm. Among other things, it is easier to make lazy operators
and the ternary operator work correctly.
In particular, the following expression no longer crashes: $(99?9,99?9:*9:999)?9)
And the code is now smaller.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'regtest.tcl')
-rw-r--r-- | regtest.tcl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/regtest.tcl b/regtest.tcl index 854d96a..e3213b5 100644 --- a/regtest.tcl +++ b/regtest.tcl @@ -325,6 +325,11 @@ puts "TEST 45 PASSED" catch {scan $(1) $(1)} puts "TEST 46 PASSED" +# REGTEST 47 +# Invalid ternary expression +catch {set a $(99?9,99?9:*9:999)?9)} +puts "TEST 47 PASSED" + # TAKE THE FOLLOWING puts AS LAST LINE puts "--- ALL TESTS PASSED ---" |