11 Commits

Author SHA1 Message Date
b4d55ddfc0 release: version 0.11.2 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 37s
SonarQube Scan / SonarQube Trigger (push) Failing after 1m8s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 2m7s
Upload Python Package / deploy (push) Failing after 1m42s
2025-10-26 21:02:58 +01:00
f51aad91fa fix: even more debug output during releases, refs NOISSUE 2025-10-26 21:02:55 +01:00
cab7ac35ae release: version 0.11.1 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 14s
SonarQube Scan / SonarQube Trigger (push) Failing after 1m18s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 2m1s
Upload Python Package / deploy (push) Failing after 2m3s
2025-10-26 20:58:57 +01:00
86bb120e32 fix: more debug output during releases, refs NOISSUE 2025-10-26 20:58:53 +01:00
c728509978 ci: reenable one of the NuGet sources, refs NOISSUE
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1m4s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m19s
2025-10-26 20:41:37 +01:00
7bd2429a43 release: version 0.11.0 🚀
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 49s
Upload Python Package / Create Release (push) Successful in 28s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m24s
Upload Python Package / deploy (push) Failing after 4m44s
2025-10-26 20:31:48 +01:00
d41d9f1791 Revert "feat: add two dimensional data walker, refs: NOISSUE"
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 28s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Successful in 1m16s
This reverts commit 414c74be84.
2025-10-26 19:16:29 +01:00
1a8a82c106 ci: disable nuget feeds for now, refs NOISSUE
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 34s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Failing after 1m11s
2025-10-26 19:12:13 +01:00
414c74be84 feat: add two dimensional data walker, refs: NOISSUE
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 25s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Failing after 4m2s
2025-10-26 19:07:37 +01:00
f8c00da2b8 release: version 0.10.0 🚀
Some checks failed
Upload Python Package / Create Release (push) Successful in 1m6s
Upload Python Package / deploy (push) Failing after 7m37s
2024-12-13 16:04:23 +01:00
d4ac62c592 feat: add support for custom token types and longs, ref: NOISSUE 2024-12-13 16:04:19 +01:00
13 changed files with 225 additions and 8 deletions

View File

@@ -59,10 +59,14 @@ jobs:
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_')
REPOSITORY_SOURCE_NAME=gitea-repo
if [ -z "$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json")" ]; then
echo "source repo not configured yet"
dotnet nuget add source --name $REPOSITORY_SOURCE_NAME https://git.disi.dev/api/packages/$REPOSITORY_OWNER/nuget/index.json
else
echo "Picking correct source repo"
QUOTED_REPOSITORY_SOURCE_NAME=$(dotnet nuget config get all | grep "/packages/${REPOSITORY_OWNER}/nuget/index.json" | awk '{print $2}' | awk -F= '{print $2}')
REPOSITORY_SOURCE_NAME=${QUOTED_REPOSITORY_SOURCE_NAME:1:-1}
echo "chosen repo is $REPOSITORY_SOURCE_NAME"
fi
dotnet pack --include-symbols --include-source -p:PackageVersion=$(cat $REPOSITORY_NAME/VERSION) TextParser.sln
echo "dotnet nuget push -k <GITEA_PAT> --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg"
dotnet nuget push -k $GITEA_PAT --source $REPOSITORY_SOURCE_NAME $REPOSITORY_NAME/bin/Release/$REPOSITORY_NAME.$(cat $REPOSITORY_NAME/VERSION).symbols.nupkg

View File

@@ -5,11 +5,53 @@ Changelog
(unreleased)
------------
Fix
~~~
- Even more debug output during releases, refs NOISSUE. [Simon
Diesenreiter]
0.11.1 (2025-10-26)
-------------------
Fix
~~~
- More debug output during releases, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
- Ci: reenable one of the NuGet sources, refs NOISSUE. [Simon
Diesenreiter]
0.11.0 (2025-10-26)
-------------------
- Revert "feat: add two dimensional data walker, refs: NOISSUE" [Simon
Diesenreiter]
This reverts commit 414c74be84aecd3aff2f7abbb6cab88f50034d84.
- Ci: disable nuget feeds for now, refs NOISSUE. [Simon Diesenreiter]
- Feat: add two dimensional data walker, refs: NOISSUE. [Simon
Diesenreiter]
0.10.0 (2024-12-13)
-------------------
- Feat: add support for custom token types and longs, ref: NOISSUE.
[Simon Diesenreiter]
0.9.3 (2024-12-13)
------------------
Fix
~~~
- Remove duplicate TokenConverter definition, ref: NOISSUE. [Simon
Diesenreiter]
Other
~~~~~
0.9.2 (2024-12-13)
------------------

View File

