ln.json/json.test/Program.cs

44 lines
864 B
C#
Raw Normal View History

2017-10-26 16:41:14 +02:00
using System;
using System.IO;
using sharp.json;
2017-11-03 13:13:09 +01:00
using sharp.parser;
2017-10-26 16:41:14 +02:00
namespace json.test
{
class MainClass
{
static string[] sources = {
"\"I am a string\"",
"{ \"me\" : \"is a string too\"}",
"[ \"this\", \"is\", \"an\", \"array\" ]"
};
public static void Main(string[] args)
{
2017-11-23 13:05:58 +01:00
2017-10-26 16:41:14 +02:00
JSON json;
2017-11-03 13:13:09 +01:00
JSONParser jsonparser = new JSONParser();
2017-10-26 16:41:14 +02:00
2017-11-23 13:05:58 +01:00
json = jsonparser.Parse("4.9125E-05");
Console.WriteLine(json.ToString());
//Console.WriteLine("JSON test Patterns:");
//Console.WriteLine();
2017-10-26 16:41:14 +02:00
2017-11-23 13:05:58 +01:00
//foreach (string src in sources){
// json = jsonparser.Parse(src);
// Console.WriteLine("NEW PARSER: {0}",json.ToString());
//}
2017-10-26 16:41:14 +02:00
2017-11-23 13:05:58 +01:00
//json = jsonparser.Parse(File.ReadAllText("test.json"));
//Console.WriteLine("");
//Console.WriteLine("test.json file:");
//Console.WriteLine("PARSED: {0}",json.ToString());
2017-10-26 16:41:14 +02:00
}
}
}