mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Terry Boldt's fix to the expression parser.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2585 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
87202211d1
commit
70a0fde5d1
@ -51,11 +51,13 @@
|
|||||||
*
|
*
|
||||||
* 1: trans_numeric - this function translates the text string into a numeric in the desired
|
* 1: trans_numeric - this function translates the text string into a numeric in the desired
|
||||||
* representation and returns a pointer to the representation as a (void *)
|
* representation and returns a pointer to the representation as a (void *)
|
||||||
* this function has three parameters passed:
|
* this function has four parameters passed:
|
||||||
* 1: digit_str -- the actual text string of the numeric to be converted
|
* 1: digit_str -- the actual text string of the numeric to be converted
|
||||||
* to the internal representation
|
* to the internal representation
|
||||||
* 2: radix_point -- the ASCII character used to represent the radix point
|
* 2: radix_point -- the ASCII character used to represent the radix point
|
||||||
* 3: rstr -- a pointer to a location in which to return a pointer to the
|
* 3: group character -- the ASCII character used to separate and group digits to the
|
||||||
|
* left of the radix
|
||||||
|
* 4: rstr -- a pointer to a location in which to return a pointer to the
|
||||||
* first character not part of the numeric string translated
|
* first character not part of the numeric string translated
|
||||||
* If this pointer is NULL, do not return a value. This parameter
|
* If this pointer is NULL, do not return a value. This parameter
|
||||||
* is the same as the second parameter of the standard C library
|
* is the same as the second parameter of the standard C library
|
||||||
@ -285,7 +287,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -379,6 +380,7 @@ void exit_parser(
|
|||||||
void *vp)
|
void *vp)
|
||||||
{
|
{
|
||||||
parser_env_ptr pe = (parser_env_ptr)(vp);
|
parser_env_ptr pe = (parser_env_ptr)(vp);
|
||||||
|
unsigned j;
|
||||||
var_store_ptr vars,
|
var_store_ptr vars,
|
||||||
bv;
|
bv;
|
||||||
|
|
||||||
@ -421,8 +423,9 @@ void *vp)
|
|||||||
unsigned ret = FALSE;
|
unsigned ret = FALSE;
|
||||||
parser_env_ptr pe = (parser_env_ptr)vp;
|
parser_env_ptr pe = (parser_env_ptr)vp;
|
||||||
var_store_ptr nv,
|
var_store_ptr nv,
|
||||||
tv;
|
tv,
|
||||||
|
sv,
|
||||||
|
uv;
|
||||||
|
|
||||||
for ( nv = pe->named_vars , tv = NULL ; nv ; tv = nv , nv = nv->next_var ) {
|
for ( nv = pe->named_vars , tv = NULL ; nv ; tv = nv , nv = nv->next_var ) {
|
||||||
if ( strcmp(nv->variable_name,var_name) == 0 ) {
|
if ( strcmp(nv->variable_name,var_name) == 0 ) {
|
||||||
@ -518,6 +521,7 @@ parser_env_ptr pe)
|
|||||||
static var_store_ptr get_named_var(
|
static var_store_ptr get_named_var(
|
||||||
parser_env_ptr pe)
|
parser_env_ptr pe)
|
||||||
{
|
{
|
||||||
|
unsigned cntr;
|
||||||
var_store_ptr retp = NULL,
|
var_store_ptr retp = NULL,
|
||||||
bv;
|
bv;
|
||||||
|
|
||||||
@ -661,7 +665,7 @@ parser_env_ptr pe)
|
|||||||
ao = pe->asn_op;
|
ao = pe->asn_op;
|
||||||
if ( vl->variable_name ) {
|
if ( vl->variable_name ) {
|
||||||
next_token(pe);
|
next_token(pe);
|
||||||
add_sub_op(pe);
|
assignment_op(pe);
|
||||||
vr = pop(pe);
|
vr = pop(pe);
|
||||||
vl->assign_flag = ASSIGNED_TO;
|
vl->assign_flag = ASSIGNED_TO;
|
||||||
if ( ao ) {
|
if ( ao ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user