print c.foo
print bar.c
print bar.b + 42
-
// trigger 'labels not permitted' error message
while 1 if True else False:
.tmp.code:33:14: error: field reference attempted on string, not a struct
.tmp.code:34:14: error: cannot find requested field in foo
.tmp.code:35:17: error: have string but need number
- .tmp.code:39:29: error: expected number (labels not permitted) found Boolean
+ .tmp.code:38:29: error: expected number (labels not permitted) found Boolean
oceani: type error in program - not running.
###### test: type_err4
}
}
- static void _dup_value(struct type *type,
+ static void _dup_value(struct type *type,
struct value *vold, struct value *vnew)
{
switch (type->vtype) {
The storage of the value of a variable will be described later. For now
we just need to know that when a variable goes out of scope, it might
-need to be freed. For this we need to be able to find it, so assume that
+need to be freed. For this we need to be able to find it, so assume that
`var_value()` will provide that.
###### variable fields
struct value *v;
v = (void*) val->ptr + type->structure.fields[i].offset;
if (type->structure.fields[i].init)
- dup_value(type->structure.fields[i].type,
+ dup_value(type->structure.fields[i].type,
type->structure.fields[i].init,
v);
else
}
} }$
-
$*binode
Args -> ArgsLine NEWLINE ${ $0 = $<AL; }$
| Args ArgsLine NEWLINE ${ {
Use,
###### expr precedence
- $TERM use
+ $TERM use
###### SimpleStatement Grammar
| use Expression ${
One of the functions must be named `main` and it must accept an array of
strings as a parameter - the command line arguments.
-
As this is the top level, several things are handled a bit
differently.
The function is not interpreted by `interp_exec` as that isn't
array_init(v->var->type, vl);
for (i = 0; i < argc; i++) {
struct value *vl2 = vl->array + i * v->var->type->array.member->size;
-
arg.str.txt = argv[i];
arg.str.len = strlen(argv[i]);