pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
303 stars 70 forks source link

Compiler errors with universal pseudoopcodes #676

Open dev-karpov0 opened 3 years ago

dev-karpov0 commented 3 years ago

When we have a single-line__emit {load.u.pri idx} (or another u. pseudoopcode) statement (with { }) the compiler throws an error error 010: invalid function or declaration

new array[32], idx;
main()
{
    new addr;
    __emit {const.alt    array}
    __emit {load.u.pri   idx}// invalid function or declaration
    __emit {idxaddr} 
    __emit {stor.s.pri   addr}

    //The same code without { } compiles fine
    __emit const.alt    array;
    __emit load.u.pri   idx;
    __emit idxaddr;
    __emit stor.s.pri   addr;
}

Or if we use multiple instruction set per one __emit statement the compiler 'cuts' the next instruction name after universal pseudoopcode

new array[32], idx;
main()
{
    new addr;
    __emit {
        const.alt    array
        load.u.pri   idx//universal opcode
        idxaddr //fatal error 104: invalid assembler instruction "dxaddr"
        stor.s.pri   addr
    }
    //in the console output 'i' character is missing ("dxaddr") 
}

Workspace Information:

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.