@@ -13,7 +13,7 @@ public class TokenConverter
{
}
private List<T> AsGenericCollection<T, U>() where T : ICollection<U>, new()
private List<T> AsGenericCollection<T, U>() where T : List<U>, new()
{
List<T> returnData = new List<T>();
foreach (var tokenRow in this.rawTokens)
@@ -25,11 +25,15 @@ public class TokenConverter
{
throw new Exception("No token was provided, but token was expected!");
}
IValueToken<U>? valueToken = token as IValueToken<U>;
if (valueToken == null)
if (!token.GetType().IsAssignableTo(typeof(IValueToken<U>)))
{
throw new Exception("Provided token is not a ValueToken");
Console.WriteLine(token.GetText());
Type t = token.GetType();
throw new Exception("Provided token is not a ValueToken - type: " + t.ToString());
}
IValueToken<U> valueToken = token as IValueToken<U>;
newRow.Add(valueToken.GetValue());
}
@@ -161,7 +165,7 @@ public class TokenConverter
{
var newTokenListList = new List<List<IToken>>();
foreach(var tokenList in rawTokens)
foreach(var tokenList in this.rawTokens)
{
var newTokenList = new List<IToken>();
foreach(var token in tokenList)

View File

@@ -11,4 +11,6 @@ public enum BlockType
FixedRepetition = 16,
GreedyRepetition = 32,
NonZeroRepetition = 64,
Custom = 128,
Long = 256,
}

View File

@@ -0,0 +1,42 @@
namespace Parsing.Schema.BuildingBlocks;
using Parsing.Tokenization;
class CustomInputBlock<T> : BuildingBlockBase
{
private InputType definedInputType;
private Func<string, T> wordConverter;
public CustomInputBlock(InputType definedInputType, Func<string, T> wordConverter)
{
this.definedInputType = definedInputType;
this.wordConverter = wordConverter;
}
public override List<IToken> ParseWord(InputProvider inputs)
{
return new List<IToken>() { new CustomToken<T>(inputs.YieldWord(), this.definedInputType, this.wordConverter) };
}
public override bool CanParseWord(InputProvider inputs)
{
string word = string.Empty;
using (inputs.GetLookaheadContext())
{
word = inputs.YieldWord();
}
return this.CanParseWord(word);
}
public override bool CanParseWord(string word)
{
return true;
}
public override BlockType GetBlockType()
{
return BlockType.Custom;
}
}

View File

@@ -0,0 +1,35 @@
namespace Parsing.Schema.BuildingBlocks;
using Parsing.Tokenization;
class LongBlock : BuildingBlockBase
{
public LongBlock()
{
}
public override List<IToken> ParseWord(InputProvider inputs)
{
return new List<IToken>() { new LongToken(inputs.YieldWord()) };
}
public override bool CanParseWord(InputProvider inputs)
{
using (inputs.GetLookaheadContext())
{
return this.CanParseWord(inputs.YieldWord());
}
}
public override bool CanParseWord(string word)
{
long number = 0;
return long.TryParse(word, out number);
}
public override BlockType GetBlockType()
{
return BlockType.Long;
}
}

View File

@@ -28,6 +28,12 @@ class StringBlock : BuildingBlockBase
public override bool CanParseWord(string word)
{
// Here we need to ensure we are not matching any non-string tokens, since string can match pretty much anything
LongBlock longBlock = new LongBlock();
if (longBlock.CanParseWord(word))
{
return false;
}
IntegerBlock intBlock = new IntegerBlock();
if (intBlock.CanParseWord(word))
{

View File

@@ -21,6 +21,9 @@ public class InputSchemaBuilder : RepetitionSchemaBuilder<InputSchemaBuilder, In
case InputType.Integer:
block = new IntegerBlock();
break;
case InputType.Long:
block = new LongBlock();
break;
case InputType.Char:
block = new CharBlock();
break;
@@ -31,6 +34,21 @@ public class InputSchemaBuilder : RepetitionSchemaBuilder<InputSchemaBuilder, In
return this;
}
public InputSchemaBuilder Expect<T>(InputType type, InputType definedInputType, Func<string, T> wordConverter)
{
IBuildingBlock block;
switch (type)
{
case InputType.Custom:
block = new CustomInputBlock<T>(definedInputType, wordConverter);
break;
default:
throw new Exception("Unrecognized InputType");
}
schema.AddBuildingBlock(block);
return this;
}
public InputSchemaBuilder Repeat(int repetitionCount)
{
// add another layer of parsing

View File

@@ -7,4 +7,6 @@ public enum InputType
String = BlockType.String,
Fragment = BlockType.Fragment,
Char = BlockType.Char,
Custom = BlockType.Custom,
Long = BlockType.Long,
}

View File

@@ -0,0 +1,34 @@
namespace Parsing.Tokenization;
using Parsing.Schema;
public class CustomToken<T> : IValueToken<T>
{
private string word;
private InputType definedInputType;
private Func<string, T> wordConverter;
public CustomToken(string word, InputType definedInputType, Func<string, T> wordConverter)
{
this.word = word;
this.wordConverter = wordConverter;
this.definedInputType = definedInputType;
}
public string GetText()
{
return word;
}
public T GetValue()
{
return wordConverter(word);
}
public InputType GetInputType()
{
return this.definedInputType;
}
}

View File

@@ -0,0 +1,28 @@
namespace Parsing.Tokenization;
using Parsing.Schema;
public class LongToken : IValueToken<long>
{
private string word;
public LongToken(string word)
{
this.word = word;
}
public string GetText()
{
return word;
}
public long GetValue()
{
return long.Parse(word);
}
public InputType GetInputType()
{
return InputType.Long;
}
}

View File

@@ -1 +1 @@
0.9.3
0.11.2

View File

@@ -5,7 +5,7 @@
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="gitea-projects" value="https://git.disi.dev/api/packages/Projects/nuget/index.json" />
<add key="gitea-homelab" value="https://git.disi.dev/api/packages/Homelab/nuget/index.json" />
<add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" />
<!--add key="gitea-homelab" value="https://git.disi.dev/api/packages/Homelab/nuget/index.json" />
<add key="gitea-artifacts" value="https://git.disi.dev/api/packages/Artifacts/nuget/index.json" /-->
</packageSources>
</configuration>