[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:06 UTC 2009
The following commit has been merged in the upstream branch:
commit f732d6858c68b0dc8977ed3a94459b32db372566
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Tue Jun 28 13:43:24 2005 +1000
Fix for incorrect parsing of GfsFunction
darcs-hash:20050628034324-fbd8f-ebcd99b0cf08c8e9e74b62cbb6f8d0e4cfe5f04d.gz
diff --git a/src/utils.c b/src/utils.c
index b182bfc..75ad6ec 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -128,17 +128,21 @@ static gboolean expr_or_func (GtsFile * fp, GfsFunction * f)
if (type == '(' || type == GTS_STRING) {
f->expr = g_string_new (fp->token->str);
- if (type == '(' || fp->next_token != '\0') {
+ if (type == '(' || (fp->next_token != '\0' && fp->next_token != '}')) {
scope = type == '(' ? 1 : 0;
if (fp->next_token != '\0')
g_string_append_c (f->expr, fp->next_token);
c = gts_file_getc (fp);
- while (c != EOF && (scope > 0 || (c != ' ' && c != '\n'))) {
+ while (c != EOF && (scope > 0 || !gfs_char_in_string (c, "}\t \n"))) {
if (c == '(') scope++;
if (c == ')') scope--;
g_string_append_c (f->expr, c);
c = gts_file_getc (fp);
}
+ if (scope != 0)
+ gts_file_error (fp, "parse error");
+ else if (c == '}')
+ fp->next_token = c;
}
return TRUE;
}
@@ -365,14 +369,11 @@ static void function_read (GtsObject ** o, GtsFile * fp)
close (find);
status = compile (fp, f, finname);
- // remove (finname);
+ remove (finname);
switch (status) {
case SIGQUIT: exit (0);
case SIGABRT: return;
}
-
- if ((type == '(' || type == GTS_STRING) && fp->next_token != '\0')
- gts_file_next_token (fp);
}
break;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list