X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=plist.cs;h=c7eb7c20c1ca3d841f5b3d9d8ee925d414bd743e;hb=d5c9c01eef267c6f7d66de3be097f172c70cff11;hp=b59f54192f017c0ebbf0b21139ddb1394edb0e37;hpb=0f937bdb1e47a8af9d4a9fbadbccd40ac3d041b9;p=m17n%2Fm17n-lib-cs.git diff --git a/plist.cs b/plist.cs index b59f541..c7eb7c2 100644 --- a/plist.cs +++ b/plist.cs @@ -1,13 +1,15 @@ using System; +using System.IO; using System.Collections.Generic; +using M17N; using M17N.Core; public class Test { public static void Main() { - MSymbol sym1 = new MSymbol ("sym1"); - MSymbol sym2 = new MSymbol ("sym2"); + MSymbol sym1 = MSymbol.Of ("sym1"); + MSymbol sym2 = MSymbol.Of ("sym2"); MPlist plist = new MPlist (); MText mt1 = new MText ("abc"); MText mt2 = new MText ("ABC"); @@ -19,5 +21,25 @@ public class Test foreach (MPlist p in plist) Console.WriteLine (p.Key + ":" + p.Val); Console.WriteLine (plist.Clone ()); + + M17n.debug = true; + + using (FileStream stream = File.OpenRead ("temp.plist")) + { + Console.WriteLine (new MPlist (stream)); + } + + plist = new MPlist (); + plist.Push (MSymbol.Of ("abc")); + plist.Push (new MText ("abc")); + plist.Push (new MPlist ()); + plist.Push (123); + plist.Push (4.5); + Console.WriteLine (plist); + Console.WriteLine ("plist[3] = " + plist[3]); + + MSymbol tmp = MSymbol.nil; + if (tmp == null) + Console.WriteLine ("null"); } }