tebe6502 / Mad-Pascal

Mad Pascal Compiler for 6502 (Atari XE/XL, C64, C4Plus, Neo6502)
122 stars 20 forks source link

MP incorrectly generates a reference to a variable placed in the library, which causes a MADS compilation error. #110

Closed GSoftwareDevelopment closed 2 years ago

GSoftwareDevelopment commented 2 years ago

The following code should compile smoothly.

unit test2_lib;

interface

var
    fn:String[80];

implementation

end.

//

uses test2_lib;

procedure proc();
var
    l:byte;

begin
    l:=length(fn);
end;

begin
    fn:='ATARI RULEZ!';
    proc();
end.

The error occurs regardless of whether the variable is called from a procedure or in the main block.

There is a similar effect with the constants declared in the library, which are used e.g. in the assembler code, although here, one could suppose that it is supposed to be so. Simply, the labels from the main namespace of the library, do not get the equivalent in the main namespace of the program using it Sent As in ASM I can still refer to the namespace of the library, but using test2_lib.fn does not give this effect

tebe6502 commented 2 years ago

issue #110 (LENGTH) fixed

GSoftwareDevelopment commented 2 years ago

Przy Length błąd zniknął, jednak (okazuje się) że jest jeszcze przy przypisaniu string:=string; i przy byte:=byte(string[0]);

tebe6502 commented 2 years ago

fixed