Namespace change
This commit is contained in:
@@ -36,7 +36,7 @@ Install-Package IronGo
|
|||||||
### Basic Parsing
|
### Basic Parsing
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
|
|
||||||
// Parse Go source code
|
// Parse Go source code
|
||||||
var source = @"
|
var source = @"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Serialization;
|
using MarketAlly.IronGo.Serialization;
|
||||||
using IronGo.Utilities;
|
using MarketAlly.IronGo.Utilities;
|
||||||
|
|
||||||
// Example Go source code
|
// Example Go source code
|
||||||
const string goSource = @"
|
const string goSource = @"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Serialization;
|
using MarketAlly.IronGo.Serialization;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Utilities;
|
using MarketAlly.IronGo.Utilities;
|
||||||
|
|
||||||
namespace QuickStart;
|
namespace QuickStart;
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ func main() {
|
|||||||
// Export to JSON (compact)
|
// Export to JSON (compact)
|
||||||
var json = System.Text.Json.JsonSerializer.Serialize(ast, new System.Text.Json.JsonSerializerOptions
|
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");
|
Console.WriteLine($"JSON representation size: {json.Length:N0} characters");
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a comment in Go source code
|
/// Represents a comment in Go source code
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a const declaration block
|
/// Represents a const declaration block
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a function declaration
|
/// Represents a function declaration
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an import declaration
|
/// Represents an import declaration
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a package declaration (e.g., "package main")
|
/// Represents a package declaration (e.g., "package main")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type declaration (e.g., "type MyType int")
|
/// Represents a type declaration (e.g., "type MyType int")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a variable declaration (var or const)
|
/// Represents a variable declaration (var or const)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a binary expression
|
/// Represents a binary expression
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a function call expression
|
/// Represents a function call expression
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a composite literal (e.g., []int{1, 2, 3})
|
/// Represents a composite literal (e.g., []int{1, 2, 3})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type conversion expression
|
/// Represents a type conversion expression
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an ellipsis expression (...)
|
/// Represents an ellipsis expression (...)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a function literal (anonymous function)
|
/// Represents a function literal (anonymous function)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an identifier expression
|
/// Represents an identifier expression
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an index expression (e.g., x[i])
|
/// Represents an index expression (e.g., x[i])
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a keyed element in a composite literal (key: value)
|
/// Represents a keyed element in a composite literal (key: value)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a literal expression
|
/// Represents a literal expression
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a parenthesized expression
|
/// Represents a parenthesized expression
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a selector expression (e.g., x.field)
|
/// Represents a selector expression (e.g., x.field)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a slice expression (e.g., x[low:high:max])
|
/// Represents a slice expression (e.g., x[low:high:max])
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type assertion expression (e.g., x.(T))
|
/// Represents a type assertion expression (e.g., x.(T))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a unary expression
|
/// Represents a unary expression
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base class for all Go AST nodes
|
/// Base class for all Go AST nodes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base interface for all Go AST nodes
|
/// Base interface for all Go AST nodes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marker interface for all Go declarations
|
/// Marker interface for all Go declarations
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marker interface for all Go expressions
|
/// Marker interface for all Go expressions
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marker interface for all Go statements
|
/// Marker interface for all Go statements
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marker interface for all Go types
|
/// Marker interface for all Go types
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a complete Go source file
|
/// Represents a complete Go source file
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an assignment statement (=, :=, +=, etc.)
|
/// Represents an assignment statement (=, :=, +=, etc.)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a block statement (e.g., { ... })
|
/// Represents a block statement (e.g., { ... })
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a branch statement (break, continue, goto, fallthrough)
|
/// Represents a branch statement (break, continue, goto, fallthrough)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a declaration used as a statement
|
/// Represents a declaration used as a statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a defer statement
|
/// Represents a defer statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an empty statement
|
/// Represents an empty statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an expression used as a statement
|
/// Represents an expression used as a statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a fallthrough statement in a switch case
|
/// Represents a fallthrough statement in a switch case
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a for-range statement
|
/// Represents a for-range statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a for statement (traditional for loop)
|
/// Represents a for statement (traditional for loop)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a go statement (goroutine launch)
|
/// Represents a go statement (goroutine launch)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an if statement
|
/// Represents an if statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an increment or decrement statement (++ or --)
|
/// Represents an increment or decrement statement (++ or --)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a labeled statement
|
/// Represents a labeled statement
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a range-based for statement
|
/// Represents a range-based for statement
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a return statement
|
/// Represents a return statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a select statement
|
/// Represents a select statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a send statement (channel <- value)
|
/// Represents a send statement (channel <- value)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a short variable declaration (x := expr)
|
/// Represents a short variable declaration (x := expr)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a switch statement
|
/// Represents a switch statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type switch statement
|
/// Represents a type switch statement
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an array type (e.g., "[10]int")
|
/// Represents an array type (e.g., "[10]int")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a channel type (e.g., "chan int", "<-chan int", "chan<- int")
|
/// Represents a channel type (e.g., "chan int", "<-chan int", "chan<- int")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a function type (e.g., "func(int, string) error")
|
/// Represents a function type (e.g., "func(int, string) error")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type referenced by identifier (e.g., "int", "string", "MyType")
|
/// Represents a type referenced by identifier (e.g., "int", "string", "MyType")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents an interface type
|
/// Represents an interface type
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a map type (e.g., "map[string]int")
|
/// Represents a map type (e.g., "map[string]int")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a pointer type (e.g., "*int")
|
/// Represents a pointer type (e.g., "*int")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a slice type (e.g., "[]int")
|
/// Represents a slice type (e.g., "[]int")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a struct type
|
/// Represents a struct type
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a type element in an interface (for type sets)
|
/// Represents a type element in an interface (for type sets)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic type instantiation (e.g., List[int], Map[string, User])
|
/// Represents a generic type instantiation (e.g., List[int], Map[string, User])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a union of types in constraints (e.g., int | string | float64)
|
/// Represents a union of types in constraints (e.g., int | string | float64)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Diagnostics;
|
namespace MarketAlly.IronGo.Diagnostics;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Collects diagnostic information during parsing
|
/// Collects diagnostic information during parsing
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Diagnostics;
|
namespace MarketAlly.IronGo.Diagnostics;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents diagnostic information about the parsed source
|
/// Represents diagnostic information about the parsed source
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Antlr4 Include="Parser\*.g4">
|
<Antlr4 Include="Parser\*.g4">
|
||||||
<Package>IronGo.Parser</Package>
|
<Package>MarketAlly.IronGo.Parser</Package>
|
||||||
</Antlr4>
|
</Antlr4>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ using System;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Parser;
|
using MarketAlly.IronGo.Parser;
|
||||||
using IronGo.Performance;
|
using MarketAlly.IronGo.Performance;
|
||||||
using IronGo.Diagnostics;
|
using MarketAlly.IronGo.Diagnostics;
|
||||||
|
|
||||||
namespace IronGo;
|
namespace MarketAlly.IronGo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Main entry point for parsing Go source code
|
/// Main entry point for parsing Go source code
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using Antlr4.Runtime.Tree;
|
using Antlr4.Runtime.Tree;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Parser;
|
namespace MarketAlly.IronGo.Parser;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds an IronGo AST from an ANTLR parse tree
|
/// Builds an IronGo AST from an ANTLR parse tree
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using Antlr4.Runtime.Misc;
|
using Antlr4.Runtime.Misc;
|
||||||
|
|
||||||
namespace IronGo.Parser;
|
namespace MarketAlly.IronGo.Parser;
|
||||||
|
|
||||||
public abstract class GoParserBase : Antlr4.Runtime.Parser
|
public abstract class GoParserBase : Antlr4.Runtime.Parser
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ using System.Collections.Concurrent;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Performance;
|
namespace MarketAlly.IronGo.Performance;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Caches parsed AST results to improve performance for repeated parsing
|
/// Caches parsed AST results to improve performance for repeated parsing
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Serialization;
|
namespace MarketAlly.IronGo.Serialization;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Custom JSON converter for Go AST nodes
|
/// Custom JSON converter for Go AST nodes
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ using System.IO;
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Serialization;
|
namespace MarketAlly.IronGo.Serialization;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension methods for JSON serialization of AST nodes
|
/// Extension methods for JSON serialization of AST nodes
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Utilities;
|
namespace MarketAlly.IronGo.Utilities;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides deep cloning functionality for AST nodes
|
/// Provides deep cloning functionality for AST nodes
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Utilities;
|
namespace MarketAlly.IronGo.Utilities;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Utility methods for working with Go AST
|
/// Utility methods for working with Go AST
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
namespace IronGo.Utilities;
|
namespace MarketAlly.IronGo.Utilities;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base class that provides a universal node checking mechanism for all visitor methods
|
/// Base class that provides a universal node checking mechanism for all visitor methods
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base implementation of visitor pattern that does nothing by default
|
/// Base implementation of visitor pattern that does nothing by default
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A visitor that walks the entire AST tree, visiting all nodes
|
/// A visitor that walks the entire AST tree, visiting all nodes
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace IronGo.AST;
|
namespace MarketAlly.IronGo.AST;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Visitor interface for traversing Go AST nodes without returning a value
|
/// Visitor interface for traversing Go AST nodes without returning a value
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Serialization;
|
using MarketAlly.IronGo.Serialization;
|
||||||
using IronGo.Utilities;
|
using MarketAlly.IronGo.Utilities;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
const string goCode = @"
|
const string goCode = @"
|
||||||
@@ -88,7 +88,7 @@ try
|
|||||||
Console.WriteLine($" Second parse: {secondTime:F2}ms (cache hit)");
|
Console.WriteLine($" Second parse: {secondTime:F2}ms (cache hit)");
|
||||||
Console.WriteLine($" Speedup: {firstTime/secondTime:F1}x");
|
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 entries: {cacheStats.EntryCount}");
|
||||||
Console.WriteLine($" Cache hit rate: {cacheStats.HitRate:F2}");
|
Console.WriteLine($" Cache hit rate: {cacheStats.HitRate:F2}");
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Diagnostics;
|
using MarketAlly.IronGo.Diagnostics;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.DiagnosticsTests;
|
namespace MarketAlly.IronGo.Tests.DiagnosticsTests;
|
||||||
|
|
||||||
public class DiagnosticsTests
|
public class DiagnosticsTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Serialization;
|
using MarketAlly.IronGo.Serialization;
|
||||||
using IronGo.Utilities;
|
using MarketAlly.IronGo.Utilities;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.IntegrationTests;
|
namespace MarketAlly.IronGo.Tests.IntegrationTests;
|
||||||
|
|
||||||
public class RealGoCodeTests
|
public class RealGoCodeTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.ParserTests;
|
namespace MarketAlly.IronGo.Tests.ParserTests;
|
||||||
|
|
||||||
public class BasicParsingTests
|
public class BasicParsingTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.ParserTests;
|
namespace MarketAlly.IronGo.Tests.ParserTests;
|
||||||
|
|
||||||
public class ExpressionParsingTests
|
public class ExpressionParsingTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.ParserTests;
|
namespace MarketAlly.IronGo.Tests.ParserTests;
|
||||||
|
|
||||||
public class StatementParsingTests
|
public class StatementParsingTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.ParserTests;
|
namespace MarketAlly.IronGo.Tests.ParserTests;
|
||||||
|
|
||||||
public class TypeParsingTests
|
public class TypeParsingTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.Performance;
|
using MarketAlly.IronGo.Performance;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.PerformanceTests;
|
namespace MarketAlly.IronGo.Tests.PerformanceTests;
|
||||||
|
|
||||||
public class CachingTests
|
public class CachingTests
|
||||||
{
|
{
|
||||||
@@ -116,8 +116,8 @@ func concurrent() {
|
|||||||
ast1.Should().NotBeSameAs(ast2);
|
ast1.Should().NotBeSameAs(ast2);
|
||||||
ast1.Should().BeSameAs(ast1Again);
|
ast1.Should().BeSameAs(ast1Again);
|
||||||
|
|
||||||
ast1.Declarations[0].As<IronGo.AST.FunctionDeclaration>().Name.Should().Be("one");
|
ast1.Declarations[0].As<MarketAlly.IronGo.AST.FunctionDeclaration>().Name.Should().Be("one");
|
||||||
ast2.Declarations[0].As<IronGo.AST.FunctionDeclaration>().Name.Should().Be("two");
|
ast2.Declarations[0].As<MarketAlly.IronGo.AST.FunctionDeclaration>().Name.Should().Be("two");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Serialization;
|
using MarketAlly.IronGo.Serialization;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.SerializationTests;
|
namespace MarketAlly.IronGo.Tests.SerializationTests;
|
||||||
|
|
||||||
public class JsonSerializationTests
|
public class JsonSerializationTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using IronGo.Utilities;
|
using MarketAlly.IronGo.Utilities;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.UtilityTests;
|
namespace MarketAlly.IronGo.Tests.UtilityTests;
|
||||||
|
|
||||||
public class AstUtilityTests
|
public class AstUtilityTests
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using IronGo;
|
using MarketAlly.IronGo;
|
||||||
using IronGo.AST;
|
using MarketAlly.IronGo.AST;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace IronGo.Tests.VisitorTests;
|
namespace MarketAlly.IronGo.Tests.VisitorTests;
|
||||||
|
|
||||||
public class AstVisitorTests
|
public class AstVisitorTests
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user