fix a few issues, reset to net8 once again because everything is major fucked
This commit is contained in:
parent
2b850168f1
commit
3d5736aaa3
|
|
@ -2,6 +2,8 @@ Debug/
|
|||
Release/
|
||||
Build/
|
||||
bin/
|
||||
*/bin/
|
||||
*/bin/*
|
||||
obj/
|
||||
log/
|
||||
lib/
|
||||
|
|
|
|||
|
|
@ -1,41 +1,7 @@
|
|||
|
||||
using Qrakhen.Qamp.Core;
|
||||
using Qrakhen.Qamp.Core;
|
||||
using Qrakhen.Qamp.Core.Execution;
|
||||
using Qrakhen.Qamp.Core.Logging;
|
||||
using System.Diagnostics;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
/*
|
||||
// do args here too, keep console, etc. output with exit, all the spicy things
|
||||
// if no file is given for example in args just keep cli live until quit
|
||||
|
||||
void Init(string[] args)
|
||||
{
|
||||
Console.WriteLine(string.Join(',', args));
|
||||
string command = args.Length > 1 ? args[0] : args.Length == 1 ? "run" : "cli";
|
||||
string target = args.Length > 1 ? args[1] : args.Length == 1 ? args[0] : "";
|
||||
switch (command) {
|
||||
case "run":
|
||||
// check wheter .sqi or .sqr file
|
||||
break;
|
||||
case "cli":
|
||||
|
||||
break;
|
||||
case "read":
|
||||
|
||||
break;
|
||||
case "digest":
|
||||
|
||||
break;
|
||||
case "help":
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Init(args);
|
||||
*/
|
||||
|
||||
|
||||
List<char> Ignored = [ '\0', '\b' ];
|
||||
LoggerService.Default = LogLevel.Error;
|
||||
|
|
@ -130,6 +96,8 @@ do {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
if (e.InnerException != null)
|
||||
Console.WriteLine($" !? {e.InnerException.Message}");
|
||||
Console.WriteLine($" !? {e.Message}");
|
||||
if (e.StackTrace != null) {
|
||||
Console.Write($" ! ");
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ public class DefaultDialect : Dialect
|
|||
Define(ContextClose, "}");
|
||||
Define(ArrayOpen, "[");
|
||||
Define(ArrayClose, "]");
|
||||
Define(AddItem, "<+");
|
||||
Define(RemoveItem, "->");
|
||||
Define(Comma, ",");
|
||||
Define(Dot, ".");
|
||||
Define(Colon, ":");
|
||||
|
|
@ -93,9 +91,10 @@ public class ClassicDialect : DefaultDialect
|
|||
public ClassicDialect()
|
||||
{
|
||||
Define(Null, "_");
|
||||
Define(AddItem, "<+");
|
||||
Define(RemoveItem, "->");
|
||||
Define(PlusEqual, "<+");
|
||||
Define(MinusEqual, "<-");
|
||||
Define(Equal, "<~");
|
||||
Define(Ref, "&");
|
||||
Define(This, ".~");
|
||||
Define(Var, "*~");
|
||||
Define(Return, "<:");
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ public class ExtensionMethod(
|
|||
|
||||
var parameterExpressions = new Expression[parameterInfos.Length - 1];
|
||||
|
||||
for (int i = 0; i < parameterInfos.Length; i++) {
|
||||
for (int i = 0; i < parameterExpressions.Length; i++) {
|
||||
ConstantExpression index = Expression.Constant(i);
|
||||
BinaryExpression indexExpression = Expression.ArrayIndex(argsParameter, index);
|
||||
|
||||
|
|
@ -166,10 +166,9 @@ public class ExtensionMethod(
|
|||
final = callExpression;
|
||||
}
|
||||
|
||||
LambdaExpression lambda = Expression.Lambda(final, selfParameter, argsParameter);
|
||||
|
||||
var lambda = Expression.Lambda<ExtensionDelegate>(final, selfParameter, argsParameter);
|
||||
_logger.Verbose($"Done: ", lambda);
|
||||
return (ExtensionDelegate)lambda.Compile();
|
||||
return lambda.Compile();
|
||||
}
|
||||
|
||||
public static IEnumerable<ExtensionMethod> CompileExtensionsFromType(Type type)
|
||||
|
|
@ -213,31 +212,33 @@ public class ExtensionMethod(
|
|||
public static class StringExtensions
|
||||
{
|
||||
[ExtensionMethod]
|
||||
public static long Length(Objects.String self)
|
||||
public static long Length(Value self) // make this possible with Objects.String and auto-detection
|
||||
{
|
||||
return self.Value?.Length ?? 0;
|
||||
return self.Ptr.As<Objects.String>()?.Value?.Length ?? 0;
|
||||
}
|
||||
|
||||
[ExtensionMethod]
|
||||
public static long IndexOf(Objects.String self, Objects.String needle)
|
||||
public static long IndexOf(Value self, Value needle)
|
||||
{
|
||||
if (needle.Value is null)
|
||||
string _self = self.Ptr.As<Objects.String>()?.Value ?? "";
|
||||
string _needle = self.Ptr.As<Objects.String>()?.Value ?? "";
|
||||
if (_needle.Length < 1 || _self.Length < 1)
|
||||
return -1;
|
||||
|
||||
return self.Value?.IndexOf(needle.Value) ?? -1;
|
||||
return _self.IndexOf(_needle);
|
||||
}
|
||||
|
||||
[ExtensionMethod]
|
||||
public static Objects.Array Split(Objects.String self, Objects.String splitter)
|
||||
public static Objects.Array Split(Value self, Value splitter)
|
||||
{
|
||||
string? _splitter = splitter.Value;
|
||||
string? _string = self.Value;
|
||||
string? _splitter = splitter.Ptr.As<Objects.String>()?.Value;
|
||||
string? _string = self.Ptr.As<Objects.String>()?.Value;
|
||||
|
||||
if (_string is null)
|
||||
return new Objects.Array([]);
|
||||
|
||||
if (_splitter is null)
|
||||
return new Objects.Array([ Obj.Create(self) ]);
|
||||
return new Objects.Array([ self ]);
|
||||
|
||||
string[] parts = _string.Split(_splitter);
|
||||
Value[] values = new Value[parts.Length];
|
||||
|
|
@ -247,3 +248,13 @@ public static class StringExtensions
|
|||
return new Objects.Array(values);
|
||||
}
|
||||
}
|
||||
|
||||
[ExtensionClass(ValueType = ValueType.Array)]
|
||||
public static class ArrayExtensions
|
||||
{
|
||||
[ExtensionMethod]
|
||||
public static long Length(Objects.Array self)
|
||||
{
|
||||
return self.Data.LongLength;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>..\Build\</BaseOutputPath>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
|
|
|||
Loading…
Reference in New Issue