Skip to content

Commit

Permalink
sonar linting
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Apr 23, 2024
1 parent 8b673e2 commit 839905c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Tester/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void Main(string[] args)
var model = builder.CompileModel(grammar, "MinimalParser");
if (model.IsOk)
{
var token = model.Value.LexerModel.Tokens[0];
Console.WriteLine("model is OK");
}
else
{
Expand All @@ -62,8 +62,15 @@ public static void Main(string[] args)
File.WriteAllText("c:/temp/date.json",json.Value[0].content);
var tree = JsonConvert.DeserializeObject<JObject>(json.Value[0].content);
var token = tree.SelectToken("$.Children[0].Token");
Console.WriteLine(token);
var dateTime = token.SelectToken("DateTimeValue").Value<DateTime>();
var dateTime = token.SelectToken("Value").Value<string>();
if (dateTime == "2024.04.23")
{
Console.WriteLine("all is fine");
}
else
{
Console.WriteLine($"token is bad {dateTime} - expected 2024.04.23");
}
}

}
Expand Down

0 comments on commit 839905c

Please sign in to comment.