[Oberon] PC.Compile singularities

Patrik Reali reali at acm.org
Sun Feb 23 10:55:57 CET 2003


Hi,
>
>   a) If you use objects in texts of your programs the error
> reporting (PC.Compile) gets confunsed. The problem seems to be in
> PC.TextReader.Receive procedure in this lines.
>
> REPEAT
> Texts.Read(r, ch)
> UNTIL r.eot OR ((r.lib # NIL) & (r.lib IS Fonts.Font));
>
>   the objects are just discarded, which is fine, but the "char
> index" does not increase, so you get the errors reported before their
> actual position. I have changed those lines with
>

This problem is quite a hassle: I'm trying to make the whole Paco an Aos
application (i.e. it can be invoked from the Aos command line without having
to load the whole Oberon IDE), but most of the texts we are using are Oberon
texts. For this reason, the main module of the compiler has to understand
the oberon text format (would require to duplicate all the text parsing
code) or rely on some external libraries (e.g. AosTexts). Obviously the
problem is not to lose the synchronization with the text (for emitting error
positions).


> Texts.Read (r, ch);
> IF r.eot OR ((r.lib # NIL) & (r.lib IS Fonts.Font)) THEN
> (* regular char or end of text, do nothing *)
> ELSE
> (* some kind of object, give the compiler a space
> instead *)
> ch := " ";
> END; (* if *)
>
> and it helped.
>

I like your solution, it is very simple. I'm just not sure if all embedded
objects are 1 byte wide. I will have to check.


>   b) While testing the previous change, I have run into this.
>
> MODULE See;
> TYPE
> A = RECORD
> a : BOOLEAN (* semicolon missing *)
> l : LONGINT;
> END ;
> END See.
>
> It compiles with PC.Compile, which is not rather problematic.
>

Added to the bug lists. Thanks!




More information about the Oberon mailing list