Adopt .NET naming and structure: CsMic.* namespaces, PascalCase projects and solution; update Coco namespace; update package id and NuGet publish target; adjust project refs and tests.
This commit is contained in:
parent
e84cce9fef
commit
0a67e6e2cc
24 changed files with 54 additions and 49 deletions
|
@ -2,16 +2,17 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>cs_mic.core</RootNamespace>
|
||||
<RootNamespace>CsMic</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<AssemblyName>CsMic.Core</AssemblyName>
|
||||
<Version>2.0.0-beta-01</Version>
|
||||
<PackageId>cs-mic</PackageId>
|
||||
<PackageId>CsMic</PackageId>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="dotnet tool run coco -namespace csmic.Interpreter -frames $(ProjectDir)cocor $(ProjectDir)cocor/Interpreter.atg" />
|
||||
<Exec Command="dotnet tool run coco -namespace CsMic.Interpreter -frames $(ProjectDir)cocor $(ProjectDir)cocor/Interpreter.atg" />
|
||||
</Target>
|
||||
|
||||
<Import Project="NuGetPublish.targets" Condition="Exists('NuGetPublish.targets')" />
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace csmic
|
||||
namespace CsMic
|
||||
{
|
||||
public class FunctionArgument
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
using csmic;
|
||||
using CsMic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace csmic
|
||||
namespace CsMic
|
||||
{
|
||||
public class FunctionValue
|
||||
{
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace csmic
|
||||
namespace CsMic
|
||||
{
|
||||
public enum FunctionValueType
|
||||
{
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace csmic
|
||||
namespace CsMic
|
||||
{
|
||||
public interface ICodedFunction
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace csmic
|
||||
namespace CsMic
|
||||
{
|
||||
public class InputInterpreter
|
||||
{
|
||||
|
@ -122,8 +122,8 @@ namespace csmic
|
|||
// Create a child interpreter sharing stores, so ProduceOutput doesn't affect parent state
|
||||
var child = new InputInterpreter(this);
|
||||
using var ms = new MemoryStream(Encoding.UTF8.GetBytes(expressionText));
|
||||
var scanner = new csmic.Interpreter.Scanner(ms);
|
||||
var parser = new csmic.Interpreter.Parser(scanner)
|
||||
var scanner = new CsMic.Interpreter.Scanner(ms);
|
||||
var parser = new CsMic.Interpreter.Parser(scanner)
|
||||
{
|
||||
Interpreter = child
|
||||
};
|
||||
|
@ -138,8 +138,8 @@ namespace csmic
|
|||
try
|
||||
{
|
||||
using var ms = new MemoryStream(Encoding.UTF8.GetBytes(input ?? string.Empty));
|
||||
var scanner = new csmic.Interpreter.Scanner(ms);
|
||||
var parser = new csmic.Interpreter.Parser(scanner)
|
||||
var scanner = new CsMic.Interpreter.Scanner(ms);
|
||||
var parser = new CsMic.Interpreter.Parser(scanner)
|
||||
{
|
||||
Interpreter = this
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- Placeholder target file for NuGet publishing -->
|
||||
<Target Name="PublishNuGet" AfterTargets="Pack">
|
||||
<Exec Command="dotnet nuget push --source wagenet-git bin\Release\cs-mic.$(Version).nupkg" />
|
||||
<Exec Command="dotnet nuget push --source wagenet-git bin\Release\CsMic.$(Version).nupkg" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace cs_mic.core
|
||||
namespace CsMic
|
||||
{
|
||||
public class Variable
|
||||
{
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace cs_mic.core
|
||||
namespace CsMic
|
||||
{
|
||||
public enum VariableType
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using csmic;
|
||||
using CsMic;
|
||||
|
||||
COMPILER INTERPRETER
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35707.178
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "core", "core\core.csproj", "{5387FF55-3044-4EB4-BB90-AD2E922131C1}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsMic.Core", "Core\CsMic.Core.csproj", "{5387FF55-3044-4EB4-BB90-AD2E922131C1}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6394EDF0-24F7-4B75-B4CE-E5F884EE88AC}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
setup.ps1 = setup.ps1
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsMic.Tests", "Tests\CsMic.Tests.csproj", "{F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stdlib", "stdlib\stdlib.csproj", "{F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsMic.StandardLibrary", "StandardLibrary\CsMic.StandardLibrary.csproj", "{F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
@ -1,4 +1,6 @@
|
|||
namespace csmic.stdlib
|
||||
using CsMic;
|
||||
|
||||
namespace CsMic.StandardLibrary
|
||||
{
|
||||
public static class Constants
|
||||
{
|
|
@ -2,12 +2,14 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>CsMic.StandardLibrary</RootNamespace>
|
||||
<AssemblyName>CsMic.StandardLibrary</AssemblyName>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\core\core.csproj" />
|
||||
<ProjectReference Include="..\Core\CsMic.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
|
@ -1,12 +1,12 @@
|
|||
using csmic;
|
||||
using stdlib.functions;
|
||||
using CsMic;
|
||||
using CsMic.StandardLibrary.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stdlib
|
||||
namespace CsMic.StandardLibrary
|
||||
{
|
||||
public static class Functions
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using csmic;
|
||||
using FunctionValueType = csmic.FunctionValueType;
|
||||
using CsMic;
|
||||
using FunctionValueType = CsMic.FunctionValueType;
|
||||
|
||||
namespace stdlib.functions
|
||||
namespace CsMic.StandardLibrary.Functions
|
||||
{
|
||||
public class AbsoluteValue : FunctionBase, ICodedFunction
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using csmic;
|
||||
using FunctionValueType = csmic.FunctionValueType;
|
||||
using CsMic;
|
||||
using FunctionValueType = CsMic.FunctionValueType;
|
||||
|
||||
namespace stdlib.functions
|
||||
namespace CsMic.StandardLibrary.Functions
|
||||
{
|
||||
public abstract class FunctionBase
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
using csmic;
|
||||
using CsMic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stdlib.functions
|
||||
namespace CsMic.StandardLibrary.Functions
|
||||
{
|
||||
public class Max : FunctionBase, ICodedFunction
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
using csmic;
|
||||
using CsMic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stdlib.functions
|
||||
namespace CsMic.StandardLibrary.Functions
|
||||
{
|
||||
public class Min : FunctionBase, ICodedFunction
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using csmic;
|
||||
using FunctionValueType = csmic.FunctionValueType;
|
||||
using CsMic;
|
||||
using FunctionValueType = CsMic.FunctionValueType;
|
||||
|
||||
namespace stdlib.functions
|
||||
namespace CsMic.StandardLibrary.Functions
|
||||
{
|
||||
public class Sign : FunctionBase, ICodedFunction
|
||||
{
|
|
@ -6,6 +6,8 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
<RootNamespace>CsMic.Tests</RootNamespace>
|
||||
<AssemblyName>CsMic.Tests</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -17,8 +19,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\core\core.csproj" />
|
||||
<ProjectReference Include="..\stdlib\stdlib.csproj" />
|
||||
<ProjectReference Include="..\Core\CsMic.Core.csproj" />
|
||||
<ProjectReference Include="..\StandardLibrary\CsMic.StandardLibrary.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
|
@ -1,7 +1,7 @@
|
|||
using System.Globalization;
|
||||
using csmic;
|
||||
using CsMic;
|
||||
|
||||
namespace tests;
|
||||
namespace CsMic.Tests;
|
||||
|
||||
public class InputInterpreterTests
|
||||
{
|
|
@ -1,12 +1,11 @@
|
|||
using csmic;
|
||||
using csmic.stdlib;
|
||||
using CsMic;
|
||||
using CsMic.StandardLibrary;
|
||||
using NUnit.Framework;
|
||||
using stdlib;
|
||||
using stdlib.functions;
|
||||
using CsMic.StandardLibrary.Functions;
|
||||
using System.Globalization;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace tests;
|
||||
namespace CsMic.Tests;
|
||||
|
||||
public class StdlibFunctionsTests
|
||||
{
|
Loading…
Add table
Add a link
Reference in a new issue