diff --git a/src/oberon.c b/src/oberon.c
index cd7e97a18f3cb5531e77bd28d1253a62cdc92b85..931a30724697a03476cff779779b3385bad5f2b4 100644 (file)
--- a/src/oberon.c
+++ b/src/oberon.c
return result;
}
+static oberon_object_t *
+oberon_find_object_in_scope(oberon_scope_t * scope, char * name, bool check_it)
+{
+ oberon_object_t * result = NULL;
+
+ result = oberon_find_object_in_list(scope -> list, name);
+
+ if(check_it && result == NULL)
+ {
+ oberon_error(scope -> ctx, "undefined ident %s", name);
+ }
+
+ return result;
+}
+
static oberon_object_t *
oberon_create_object(oberon_scope_t * scope, char * name, int class, bool export, bool read_only)
{
ctx -> xloc.col = 1;
ctx -> loc = ctx -> xloc;
ctx -> c = ctx -> code[ctx -> code_index];
+ oberon_set_line(ctx, 1);
}
static void
}
ctx -> xloc.line += 1;
ctx -> xloc.col = 1;
+ oberon_set_line(ctx, ctx -> xloc.line);
}
else if(ctx -> c == 0xA)
{
oberon_get_char(ctx);
ctx -> xloc.line += 1;
ctx -> xloc.col = 1;
+ oberon_set_line(ctx, ctx -> xloc.line);
}
else
{
oberon_close_scope(ctx -> decl);
oberon_object_t * proc;
- proc = oberon_find_object(ctx -> decl, name, 0);
+ proc = oberon_find_object_in_scope(ctx -> decl, name, 0);
if(proc == NULL)
{
proc = oberon_define_object(ctx -> decl, name, OBERON_CLASS_PROC, export, read_only, false);