From a589c071ce45eb0550e11dbe1a13ce05039e855e Mon Sep 17 00:00:00 2001 From: maciejlach Date: Thu, 11 Sep 2014 08:50:16 +0200 Subject: [PATCH] Fix #4: reading of generic null (::) embedded in lists --- CHANGELOG.txt | 6 ++++++ qSharp/src/QReader.cs | 1 + qSharp/test/QExpression.cs | 2 ++ qSharp/test/QExpressions.3.out | 2 ++ qSharp/test/QExpressions.out | 2 ++ 5 files changed, 13 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a3e61a9..75f3375 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,9 @@ +------------------------------------------------------------------------------ + qSharp 2.0.6 [2014.09.11] +------------------------------------------------------------------------------ + + - Fix: reading of generic null (::) embedded in lists + ------------------------------------------------------------------------------ qSharp 2.0.5 [2014.09.01] ------------------------------------------------------------------------------ diff --git a/qSharp/src/QReader.cs b/qSharp/src/QReader.cs index 14ed066..4710091 100644 --- a/qSharp/src/QReader.cs +++ b/qSharp/src/QReader.cs @@ -245,6 +245,7 @@ private object ReadObject() case QType.GeneralList: return ReadGeneralList(); case QType.NullItem: + reader.ReadSByte(); // ignore return null; case QType.Error: return ReadError(); diff --git a/qSharp/test/QExpression.cs b/qSharp/test/QExpression.cs index ec78ffb..1f4dcbd 100644 --- a/qSharp/test/QExpression.cs +++ b/qSharp/test/QExpression.cs @@ -98,6 +98,7 @@ internal class QExpressions {"3.233 6.46", new Double[] {3.233, 6.46}}, {"(1;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (float) 5.5}}, + {"(42;::;`foo)", new object[] { 42, null, "foo" }}, {"(enlist 1h; 2; enlist 3j)", new object[] {new short[] {1}, 2, new long[] {3}}}, {"(2;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (Single) 5.5}}, {"(enlist 2h; 2; enlist 3j)", new object[] {new Int16[] {1}, 2, new long[] {3}}}, @@ -281,6 +282,7 @@ internal class QExpressions {"3.233 6.46", new Double[] {3.233, 6.46}}, {"(1;`bcd;\"0bc\";5.5e)", new object[] {(long) 1, "bcd", "0bc".ToCharArray(), (float) 5.5}}, + {"(42;::;`foo)", new object[] { 42L, null, "foo" }}, {"(enlist 1h; 2; enlist 3j)", new object[] {new short[] {1}, (long) 2, new long[] {3}}}, {"(2;`bcd;\"0bc\";5.5e)", new object[] {1, "bcd", "0bc".ToCharArray(), (Single) 5.5}}, {"(enlist 2h; 2; enlist 3j)", new object[] {new Int16[] {1}, 2, new long[] {3}}}, diff --git a/qSharp/test/QExpressions.3.out b/qSharp/test/QExpressions.3.out index f1402e4..f280b86 100644 --- a/qSharp/test/QExpressions.3.out +++ b/qSharp/test/QExpressions.3.out @@ -102,6 +102,8 @@ ED00000080 090002000000D7A3703D0AD70940D7A3703D0AD71940 (1;`bcd;"0bc";5.5e) 000004000000F90100000000000000F5626364000A0003000000306263F80000B040 +(42;::;`foo) +000003000000f92a000000000000006500f5666f6f00 (enlist 1h; 2; enlist 3j) 0000030000000500010000000100F902000000000000000700010000000300000000000000 `the`quick`brown`fox diff --git a/qSharp/test/QExpressions.out b/qSharp/test/QExpressions.out index d48ad0a..65f0dce 100644 --- a/qSharp/test/QExpressions.out +++ b/qSharp/test/QExpressions.out @@ -102,6 +102,8 @@ ED00000080 090002000000D7A3703D0AD70940D7A3703D0AD71940 (1;`bcd;"0bc";5.5e) 000004000000FA01000000F5626364000A0003000000306263F80000B040 +(42;::;`foo) +000003000000fa2a0000006500f5666f6f00 (enlist 1h; 2; enlist 3j) 0000030000000500010000000100FA020000000700010000000300000000000000 `the`quick`brown`fox