Fix test errors, then failures.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13490 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/register-rewrite
Joshua Sled 20 years ago
parent c284683b36
commit aa788b9488

@ -1,3 +1,14 @@
2006-03-05 Joshua Sled <jsled@asynchronous.org>
* src/app-utils/test/test-exp-parser.c (test_parser): Hack-fix
test errors due to missing function now required by
expression-parser. In the future, we should have a better way to
setup the application/test state.
* src/calculation/expression_parser.c (primary_exp): Fix
function-parsing bug I introduced during the week with another bug
fix.
2006-03-05 Derek Atkins <derek@ihtfp.com>
* src/register/ledger-core/split-register.c:

@ -150,7 +150,10 @@ test_parser (void)
"- 42.72 + 13.32 + 15.48 + 23.4 + 115.4",
gnc_numeric_create(35897, 100) );
scm_c_eval_string("(define (gnc:error->string tag args) (define (write-error port) (if (and (list? args) (not (null? args))) (let ((func (car args))) (if func (begin (display \"Function: \" port) (display func port) (display \", \" port) (display tag port) (display \"\n\n\" port))))) (false-if-exception (apply display-error (fluid-ref the-last-stack) port args)) (display-backtrace (fluid-ref the-last-stack) port) (force-output port)) (false-if-exception (call-with-output-string write-error)))");
scm_c_eval_string( "(define (gnc:plus a b) (+ a b))" );
add_pass_test("plus(2 : 1)", NULL, gnc_numeric_create(3,1));
add_pass_test( "plus( 1 : 2 ) + 3", NULL, gnc_numeric_create( 6, 1 ) );
add_pass_test( "plus( 1 : 2 ) * 3", NULL, gnc_numeric_create( 9, 1 ) );
add_pass_test( "plus( 1 + 2 : 3 ) * 5", NULL, gnc_numeric_create( 30, 1 ) );

@ -1067,7 +1067,7 @@ multiply_divide_op (parser_env_ptr pe)
* named variables
* numerics
* grouped expressions, "()"
* functions [ <name>( [exp, exp, ..., exp] ) ]
* functions [ <name>( [exp : exp : ... : exp] ) ]
* strings
*/
static void
@ -1147,10 +1147,10 @@ primary_exp (parser_env_ptr pe)
assignment_op(pe);
if ( pe->error_code )
return;
funcArgCount++;
if (!pe->Token || pe->Token == ')') {
break;
}
funcArgCount++;
next_token(pe);
} while (pe->Token != ARG_TOKEN);

Loading…
Cancel
Save