diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9aaf7b1..81c5a09 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,9 @@ ------------------------------------------------------------------------------ - qSharp 2.1.1 [TBA] + qSharp 2.1.1 [2015.03.23] ------------------------------------------------------------------------------ - Fix: sanity check against protocol version for guids + - Add serialization for type: char[][] ------------------------------------------------------------------------------ qSharp 2.1.0 [2014.10.01] diff --git a/qSharp/src/QType.cs b/qSharp/src/QType.cs index b1b318c..9072e79 100644 --- a/qSharp/src/QType.cs +++ b/qSharp/src/QType.cs @@ -109,6 +109,7 @@ public static class QTypes {typeof (double[]), QType.DoubleList}, {typeof (char), QType.Char}, {typeof (char[]), QType.String}, + {typeof (char[][]), QType.GeneralList}, {typeof (string), QType.Symbol}, {typeof (string[]), QType.SymbolList}, {typeof (QTimestamp), QType.Timestamp}, diff --git a/qSharp/test/QExpression.cs b/qSharp/test/QExpression.cs index 94bcb61..d901fce 100644 --- a/qSharp/test/QExpression.cs +++ b/qSharp/test/QExpression.cs @@ -106,6 +106,7 @@ internal class QExpressions {"``quick``fox", new[] {"", "quick", "", "fox" }}, {"``", new[] {"", ""}}, {"(\"quick\"; \"brown\"; \"fox\"; \"jumps\"; \"over\"; \"a lazy\"; \"dog\")", new object[] {"quick".ToCharArray(), "brown".ToCharArray(), "fox".ToCharArray(), "jumps".ToCharArray(), "over".ToCharArray(), "a lazy".ToCharArray(), "dog".ToCharArray() }}, + {"(\"quick\"; \"brown\"; \"fox\")", new char[][] {"quick".ToCharArray(), "brown".ToCharArray(), "fox".ToCharArray() }}, { "2000.01.04D05:36:57.600 0Np", new[] {new QTimestamp(279417600000000), new QTimestamp(long.MinValue)} @@ -290,6 +291,7 @@ internal class QExpressions {"``quick``fox", new[] {"", "quick", "", "fox" }}, {"``", new[] {"", ""}}, {"(\"quick\"; \"brown\"; \"fox\"; \"jumps\"; \"over\"; \"a lazy\"; \"dog\")", new object[] {"quick".ToCharArray(), "brown".ToCharArray(), "fox".ToCharArray(), "jumps".ToCharArray(), "over".ToCharArray(), "a lazy".ToCharArray(), "dog".ToCharArray() }}, + {"(\"quick\"; \"brown\"; \"fox\")", new char[][] {"quick".ToCharArray(), "brown".ToCharArray(), "fox".ToCharArray() }}, { "2000.01.04D05:36:57.600 0Np", new[] {new QTimestamp(279417600000000), new QTimestamp(long.MinValue)} @@ -452,7 +454,15 @@ public byte[] GetBinaryExpression(string version, string key) public object GetReferenceObject(string version, string key) { - return reference[version][key]; + try + { + return reference[version][key]; + } + catch (Exception e) + { + Console.Error.WriteLine(string.Format("Cannot retrieve key: {0}", key)); + throw e; + } } private static byte[] StringToByteArray(String hex) diff --git a/qSharp/test/QExpressions.3.out b/qSharp/test/QExpressions.3.out index f280b86..11f933a 100644 --- a/qSharp/test/QExpressions.3.out +++ b/qSharp/test/QExpressions.3.out @@ -114,6 +114,8 @@ ED00000080 0B00020000000000 ("quick"; "brown"; "fox"; "jumps"; "over"; "a lazy"; "dog") 0000070000000A0005000000717569636B0A000500000062726F776E0A0003000000666F780A00050000006A756D70730A00040000006F7665720A000600000061206C617A790A0003000000646F67 +("quick"; "brown"; "fox") +0000030000000A0005000000717569636B0A000500000062726F776E0A0003000000666F78 2000.01.04D05:36:57.600 0Np 0C000200000000C0CAFA20FE00000000000000000080 (2001.01m; 0Nm) diff --git a/qSharp/test/QExpressions.out b/qSharp/test/QExpressions.out index 65f0dce..d0f9ac8 100644 --- a/qSharp/test/QExpressions.out +++ b/qSharp/test/QExpressions.out @@ -114,6 +114,8 @@ ED00000080 0B00020000000000 ("quick"; "brown"; "fox"; "jumps"; "over"; "a lazy"; "dog") 0000070000000A0005000000717569636B0A000500000062726F776E0A0003000000666F780A00050000006A756D70730A00040000006F7665720A000600000061206C617A790A0003000000646F67 +("quick"; "brown"; "fox") +0000030000000A0005000000717569636B0A000500000062726F776E0A0003000000666F78 2000.01.04D05:36:57.600 0Np 0C000200000000C0CAFA20FE00000000000000000080 (2001.01m; 0Nm)