Subversion Repositories Kolibri OS

Rev

Rev 9579 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9579 Rev 9847
Line 1... Line 1...
1
(*
1
(*
2
    BSD 2-Clause License
2
    BSD 2-Clause License
Line 3... Line 3...
3
 
3
 
4
    Copyright (c) 2018-2021, Anton Krotov
4
    Copyright (c) 2018-2022, Anton Krotov
5
    All rights reserved.
5
    All rights reserved.
Line 6... Line 6...
6
*)
6
*)
Line 443... Line 443...
443
        ident:   PROG.IDENT;
443
        ident:   PROG.IDENT;
444
        exit:    BOOLEAN;
444
        exit:    BOOLEAN;
445
        vPar:    BOOLEAN;
445
        vPar:    BOOLEAN;
446
        dim:     INTEGER;
446
        dim:     INTEGER;
447
        t0, t1:  PROG._TYPE;
447
        t0, t1:  PROG._TYPE;
-
 
448
        pos:     POSITION;
Line 448... Line 449...
448
 
449
 
449
    BEGIN
450
    BEGIN
450
        vPar := parser.sym = SCAN.lxVAR;
451
        vPar := parser.sym = SCAN.lxVAR;
451
        IF vPar THEN
452
        IF vPar THEN
Line 460... Line 461...
460
            Next(parser);
461
            Next(parser);
461
            IF parser.sym = SCAN.lxCOMMA THEN
462
            IF parser.sym = SCAN.lxCOMMA THEN
462
                ExpectSym(parser, SCAN.lxIDENT)
463
                ExpectSym(parser, SCAN.lxIDENT)
463
            ELSIF parser.sym = SCAN.lxCOLON THEN
464
            ELSIF parser.sym = SCAN.lxCOLON THEN
464
                Next(parser);
465
                Next(parser);
-
 
466
                getpos(parser, pos);
465
                dim := 0;
467
                dim := 0;
466
                WHILE parser.sym = SCAN.lxARRAY DO
468
                WHILE parser.sym = SCAN.lxARRAY DO
467
                    INC(dim);
469
                    INC(dim);
468
                    check1(dim <= PROG.MAXARRDIM, parser, 84);
470
                    check1(dim <= PROG.MAXARRDIM, parser, 84);
469
                    ExpectSym(parser, SCAN.lxOF);
471
                    ExpectSym(parser, SCAN.lxOF);
Line 480... Line 482...
480
                    t1 := PROG.enterType(PROG.tARRAY, -1, 0, parser.unit);
482
                    t1 := PROG.enterType(PROG.tARRAY, -1, 0, parser.unit);
481
                    t1.base := t0;
483
                    t1.base := t0;
482
                    t0 := t1;
484
                    t0 := t1;
483
                    DEC(dim)
485
                    DEC(dim)
484
                END;
486
                END;
485
 
-
 
-
 
487
                IF _type.call IN {PROG.fastcall, PROG._fastcall} THEN
-
 
488
                    check(t1.typ # PROG.tREAL, pos, 126)
-
 
489
                END;
486
                PROG.setParams(_type, t1);
490
                PROG.setParams(_type, t1);
487
                Next(parser);
491
                Next(parser);
488
                exit := TRUE
492
                exit := TRUE
489
            ELSE
493
            ELSE
490
                checklex(parser, SCAN.lxCOLON)
494
                checklex(parser, SCAN.lxCOLON)
Line 548... Line 552...
548
        sf := PROG.sf_linux
552
        sf := PROG.sf_linux
549
    ELSIF parser.lex.ident.s = "code" THEN
553
    ELSIF parser.lex.ident.s = "code" THEN
550
        sf := PROG.sf_code
554
        sf := PROG.sf_code
551
    ELSIF parser.lex.ident.s = "oberon" THEN
555
    ELSIF parser.lex.ident.s = "oberon" THEN
552
        sf := PROG.sf_oberon
556
        sf := PROG.sf_oberon
-
 
557
    ELSIF parser.lex.ident.s = "fastcall" THEN
-
 
558
        sf := PROG.sf_fastcall
553
    ELSIF parser.lex.ident.s = "noalign" THEN
559
    ELSIF parser.lex.ident.s = "noalign" THEN
554
        sf := PROG.sf_noalign
560
        sf := PROG.sf_noalign
555
    ELSE
561
    ELSE
556
        check1(FALSE, parser, 124)
562
        check1(FALSE, parser, 124)
557
    END;
563
    END;
Line 581... Line 587...
581
        res := PROG.win64
587
        res := PROG.win64
582
    |PROG.sf_systemv:
588
    |PROG.sf_systemv:
583
        res := PROG.systemv
589
        res := PROG.systemv
584
    |PROG.sf_code:
590
    |PROG.sf_code:
585
        res := PROG.code
591
        res := PROG.code
-
 
592
    |PROG.sf_fastcall:
-
 
593
        res := PROG.fastcall
586
    |PROG.sf_oberon:
594
    |PROG.sf_oberon:
587
        IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
595
        IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
588
            res := PROG.default32
596
            res := PROG.default32
589
        ELSIF TARGETS.OS IN {TARGETS.osWIN64, TARGETS.osLINUX64} THEN
597
        ELSIF TARGETS.OS IN {TARGETS.osWIN64, TARGETS.osLINUX64} THEN
590
            res := PROG.default64
598
            res := PROG.default64
Line 1104... Line 1112...
1104
            ELSIF call IN {PROG._systemv, PROG.systemv} THEN
1112
            ELSIF call IN {PROG._systemv, PROG.systemv} THEN
1105
                fparams := PROG.getFloatParamsPos(proc._type, PROG.MAXSYSVPARAM - 1, int, flt);
1113
                fparams := PROG.getFloatParamsPos(proc._type, PROG.MAXSYSVPARAM - 1, int, flt);
1106
                enter := IL.Enter(label, -(LSL(ORD(fparams), 5) + proc._type.parSize))
1114
                enter := IL.Enter(label, -(LSL(ORD(fparams), 5) + proc._type.parSize))
1107
            ELSIF codeProc THEN
1115
            ELSIF codeProc THEN
Line -... Line 1116...
-
 
1116
 
-
 
1117
            ELSIF call IN {PROG.fastcall, PROG._fastcall} THEN
1108
 
1118
                enter := IL.Enter(label, proc._type.parSize)
1109
            ELSE
1119
            ELSE
1110
                enter := IL.Enter(label, 0)
1120
                enter := IL.Enter(label, 0)
1111
            END;
1121
            END;