Las Venturas Playground
[PreCompiler] Known bugs - Printable Version

+- Las Venturas Playground (https://forum.sa-mp.nl)
+-- Forum: Main Talk (https://forum.sa-mp.nl/forum-3.html)
+--- Forum: Development (https://forum.sa-mp.nl/forum-16.html)
+--- Thread: [PreCompiler] Known bugs (/thread-29801.html)



[PreCompiler] Known bugs - Kase - 08-29-2012

While I was coding the Ammunation feature, I stumbled upon the following issue; in a class, I had a property which had to be used to count the instances of another class. Although it didn't work, so I had to use a hack. Let me explain; the code shows how it should have worked, but actually didn't:

Code:
class Foo
{
    const BarInstances = 30;
}

class Bar <barId (Foo::BarInstances)>
{
    // ...
}

Would be cool to have it fixed!  :)


Re: [PreCompiler] Known bugs - Kase - 08-30-2012

A few more bugs!

It looks like some errors occour if you use sizeof(m_somePropertyHere). For example:

Code:
class Foo
{
    new m_bar[128];

    private toast()
    {
    meep = 1;    

        format(m_bar, sizeof(m_bar), "%d", meep);
    }
}

That code returns these errors upon compiling:

Code:
error 001: expected token: "]", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Also, in the compiler output, you can't use CTRL+C to copy logs. Even though RMB -> Copy works, CTRL+C is way faster.  :)


Re: [PreCompiler] Known bugs - Russell - 08-30-2012

(08-29-2012, 10:43 AM)Kase link Wrote: While I was coding the Ammunation feature, I stumbled upon the following issue; in a class, I had a property which had to be used to count the instances of another class. Although it didn't work, so I had to use a hack. Let me explain; the code shows how it should have worked, but actually didn't:

Code:
class Foo
{
    const BarInstances = 30;
}

class Bar <barId (Foo::BarInstances)>
{
    // ...
}

Would be cool to have it fixed!  :)

The instances should be declared as:

Code:
class Foo {
    public const BarInstances = 30;
};

class Bar <barId (Foo::BarInstances)> {
    // ...
};

That'll work just fine.

(08-30-2012, 01:47 PM)Kase link Wrote: It looks like some errors occour if you use sizeof(m_somePropertyHere). For example:

Fixed in LVP PreCompiler 4.3.

(08-30-2012, 01:47 PM)Kase link Wrote: Also, in the compiler output, you can't use CTRL+C to copy logs. Even though RMB -> Copy works, CTRL+C is way faster.  :)

Fixed in the experimental LVP Pawn Editor binary.


Re: [PreCompiler] Known bugs - Kase - 08-31-2012

Alright cool, thanks for your time :)


Re: [PreCompiler] Known bugs - Kase - 09-03-2012

Instance count identifiers for classes can be longer than 32 characters, and the PreCompiler should allow that.


Re: [PreCompiler] Known bugs - Russell - 09-03-2012

(09-03-2012, 01:21 PM)Kase link Wrote: Instance count identifiers for classes can be longer than 32 characters, and the PreCompiler should allow that.

I've increased the limit to 64 characters in the 4.3.1 release.