Author: coke
Date: Sat Jan 6 19:18:42 2007
New Revision: 16451
Modified:
trunk/ (props changed)
trunk/languages/tcl/src/grammar/expr/expression.pg
trunk/languages/tcl/t/cmd_expr.t
Log:
[tcl] floating point numbers can use e -or- E
Modified: trunk/languages/tcl/src/grammar/expr/expression.pg
==============================================================================
--- trunk/languages/tcl/src/grammar/expr/expression.pg (original)
+++ trunk/languages/tcl/src/grammar/expr/expression.pg Sat Jan 6 19:18:42 2007
@@ -109,7 +109,7 @@
token float { (<[+\-]>)? [ <[0..9]>+\.<[0..9]>* | \.<[0..9]>+ ] }
-token scientific { (<float> | <integer>) e (<[+\-]>? <[0..9]>+) }
+token scientific { (<float> | <integer>) <[Ee]> (<[+\-]>? <[0..9]>+) }
token decimal { [<[1..9]><[0..9]>*] | 0 }
Modified: trunk/languages/tcl/t/cmd_expr.t
==============================================================================
--- trunk/languages/tcl/t/cmd_expr.t (original)
+++ trunk/languages/tcl/t/cmd_expr.t Sat Jan 6 19:18:42 2007
@@ -7,7 +7,7 @@
__DATA__
source lib/test_more.tcl
-plan 285
+plan 286
# namespace
namespace eval test { variable x 5 }
@@ -20,6 +20,7 @@
is [expr 3e2] 300.0 {scientific}
is [expr 3e0] 3.0 {scientific with 0 exponent}
is [expr 2.3e2] 230.0 {scientific with float base}
+is [expr 2.3E2] 230.0 {scientific with float base (upper E)}
is [expr 2e17] 2e+17 {scientific in, scientific out}
eval_is {expr 3e2.0} \
{syntax error in expression "3e2.0": extra tokens at end of expression} \