Skip to content

Commit

Permalink
Fix parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Dec 1, 2024
1 parent b3409a8 commit 8e7134e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/parseDdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ static inline int add_deCmtProp(nodeInfo ni, char *name, char *v, int hasLhs, in
}

static inline int add_deState(nodeInfo ni, char *name, char *v, int hasLhs, int fromWhere) {
new_or_ith(v);
if (new_or_ith(v)) {
addSymbolStr(v);
new_or_ith(v);
}
if (((tb.ini[tb.ix] == 1 && tb.ini0[tb.ix] == 0) ||
(tb.lh[tb.ix] == isLHS || tb.lh[tb.ix] == isLHSparam))){
updateSyntaxCol();
Expand Down
9 changes: 8 additions & 1 deletion src/parseFunsDosing.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,16 @@ static inline int handleFunctionTadSingleStateCcode(transFunctions *tf,char *v2)
// cannot be lhs statements in tad style assignments
// also cannot be from anywhere
// temporarily turn off that this is a function
// This is not a function
int fn = tb.fn;
tb.fn = 0;
add_de(tf->ni, tf->name, v2, 0, 0);
// this is NOT an assignment
nodeInfo ni2;
niReset(&ni2);
char *name = tf->v;
ni2.assignment = 0;
ni2.ini = 0;
add_de(ni2, name, v2, 0, 0);
// turn back on that this is a function
tb.fn = fn;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/parseVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ static inline int skipReservedVariables(const char *s) {
/* new symbol? if no, find it's ith */
static inline int new_or_ith(const char *s) {
int i;
tb.ix=-2;
if (tb.fn) {tb.ix=-2; return 0;}
if (!strcmp("lhs", s)){tb.ix=-1; return 0;}
if (assertForbiddenVariables(s) == 0) return 0;
Expand Down

0 comments on commit 8e7134e

Please sign in to comment.