mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-12 18:37:12 +00:00
Add Zig and PowerShell language support
This commit is contained in:
Vendored
+32
@@ -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
|
||||
}
|
||||
}
|
||||
Vendored
+37
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user