Skip to content
Snippets Groups Projects
Commit 7ab9ecd6 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Sprintf[] for compatibility with GetDP

parent 0273db17
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -4940,6 +4940,11 @@ StringExpr : ...@@ -4940,6 +4940,11 @@ StringExpr :
{ {
$$ = $3; $$ = $3;
} }
// for compatibility with GetDP
| tSprintf '[' StringExprVar ']'
{
$$ = $3;
}
| tSprintf '(' StringExprVar ',' RecursiveListOfDouble ')' | tSprintf '(' StringExprVar ',' RecursiveListOfDouble ')'
{ {
char tmpstring[5000]; char tmpstring[5000];
...@@ -4959,6 +4964,26 @@ StringExpr : ...@@ -4959,6 +4964,26 @@ StringExpr :
} }
List_Delete($5); List_Delete($5);
} }
// for compatibility with GetDP
| tSprintf '[' StringExprVar ',' RecursiveListOfDouble ']'
{
char tmpstring[5000];
int i = PrintListOfDouble($3, $5, tmpstring);
if(i < 0){
yymsg(0, "Too few arguments in Sprintf");
$$ = $3;
}
else if(i > 0){
yymsg(0, "%d extra argument%s in Sprintf", i, (i > 1) ? "s" : "");
$$ = $3;
}
else{
$$ = (char*)Malloc((strlen(tmpstring) + 1) * sizeof(char));
strcpy($$, tmpstring);
Free($3);
}
List_Delete($5);
}
; ;
RecursiveListOfStringExprVar : RecursiveListOfStringExprVar :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment