PlayScriptRedux / playscript

PlayScript is an ActionScript compatible compiler and Flash compatible runtime that runs in the Mono/.NET environment
Other
17 stars 9 forks source link

Add Null operators to PlayScript (.play) / Parity to C# 6 #72

Open sushihangover opened 9 years ago

sushihangover commented 9 years ago

Parity to null operators that started on this upstream commit:

Commit : e7bf6d81ea3f864f26f702cc5257a511990c1ed6 Info : 7/31/2014 11:04:50 AM +02:00 / Marek Safar / marek.safar@gmail.com Msg : [mcs] Member access null propagating operator

Staged : mcs/mcs/async.cs Staged : mcs/mcs/codegen.cs Staged : mcs/mcs/cs-parser.jay Staged : mcs/mcs/cs-tokenizer.cs Staged : mcs/mcs/delegate.cs Staged : mcs/mcs/ecore.cs Staged : mcs/mcs/method.cs Staged : mcs/mcs/nullable.cs Staged : mcs/mcs/statement.cs Staged : mcs/tests/ver-il-net_4_5.xml Conflict : mcs/mcs/expression.cs ~ Manual intervention needed : mcs/mcs/expression.cs

sushihangover commented 9 years ago

New test: play/test-ps-Null-Operator-2.play

// Compiler options:
//
package {
    public class Foo {
        public static function Main():int {
        var msg:String = "playscript";
        var result:String = msg ?? "NullString";
        if (result != "playscript") return 1;

        msg = null;
        result = msg ?? "NullString";
        if (result != "NullString")  return 2;

        return 0;
        }
    }
}
sushihangover commented 9 years ago

New test: play/test-ps-Null-Operator-1.play

// Compiler options:
//
package {
    public class Foo {
        public static function Main():int {
        var i:int? = 55;
        var result:int = i ?? 0;
        if (result != 55) return 1;

        var ii:int? = null;
        var result2:int = ii ?? 0;
        if (result2 != 0)  return 2;

        return 0;
        }
    }
}
sushihangover commented 9 years ago

Upstream merge:

commit 6d822246669b35b7e584bbc73cdb123760ed90b9 Merge: 0a8f656 e7bf6d8 Author: SushiHangover sushihangover@outlook.com Date: Sun Aug 23 00:44:27 2015 -0700

Merge commit 'e7bf6d81ea3f864f26f702cc5257a511990c1ed6'

Conflicts:
    mcs/mcs/expression.cs
sushihangover commented 9 years ago

commit 59fff3fe72e54008948693126ded5cf1ea7b2a10 Author: SushiHangover sushihangover@outlook.com Date: Sun Aug 23 00:45:39 2015 -0700

Ref #72 : Start of Null Operators to have parity in .play and C# 6
sushihangover commented 9 years ago

More tests are needed

sushihangover commented 9 years ago

Need to pull jay changes:

Merge results: Conflicts
Commit : 3bd87b33c522187af6aa8e31bbd82043905d357e
Info : 8/4/2014 5:32:15 PM +02:00 / Marek Safar / marek.safar@gmail.com
Msg : [mcs] null propagating operator on index expressions

Staged : mcs/mcs/cs-parser.jay
Staged : mcs/mcs/cs-tokenizer.cs
Staged : mcs/mcs/ecore.cs
Staged : mcs/tests/test-null-operator-02.cs
Staged : mcs/tests/ver-il-net_4_5.xml
Conflict : mcs/mcs/expression.cs
 ~ Manual intervention needed : mcs/mcs/expression.
sushihangover commented 9 years ago

Need to pull jay changes:

ommit : d3553fefdc5515445fbfcdfb7933edd8c463dd19 Info : 8/7/2014 11:03:33 AM +02:00 / Marek Safar / marek.safar@gmail.com Msg : [mcs] null propagating operator with nested receiver

Staged : mcs/class/corlib/System/Decimal.cs Staged : mcs/class/corlib/Test/System/DecimalTest.cs Staged : mcs/class/Managed.Windows.Forms/Makefile Staged : mcs/class/Mono.WebBrowser/Makefile Staged : mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs Staged : mcs/class/System.XML/Test/System.Xml.Serialization/XmlReflectionImporterTests.cs Staged : mcs/class/System/Test/System/UriBuilderTest.cs Staged : mcs/class/WindowsBase/System.IO.Packaging/Check.cs Staged : mcs/class/WindowsBase/System.IO.Packaging/PackUriHelper.cs Staged : mcs/class/WindowsBase/Test/System.IO.Packaging/PackUriHelperTests.cs Staged : mcs/mcs/codegen.cs Staged : mcs/mcs/context.cs Staged : mcs/mcs/cs-parser.jay Staged : mcs/mcs/delegate.cs Staged : mcs/mcs/ecore.cs Staged : mcs/tests/test-null-operator-01.cs Staged : mcs/tests/test-null-operator-02.cs Staged : mcs/tests/test-null-operator-05.cs Staged : mcs/tests/ver-il-net_4_5.xml Conflict : mcs/class/Mono.CSharp/Mono.CSharp.sln ~ Checkout --theirs mcs/class/Mono.CSharp/Mono.CSharp.sln