Browse Source

More parse style fixes

signals
Gavin Howard 4 years ago
parent
commit
b9ba5d5bc3
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 7
      src/bc/parse.c
  2. 1
      src/parse.c

7
src/bc/parse.c

@ -794,6 +794,7 @@ BcStatus bc_parse_func(BcParse *p) {
bool var, comma = false;
uint16_t flags;
char *name;
size_t idx;
s = bc_lex_next(&p->l);
if (s) return s;
@ -803,9 +804,9 @@ BcStatus bc_parse_func(BcParse *p) {
assert(p->prog->fns.len == p->prog->fn_map.len);
name = bc_vm_strdup(p->l.t.v.v);
p->fidx = bc_program_addFunc(p->prog, name);
assert(p->fidx);
p->func = bc_vec_item(&p->prog->fns, p->fidx);
idx = bc_program_addFunc(p->prog, name);
assert(idx);
bc_parse_updateFunc(p, idx);
s = bc_lex_next(&p->l);
if (s) return s;

1
src/parse.c

@ -79,6 +79,7 @@ void bc_parse_addId(BcParse *p, BcVec *map, BcVec *vec, char inst) {
}
BcStatus bc_parse_text(BcParse *p, const char *text) {
// Make sure the pointer isn't invalidated.
p->func = bc_vec_item(&p->prog->fns, p->fidx);
return bc_lex_text(&p->l, text);
}

Loading…
Cancel
Save