Ok,

I didn't see you had that test in my existing code.

I have fixed it with my last commit, update your code and it will pass.

Seems there is an ambiguity with subtract and infinity. You know what, I don't care right now. :) I just make it work based off the current Falcon grammar and this is the way they have it.

Mike

Quoting Erik de Bruin <[email protected]>:

<code>
    @Override

    @Test

    public void testNegativeInfinity()

    {

        IVariableNode node = getField("var a:Number = -Infinity;");

        JSSharedData.OUTPUT_JSDOC = false;

        visitor.visitVariable(node);

        JSSharedData.OUTPUT_JSDOC = true;

        assertOut("A.prototype.a = -Infinity");

    }
</code>

The assert fails with: got: "A.prototype.a = " (note there is nothing
but a space after the equals sign)

EdB




On Tue, Jan 8, 2013 at 1:31 PM, Michael Schmalle
<[email protected]> wrote:

Quoting Erik de Bruin <[email protected]>:

What worries me is not that the test fails (per se), but the way in
which it fails... It seems that '-Infinity' is completely left out of
the 'compiled' string. It vanishes. Is that a byproduct of using the
'wrong' test (visitVariable) or something deeper?


Can you paste your test method so I have some context?






EdB



On Tue, Jan 8, 2013 at 1:18 PM, Michael Schmalle
<[email protected]> wrote:

Yup,

And now looking at the AST, Inifinity is just an Identifier like very
other
IdentifierNode. This means it only has relevance when check the semantics
of
it's location which means, the parser doesn't care about it.

So this is correct that - adds the IdentifierNode node in a
UnaryOperatorMinusNode.

To test it, you need to call visitUnaryOperator(node).

Mike



Quoting Michael Schmalle <[email protected]>:

Well, that makes sense because unless -Infinity is a true constant, - is
the unary operator to the constant Infinity. Might want to look that up
in
the definition.

Looking through the code now, Infinity is not considered a Literal, so I
need to do some more research on that.

Mike


Quoting Erik de Bruin <[email protected]>:

The compiler seems to think that '-Infinity' is a unary operator...

EdB



On Tue, Jan 8, 2013 at 12:42 PM, Michael Schmalle
<[email protected]> wrote:


Wow, your going to make me fire up Apache Eclipse heh?

Should have put a do not disturb on the door knob! ;-)

My guess is it has something to do with the emit Literal, I will check
on it
to see if I can come up with the answer.

Let me know if you figure it out though.


Mike

Quoting Erik de Bruin <[email protected]>:

The test for Infinity takes 'var a:Number = Infinity;' which compiles
(correctly) to 'var a:Number = Infinity'

The test for Infinity takes 'var a:Number = -Infinity;' which
compiles
(wrongly) to 'var a:Number = '

No exceptions are thrown or anything.

I'm keeping my commits as small as I can (one feature or fix each,
mostly) and I'm testing before each one (most of the time, still
sloppy when I get excited ;-))

EdB



On Tue, Jan 8, 2013 at 12:28 PM, Michael Schmalle
<[email protected]> wrote:



Hey,

Hmm... I wonder if it's a Falcon bug? Where is the test dying?

FYI, I haven't touched any code for about a week or so, I'm working
on
an
audio project at the moment(that I'm ridiculously involved in :) )

So you are safe with no merge conflicts for now. I will keep
updating
to
see
if you have committed anything new.

Just please... :) Commit small and make sure the whole suite passes.
So
when
I get back to this code I'm not lost. ;-)

Mike


Quoting Erik de Bruin <[email protected]>:

Mike,

I am working on adding tests for all AS language features and one
of
the first on my list (Full Table the Wiki) is '-Infinity' in the
Global Constants section.

The AS test I wrote for 'Infinity' passes, but when I add the '-'
in
front of it for the test of negative infinity, the compiler gives
up
and the test fails.

Any ideas?

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com




--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com




--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com



--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com




--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com




--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com

Reply via email to