Update to version 1.0.0 #3

Merged
Booklordofthedings merged 23 commits from dev into main 2024-08-26 13:33:38 +02:00
4 changed files with 57 additions and 1 deletions
Showing only changes of commit 6d2eab4e44 - Show all commits

View file

@ -3,3 +3,6 @@ Projects = {Bofa = {Path = "."}}
[Workspace]
StartupProject = "Bofa"
[Configs.Test.Win64]
LargeStrings = true

View file

@ -1,5 +1,48 @@
namespace Bofa;
using System;
using System.IO;
using System.Collections;
using Bofa.Parser;
class BofaParser
{
public static Result<void, int64> Parse(StringView pToParse, List<Bofa> pResult)
{
StringStream stream = new .(pToParse, .Reference);
defer delete stream;
return Parse(stream, pResult);
}
public static Result<void, int64> Parse(Stream pToParse, List<Bofa> pResult)
{
if(pToParse == null || pResult == null)
return .Err(-1);
StreamReader reader = new .(pToParse);
defer delete reader;
int64 line = 1;
while(reader.Peek() case .Ok) //This might technically cause an issue when there is data added to the stream while we where busy processing, but if you hook this up to a network stream you deserve this happening to you
{
String l = scope .();
if(reader.ReadLine(l) case .Err)
return .Err(-2);
var entry = ParseLine(l, line);
line++;
}
return .Ok;
}
private static ParserEntry ParseLine(StringView pLine, int64 pLineNumber)
{
StringView line = pLine;
ParserEntry toReturn = .();
uint32 depth;
return .();
}
}

View file

@ -4,7 +4,8 @@ using System;
struct ParserEntry
{
public uint64 Line;
public int64 Line;
public int64 Depth = 0;
public EParserEntryType Type;
public ParserEntryUnion Data;
}

View file

@ -1,5 +1,14 @@
namespace Bofa.Testing;
using System;
using System.IO;
class Default
{
[Test]
public static void Default_Test_1()
{
BofaParser.Parse("Without an ending", scope .()).IgnoreError();
}
}