API methods reimplemented for DTLib.Web

This commit is contained in:
2025-03-23 02:49:02 +05:00
parent e3b82d7de5
commit 5d88ad49c0
7 changed files with 79 additions and 91 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ namespace ParadoxSaveParser.Lib;
///
/// Console.Write($"| {cur.Value} |");
///
/// for (var next = cur.Next; next != null; next = next.Next)
/// for (var next = cur.Next; next is not null; next = next.Next)
/// Console.Write($" {next.Value}");
/// Console.WriteLine();
/// }
@@ -64,8 +64,8 @@ public class BufferedEnumerator<T> : IEnumerator<LinkedListNode<T>>
return false;
_currentNodeIndex++;
_currentNode = _currentNode == null ? _llist.First : _currentNode.Next;
return _currentNode != null;
_currentNode = _currentNode is null ? _llist.First : _currentNode.Next;
return _currentNode is not null;
}
public void Reset()
+3 -3
View File
@@ -1,7 +1,7 @@
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Text;
global using System.Collections.Generic;
namespace ParadoxSaveParser.Lib;
@@ -217,7 +217,7 @@ public class Parser
if(!_tokens.MoveNext())
throw new Exception("Unexpected end of file");
object? value = ParseValue();
if (value == null)
if (value is null)
break;
list.Add(value);
}
@@ -277,7 +277,7 @@ public class Parser
throw new UnexpectedTokenException(tok);
object? value = ParseValue();
if (value == null)
if (value is null)
throw new UnexpectedTokenException(_tokens.Current.Value);
if(!dict.TryGetValue(key, out List<object>? list))