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:
Jordan Wages 2025-08-20 20:10:34 -05:00
commit 0a67e6e2cc
24 changed files with 54 additions and 49 deletions

View file

@ -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')" />

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace csmic
namespace CsMic
{
public class FunctionArgument
{

View file

@ -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
{

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace csmic
namespace CsMic
{
public enum FunctionValueType
{

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace csmic
namespace CsMic
{
public interface ICodedFunction
{

View file

@ -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
};

View file

@ -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>

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cs_mic.core
namespace CsMic
{
public class Variable
{

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cs_mic.core
namespace CsMic
{
public enum VariableType
{

View file

@ -2,7 +2,7 @@
using System.Globalization;
using System.Text;
using System.Collections.Generic;
using csmic;
using CsMic;
COMPILER INTERPRETER

View file

@ -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

View file

@ -1,4 +1,6 @@
namespace csmic.stdlib
using CsMic;
namespace CsMic.StandardLibrary
{
public static class Constants
{

View file

@ -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>

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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
{

View file

@ -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>

View file

@ -1,7 +1,7 @@
using System.Globalization;
using csmic;
using CsMic;
namespace tests;
namespace CsMic.Tests;
public class InputInterpreterTests
{

View file

@ -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
{