Age | Commit message (Collapse) | Author | Files | Lines |
|
Now 'constraint cmd|package' is like 'needs' but sets a constraint
The command to 'needs cmd' and 'constraint cmd' can now take
a subcommand to check.
Add 'constraint|needs eval|expr' to make some constraint checks
simpler.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Avoid unexpected issues by concatenating multiple arguments.
This does create an incompatibility with early versions, but
it is generally trivial to convert existing code to one of two forms:
1. expr {$a + $b} -- usually correct
2. expr "$a + $b" -- usually incorrect
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Add support for comments in expressions
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Previously two adjacent terms were incorrectly accepted, such as in
pow(2 3)
Correctly generate an error in this case and improve the error
message when an expression fails to parse correctly.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Previously math functions with multiple arguments were handling poorly.
For example: pow(1.0 + 3.0 - 2, .8 * 5)
was evaluated as: pow(1.0 + 3.0, 2 - .8 * 5)
Now commas correctly separate function parameters.
Also, the error messages are more consistent and informative in the case
of an invalid expression.
Update and re-enable tests in tests/expr-old.test accordingly
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And enable some more math tests
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Now an octal literal needs to be explicitly indicated with a leading
0o or 0O, otherwise the number is treated as decimal.
This patch also adds support for binary literals.
e.g. 0b101 0B1101
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Patrick WEBER <patrick.weber@live.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Much closer to tcltest now, including constraints.
Try to get all appropriate tests running under both Jim and Tcl.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use 'indent'. Not perfect, but at least consistent.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
*: Add tests/expr-new.test from Tcl
*: Directly convert from int to double if possible
*: Always treat '-' in front of a number as unary minus
so that '-0x1234' works.
*: Fix expr when the variable does not exist
*: Add optional support for math functions
*: Also double/0 == Inf or -Inf
|
|
*: Import Tcl expr tests (expr-old.test) and fix things:
*: !double should be boolean (int)
*: double&&double and double||double should be boolean (int)
*: 2.34e+1 and 2.0e2 are an acceptable double values
*: precedence of && and || is not equal
*: precedence of ? and : is not equal
*: expression "2:3" is invalid
*: lazy evaluation involving multiple && and || was quite wrong
*: Fix unary minus wrt subexpressions. e.g. -(-1.5)
*: Also add support for functions: int, double, abs, round
*: Fix lazy evaluation of ternary operator
*: Error on missing ?, missing :
*: Fix double unary minus
*: Add unary plus
*: Fix parsing of double with no '.' before 'e'. Also support 'E'.
*: Right-to-left associativity of ternary operator is *almost* correct
*: Import div/mod of -ve integers from Tcl
*: Rotate (<<< and >>>) failed because of wrong arity
*: Don't use auto-converted double values
*: When an expression fails, show the expression
*: Bump version to 0.62
|