comparison directive.c @ 72:b1d0f10e8d36

handle nested ifs correctly
author David A. Holland
date Mon, 10 Jun 2013 16:20:33 -0400
parents f8507e5ed84c
children 123168887da8
comparison
equal deleted inserted replaced
71:dc63e70e425d 72:b1d0f10e8d36
136 136
137 static 137 static
138 void 138 void
139 ifstate_push(struct place *p, bool startstate) 139 ifstate_push(struct place *p, bool startstate)
140 { 140 {
141 ifstate = ifstate_create(ifstate, p, startstate); 141 struct ifstate *newstate;
142
143 newstate = ifstate_create(ifstate, p, startstate);
144 if (!ifstate->curtrue) {
145 newstate->curtrue = false;
146 newstate->evertrue = true;
147 }
148 ifstate = newstate;
142 } 149 }
143 150
144 static 151 static
145 void 152 void
146 ifstate_pop(void) 153 ifstate_pop(void)