X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=M17N.cs;h=a6f3b2917ec2423593b71b1be8ec50d4f162c9f8;hb=139bdc3719eee81aa203e40f40c612fb799b8ed4;hp=65eabfbf404755cc606170f9f5e663fc6f55e58e;hpb=22add524be98fb1fac4e7be0d68ca8ca7f7d3ca2;p=m17n%2Fm17n-lib-cs.git diff --git a/M17N.cs b/M17N.cs index 65eabfb..a6f3b29 100644 --- a/M17N.cs +++ b/M17N.cs @@ -1,53 +1,21 @@ using System; -using M17N.Core; -public class Test +namespace M17N { - static void symbol_test () + public static class M17n { - MSymbol sym1, sym2; + public const int Version = 0x020101; - Console.WriteLine ("### Symbol test ###"); - sym1 = new MSymbol ("abc"); - Console.WriteLine (sym1.ToString ()); - sym2 = new MSymbol ("abc"); - Console.WriteLine (sym2.ToString ()); - Console.WriteLine (sym1 == sym2 ? "OK" : "NO"); - sym1.put (MSymbol.nil, MSymbol.t); + public static int MajorVersion { get { return (Version >> 16); } } + public static int MinorVersion { get { return ((Version >> 8) & 0xFF); } } + public static int ReleaseNumber { get { return (Version & 0xFF); } } - MPlist p = new MPlist (); + public static bool debug = false; - p.put (MSymbol.t, sym1); - p.push (MSymbol.t, sym2); - - MPlist pp = new MPlist (); - pp.put (MSymbol.t, p); - Console.WriteLine (pp.ToString ()); - Console.WriteLine (p.get (MSymbol.t)); - } - - static void mtext_test () - { - MText mt; - - Console.WriteLine ("### MText test ###"); - mt = new MText ("abc"); - Console.WriteLine (mt); - Console.WriteLine (mt + new MText ("def")); - mt += new MText ("ghi"); - Console.WriteLine (mt); - } - - static void mtext_property_test () - { - Console.WriteLine ("### MTextProperty test ###"); - } - - public static void Main() - { - symbol_test (); - mtext_test (); - mtext_property_test (); + public static void DebugPrint (string fmt, params object[] arg) + { + if (debug) + Console.Write (fmt, arg); + } } - }