Hello There, Guest! Login or Register


[PreCompiler] Known bugs
#1
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!  :)
Reply
#2
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.  :)
Reply
#3
(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.
Reply
#4
Alright cool, thanks for your time :)
Reply
#5
Instance count identifiers for classes can be longer than 32 characters, and the PreCompiler should allow that.
Reply
#6
(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.
Reply