Add Zig and PowerShell language support

This commit is contained in:
Safi
2026-04-07 09:56:53 +01:00
parent f2423bc114
commit 9d998cc810
7 changed files with 388 additions and 4 deletions
+32
View File
@@ -0,0 +1,32 @@
using namespace System.IO
using module MyModule
function Get-Data {
param(
[string]$Name,
[int]$Count = 10
)
$result = Process-Items -Name $Name -Count $Count
return $result
}
function Process-Items {
param([string]$Name, [int]$Count)
Write-Output "Processing $Count items for $Name"
}
class DataProcessor {
[string]$Source
DataProcessor([string]$source) {
$this.Source = $source
}
[string] Transform([string]$input) {
return $input.ToUpper()
}
[void] Save([string]$path) {
Set-Content -Path $path -Value $this.Source
}
}
+37
View File
@@ -0,0 +1,37 @@
const std = @import("std");
const mem = @import("std").mem;
const Point = struct {
x: f64,
y: f64,
pub fn distance(self: Point, other: Point) f64 {
const dx = self.x - other.x;
const dy = self.y - other.dy;
return std.math.sqrt(dx * dx + dy * dy);
}
};
const Color = enum {
red,
green,
blue,
};
const Shape = union(enum) {
circle: f64,
rect: Point,
};
pub fn add(a: i32, b: i32) i32 {
return a + b;
}
pub fn multiply(a: i32, b: i32) i32 {
return a * b;
}
pub fn main() void {
const result = add(1, 2);
_ = multiply(result, 3);
}
+1 -1
View File
@@ -61,7 +61,7 @@ def test_collect_files_from_dir():
supported = {".py", ".js", ".ts", ".tsx", ".go", ".rs",
".java", ".c", ".cpp", ".cc", ".cxx", ".rb",
".cs", ".kt", ".kts", ".scala", ".php", ".h", ".hpp",
".swift"}
".swift", ".lua", ".toc", ".zig", ".ps1"}
assert all(f.suffix in supported for f in files)
assert len(files) > 0