Namespace change

This commit is contained in:
2025-07-23 00:47:04 -04:00
parent e0c60dc0e1
commit c18ceb18ae
92 changed files with 144 additions and 144 deletions

View File

@@ -36,7 +36,7 @@ Install-Package IronGo
### Basic Parsing
```csharp
using IronGo;
using MarketAlly.IronGo;
// Parse Go source code
var source = @"

View File

@@ -1,7 +1,7 @@
using IronGo;
using IronGo.AST;
using IronGo.Serialization;
using IronGo.Utilities;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Serialization;
using MarketAlly.IronGo.Utilities;
// Example Go source code
const string goSource = @"

View File

@@ -1,6 +1,6 @@
using IronGo;
using IronGo.AST;
using IronGo.Serialization;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Serialization;
using System;
try

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using IronGo;
using IronGo.AST;
using IronGo.Utilities;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Utilities;
namespace QuickStart;
@@ -96,7 +96,7 @@ func main() {
// Export to JSON (compact)
var json = System.Text.Json.JsonSerializer.Serialize(ast, new System.Text.Json.JsonSerializerOptions
{
Converters = { new IronGo.Serialization.AstJsonConverter() }
Converters = { new MarketAlly.IronGo.Serialization.AstJsonConverter() }
});
Console.WriteLine($"JSON representation size: {json.Length:N0} characters");

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a comment in Go source code

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a const declaration block

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a function declaration

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an import declaration

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a package declaration (e.g., "package main")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type declaration (e.g., "type MyType int")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a variable declaration (var or const)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a binary expression

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a function call expression

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a composite literal (e.g., []int{1, 2, 3})

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type conversion expression

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an ellipsis expression (...)

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a function literal (anonymous function)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an identifier expression

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an index expression (e.g., x[i])

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a keyed element in a composite literal (key: value)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a literal expression

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a parenthesized expression

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a selector expression (e.g., x.field)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a slice expression (e.g., x[low:high:max])

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type assertion expression (e.g., x.(T))

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a unary expression

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Base class for all Go AST nodes

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Base interface for all Go AST nodes

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Marker interface for all Go declarations

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Marker interface for all Go expressions

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Marker interface for all Go statements

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Marker interface for all Go types

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a complete Go source file

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an assignment statement (=, :=, +=, etc.)

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a block statement (e.g., { ... })

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a branch statement (break, continue, goto, fallthrough)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a declaration used as a statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a defer statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an empty statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an expression used as a statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a fallthrough statement in a switch case

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a for-range statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a for statement (traditional for loop)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a go statement (goroutine launch)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an if statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an increment or decrement statement (++ or --)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a labeled statement

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a range-based for statement

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a return statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a select statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a send statement (channel &lt;- value)

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a short variable declaration (x := expr)

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a switch statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type switch statement

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an array type (e.g., "[10]int")

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a channel type (e.g., "chan int", "&lt;-chan int", "chan&lt;- int")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a function type (e.g., "func(int, string) error")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type referenced by identifier (e.g., "int", "string", "MyType")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents an interface type

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a map type (e.g., "map[string]int")

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a pointer type (e.g., "*int")

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a slice type (e.g., "[]int")

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a struct type

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a type element in an interface (for type sets)

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a generic type instantiation (e.g., List[int], Map[string, User])

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Represents a union of types in constraints (e.g., int | string | float64)

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Antlr4.Runtime;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Diagnostics;
namespace MarketAlly.IronGo.Diagnostics;
/// <summary>
/// Collects diagnostic information during parsing

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Diagnostics;
namespace MarketAlly.IronGo.Diagnostics;
/// <summary>
/// Represents diagnostic information about the parsed source

View File

@@ -45,7 +45,7 @@
<ItemGroup>
<Antlr4 Include="Parser\*.g4">
<Package>IronGo.Parser</Package>
<Package>MarketAlly.IronGo.Parser</Package>
</Antlr4>
</ItemGroup>

View File

@@ -2,12 +2,12 @@ using System;
using System.IO;
using System.Text;
using Antlr4.Runtime;
using IronGo.AST;
using IronGo.Parser;
using IronGo.Performance;
using IronGo.Diagnostics;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Parser;
using MarketAlly.IronGo.Performance;
using MarketAlly.IronGo.Diagnostics;
namespace IronGo;
namespace MarketAlly.IronGo;
/// <summary>
/// Main entry point for parsing Go source code

View File

@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Parser;
namespace MarketAlly.IronGo.Parser;
/// <summary>
/// Builds an IronGo AST from an ANTLR parse tree

View File

@@ -1,7 +1,7 @@
using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
namespace IronGo.Parser;
namespace MarketAlly.IronGo.Parser;
public abstract class GoParserBase : Antlr4.Runtime.Parser
{

View File

@@ -3,9 +3,9 @@ using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Performance;
namespace MarketAlly.IronGo.Performance;
/// <summary>
/// Caches parsed AST results to improve performance for repeated parsing

View File

@@ -1,9 +1,9 @@
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Serialization;
namespace MarketAlly.IronGo.Serialization;
/// <summary>
/// Custom JSON converter for Go AST nodes

View File

@@ -2,9 +2,9 @@ using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Serialization;
namespace MarketAlly.IronGo.Serialization;
/// <summary>
/// Extension methods for JSON serialization of AST nodes

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Utilities;
namespace MarketAlly.IronGo.Utilities;
/// <summary>
/// Provides deep cloning functionality for AST nodes

View File

@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Utilities;
namespace MarketAlly.IronGo.Utilities;
/// <summary>
/// Utility methods for working with Go AST

View File

@@ -1,6 +1,6 @@
using IronGo.AST;
using MarketAlly.IronGo.AST;
namespace IronGo.Utilities;
namespace MarketAlly.IronGo.Utilities;
/// <summary>
/// Base class that provides a universal node checking mechanism for all visitor methods

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Base implementation of visitor pattern that does nothing by default

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// A visitor that walks the entire AST tree, visiting all nodes

View File

@@ -1,4 +1,4 @@
namespace IronGo.AST;
namespace MarketAlly.IronGo.AST;
/// <summary>
/// Visitor interface for traversing Go AST nodes without returning a value

View File

@@ -1,7 +1,7 @@
using IronGo;
using IronGo.AST;
using IronGo.Serialization;
using IronGo.Utilities;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Serialization;
using MarketAlly.IronGo.Utilities;
using System.Text.Json;
const string goCode = @"
@@ -88,7 +88,7 @@ try
Console.WriteLine($" Second parse: {secondTime:F2}ms (cache hit)");
Console.WriteLine($" Speedup: {firstTime/secondTime:F1}x");
var cacheStats = IronGo.Performance.ParserCache.Default.GetStatistics();
var cacheStats = MarketAlly.IronGo.Performance.ParserCache.Default.GetStatistics();
Console.WriteLine($" Cache entries: {cacheStats.EntryCount}");
Console.WriteLine($" Cache hit rate: {cacheStats.HitRate:F2}");

View File

@@ -1,10 +1,10 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using IronGo.Diagnostics;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Diagnostics;
using Xunit;
namespace IronGo.Tests.DiagnosticsTests;
namespace MarketAlly.IronGo.Tests.DiagnosticsTests;
public class DiagnosticsTests
{

View File

@@ -1,13 +1,13 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using IronGo.Serialization;
using IronGo.Utilities;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Serialization;
using MarketAlly.IronGo.Utilities;
using System.IO;
using System.Linq;
using Xunit;
namespace IronGo.Tests.IntegrationTests;
namespace MarketAlly.IronGo.Tests.IntegrationTests;
public class RealGoCodeTests
{

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using Xunit;
namespace IronGo.Tests.ParserTests;
namespace MarketAlly.IronGo.Tests.ParserTests;
public class BasicParsingTests
{

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using Xunit;
namespace IronGo.Tests.ParserTests;
namespace MarketAlly.IronGo.Tests.ParserTests;
public class ExpressionParsingTests
{

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using Xunit;
namespace IronGo.Tests.ParserTests;
namespace MarketAlly.IronGo.Tests.ParserTests;
public class StatementParsingTests
{

View File

@@ -1,9 +1,9 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using Xunit;
namespace IronGo.Tests.ParserTests;
namespace MarketAlly.IronGo.Tests.ParserTests;
public class TypeParsingTests
{

View File

@@ -1,12 +1,12 @@
using FluentAssertions;
using IronGo;
using IronGo.Performance;
using MarketAlly.IronGo;
using MarketAlly.IronGo.Performance;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Xunit;
namespace IronGo.Tests.PerformanceTests;
namespace MarketAlly.IronGo.Tests.PerformanceTests;
public class CachingTests
{
@@ -116,8 +116,8 @@ func concurrent() {
ast1.Should().NotBeSameAs(ast2);
ast1.Should().BeSameAs(ast1Again);
ast1.Declarations[0].As<IronGo.AST.FunctionDeclaration>().Name.Should().Be("one");
ast2.Declarations[0].As<IronGo.AST.FunctionDeclaration>().Name.Should().Be("two");
ast1.Declarations[0].As<MarketAlly.IronGo.AST.FunctionDeclaration>().Name.Should().Be("one");
ast2.Declarations[0].As<MarketAlly.IronGo.AST.FunctionDeclaration>().Name.Should().Be("two");
}
[Fact]

View File

@@ -1,11 +1,11 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using IronGo.Serialization;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Serialization;
using System.Text.Json;
using Xunit;
namespace IronGo.Tests.SerializationTests;
namespace MarketAlly.IronGo.Tests.SerializationTests;
public class JsonSerializationTests
{

View File

@@ -1,11 +1,11 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using IronGo.Utilities;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using MarketAlly.IronGo.Utilities;
using System.Linq;
using Xunit;
namespace IronGo.Tests.UtilityTests;
namespace MarketAlly.IronGo.Tests.UtilityTests;
public class AstUtilityTests
{

View File

@@ -1,10 +1,10 @@
using FluentAssertions;
using IronGo;
using IronGo.AST;
using MarketAlly.IronGo;
using MarketAlly.IronGo.AST;
using System.Collections.Generic;
using Xunit;
namespace IronGo.Tests.VisitorTests;
namespace MarketAlly.IronGo.Tests.VisitorTests;
public class AstVisitorTests
{