From b36ba482ba072f81788b112b07d5c12c9d44a020 Mon Sep 17 00:00:00 2001 From: SrGaabriel Date: Thu, 5 Sep 2024 22:34:03 -0300 Subject: [PATCH] refactor: change file extension to `sn` to avoid overlap with slash --- README.md | 2 +- .../analyzers/impl/InstantiationAnalyzer.kt | 3 --- bard/output/ll/bard.ll | 18 +++++++++--------- bard/output/ll/signatures.json | 2 +- bard/output/ll/stdlib.ll | 10 +++++----- bard/output/output.exe | Bin 129024 -> 129024 bytes bard/src/{main.sl => main.sn} | 0 .../kotlin/SeleneCompilerPlatform.kt | 2 +- .../commonMain/kotlin/LLVMCodeGenerator.kt | 1 - stdlib/src/{collections.sl => collections.sn} | 0 stdlib/src/{io.sl => io.sn} | 0 stdlib/src/{math.sl => math.sn} | 0 stdlib/src/{networking.sl => networking.sn} | 0 stdlib/src/{str.sl => str.sn} | 0 stdlib/src/{types.sl => types.sn} | 0 15 files changed, 17 insertions(+), 21 deletions(-) rename bard/src/{main.sl => main.sn} (100%) rename stdlib/src/{collections.sl => collections.sn} (100%) rename stdlib/src/{io.sl => io.sn} (100%) rename stdlib/src/{math.sl => math.sn} (100%) rename stdlib/src/{networking.sl => networking.sn} (100%) rename stdlib/src/{str.sl => str.sn} (100%) rename stdlib/src/{types.sl => types.sn} (100%) diff --git a/README.md b/README.md index 49b91e9..990d43d 100644 --- a/README.md +++ b/README.md @@ -124,4 +124,4 @@ func main() { # Brand -The brand of the language is a leaf. The theme color is #f05133. \ No newline at end of file +The icon of the language is a leaf. The theme color is #f05133. \ No newline at end of file diff --git a/analysis/src/commonMain/kotlin/analyzers/impl/InstantiationAnalyzer.kt b/analysis/src/commonMain/kotlin/analyzers/impl/InstantiationAnalyzer.kt index 1161008..989013f 100644 --- a/analysis/src/commonMain/kotlin/analyzers/impl/InstantiationAnalyzer.kt +++ b/analysis/src/commonMain/kotlin/analyzers/impl/InstantiationAnalyzer.kt @@ -78,7 +78,6 @@ class InstantiationAnalyzer: SingleNodeAnalyzer(Instantiation node.arguments.forEachIndexed { index, argumentNode -> val expectedType = types[index] val providedType = block.resolveExpression(argumentNode) - println("Provided type for ${argumentNode} is $providedType") if (providedType == null) { results.errors.add( @@ -98,11 +97,9 @@ class InstantiationAnalyzer: SingleNodeAnalyzer(Instantiation block.declareSymbol(argumentNode.name, newType) val assignment = block.resolveAssignment(argumentNode.name) if (assignment != null) { - println("Assigned node $assignment to $newType") block.defineSymbol(assignment, newType) } } - println("New type for ${argumentNode} is $newType") return@forEachIndexed } diff --git a/bard/output/ll/bard.ll b/bard/output/ll/bard.ll index 6e6f7a7..15d179e 100644 --- a/bard/output/ll/bard.ll +++ b/bard/output/ll/bard.ll @@ -1,5 +1,5 @@ declare i32 @strcmp(i8*, i8*) -@trait_1720339 = external constant <{ i16, i16, ptr, ptr, ptr, ptr, ptr }> +@trait_1714550218 = external constant <{ i16, i16, ptr, ptr, ptr, ptr, ptr }> declare void @println_f64(double) declare void @println_bool(i1) declare void @println_i32(i32) @@ -11,14 +11,14 @@ declare void @println_str(i8*) declare i32 @printf(i8*, ...) define void @main() { entry: - %0 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 2 + %0 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 2 %1 = load ptr, ptr %0 %2 = call %List* %1() - %3 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 3 + %3 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 3 %4 = load ptr, ptr %3 %5 = call i32 %4(%List* %2) call void @println_i32(i32 %5) - %7 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 6 + %7 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 6 %8 = load ptr, ptr %7 %9 = alloca [6 x i8], align 1 %10 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i32 0, i32 0 @@ -34,7 +34,7 @@ entry: %15 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i32 0, i32 5 store i8 0, i8* %15 call i1 %8(%List* %2, [6 x i8]* %9) - %17 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 6 + %17 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 6 %18 = load ptr, ptr %17 %19 = alloca [6 x i8], align 1 %20 = getelementptr inbounds [6 x i8], [6 x i8]* %19, i32 0, i32 0 @@ -50,7 +50,7 @@ entry: %25 = getelementptr inbounds [6 x i8], [6 x i8]* %19, i32 0, i32 5 store i8 0, i8* %25 call i1 %18(%List* %2, [6 x i8]* %19) - %27 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 6 + %27 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 6 %28 = load ptr, ptr %27 %29 = alloca [6 x i8], align 1 %30 = getelementptr inbounds [6 x i8], [6 x i8]* %29, i32 0, i32 0 @@ -66,7 +66,7 @@ entry: %35 = getelementptr inbounds [6 x i8], [6 x i8]* %29, i32 0, i32 5 store i8 0, i8* %35 call i1 %28(%List* %2, [6 x i8]* %29) - %37 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 3 + %37 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 3 %38 = load ptr, ptr %37 %39 = call i32 %38(%List* %2) call void @println_i32(i32 %39) @@ -85,10 +85,10 @@ entry: store i8 0, i8* %47 %48 = getelementptr inbounds [6 x i8], [6 x i8]* %41, i32 0, i32 0 call void @println_str(i8* %48) - %50 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 5 + %50 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 5 %51 = load ptr, ptr %50 %52 = call %List* %51(%List* %2, ptr @lambda_1278852808) - %54 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 3 + %54 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 3 %55 = load ptr, ptr %54 %56 = call i32 %55(%List* %52) call void @println_i32(i32 %56) diff --git a/bard/output/ll/signatures.json b/bard/output/ll/signatures.json index cada3b6..bf60ca7 100644 --- a/bard/output/ll/signatures.json +++ b/bard/output/ll/signatures.json @@ -1 +1 @@ -{"structs":[{"name":"List","module":"stdlib","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"name":"Socket","module":"stdlib","fields":{"id":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"family":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"port":{"type":"me.gabriel.selene.frontend.SeleneType.Int16"},"ip_address":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"name":"TcpServer","module":"stdlib","fields":{"ip_address":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"port":{"type":"me.gabriel.selene.frontend.SeleneType.Int16"}}}],"functions":[{"module":"stdlib","name":"new","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[],"modifiers":[]},{"module":"stdlib","name":"size","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"get","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":[]},{"module":"stdlib","name":"filter","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Lambda","id":"lambda","signature":"(string) -> bool","parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Boolean"}}],"modifiers":[]},{"module":"stdlib","name":"push","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Mutable","id":"mutate","signature":"mut self","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.Self"}},{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"modifiers":[]},{"module":"stdlib","name":"length","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"text","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"printf","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"println","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"readln","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"arraylen","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"sin","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"cos","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"tan","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"asin","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"acos","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"atan","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"atan2","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"socket","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"bind","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"listen","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"accept","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"receive","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"send","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"close","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"bard","name":"main","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[],"modifiers":[]}],"traits":[{"name":"Collection","functions":[{"module":"stdlib","name":"new","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[],"modifiers":[]},{"module":"stdlib","name":"size","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"get","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":[]},{"module":"stdlib","name":"filter","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Lambda","id":"lambda","signature":"(string) -> bool","parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Boolean"}}],"modifiers":[]},{"module":"stdlib","name":"push","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Mutable","id":"mutate","signature":"mut self","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.Self"}},{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"modifiers":[]}],"impls":[{"struct":"List","trait":"Collection","index":1720339,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.String"},{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"type":"me.gabriel.selene.frontend.SeleneType.Void"}]}]},{"name":"Legible","functions":[{"module":"stdlib","name":"text","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]}],"impls":[{"struct":"string","trait":"Legible","index":1947896119,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}]},{"struct":"int32","trait":"Legible","index":1876443073,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}]}]},{"name":"CharArray","functions":[{"module":"stdlib","name":"length","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]}],"impls":[{"struct":"string","trait":"CharArray","index":35534346,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}]}]}]} \ No newline at end of file +{"structs":[{"name":"List","module":"stdlib","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"name":"Socket","module":"stdlib","fields":{"id":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"family":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"port":{"type":"me.gabriel.selene.frontend.SeleneType.Int16"},"ip_address":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"name":"TcpServer","module":"stdlib","fields":{"ip_address":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"port":{"type":"me.gabriel.selene.frontend.SeleneType.Int16"}}}],"functions":[{"module":"stdlib","name":"new","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[],"modifiers":[]},{"module":"stdlib","name":"size","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"get","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":[]},{"module":"stdlib","name":"filter","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Lambda","id":"lambda","signature":"(string) -> bool","parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Boolean"}}],"modifiers":[]},{"module":"stdlib","name":"push","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Mutable","id":"mutate","signature":"mut self","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.Self"}},{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"modifiers":[]},{"module":"stdlib","name":"length","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"text","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"printf","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"println","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"readln","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"arraylen","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Any"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"sin","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"cos","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"tan","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"asin","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"acos","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"atan","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"atan2","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Float64"},{"type":"me.gabriel.selene.frontend.SeleneType.Float64"}],"modifiers":["INTRINSIC"]},{"module":"stdlib","name":"socket","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"bind","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"listen","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"accept","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"receive","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"send","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int8"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"stdlib","name":"close","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":["INTERNAL","INTRINSIC"]},{"module":"bard","name":"main","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[],"modifiers":[]}],"traits":[{"name":"Collection","functions":[{"module":"stdlib","name":"new","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[],"modifiers":[]},{"module":"stdlib","name":"size","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]},{"module":"stdlib","name":"get","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}],"modifiers":[]},{"module":"stdlib","name":"filter","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"},{"type":"me.gabriel.selene.frontend.SeleneType.Lambda","id":"lambda","signature":"(string) -> bool","parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Boolean"}}],"modifiers":[]},{"module":"stdlib","name":"push","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Void"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Mutable","id":"mutate","signature":"mut self","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.Self"}},{"type":"me.gabriel.selene.frontend.SeleneType.String"}],"modifiers":[]}],"impls":[{"struct":"List","trait":"Collection","index":1714550218,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},{"type":"me.gabriel.selene.frontend.SeleneType.String"},{"type":"me.gabriel.selene.frontend.SeleneType.Struct","id":"struct","signature":"List","identifier":"List","fields":{"array":{"type":"me.gabriel.selene.frontend.SeleneType.DynamicArray","id":"fixed array","signature":"string[]","baseType":{"type":"me.gabriel.selene.frontend.SeleneType.String"}},"size":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}}},{"type":"me.gabriel.selene.frontend.SeleneType.Void"}]}]},{"name":"Legible","functions":[{"module":"stdlib","name":"text","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.String"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]}],"impls":[{"struct":"string","trait":"Legible","index":1947896119,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}]},{"struct":"int32","trait":"Legible","index":1876443073,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.String"}]}]},{"name":"CharArray","functions":[{"module":"stdlib","name":"length","returnType":{"type":"me.gabriel.selene.frontend.SeleneType.Int32"},"parameters":[{"type":"me.gabriel.selene.frontend.SeleneType.Self"}],"modifiers":[]}],"impls":[{"struct":"string","trait":"CharArray","index":35534346,"module":"stdlib","types":[{"type":"me.gabriel.selene.frontend.SeleneType.Int32"}]}]}]} \ No newline at end of file diff --git a/bard/output/ll/stdlib.ll b/bard/output/ll/stdlib.ll index 337db4a..0f8b4a8 100644 --- a/bard/output/ll/stdlib.ll +++ b/bard/output/ll/stdlib.ll @@ -15,7 +15,7 @@ declare i8* @malloc(i32) i16 8, ptr @string.length }>, align 8 - @trait_1720339 = unnamed_addr constant <{ i16, i16, ptr, ptr, ptr, ptr, ptr }> <{ + @trait_1714550218 = unnamed_addr constant <{ i16, i16, ptr, ptr, ptr, ptr, ptr }> <{ i16 8, i16 8, ptr @List.new, @@ -124,10 +124,10 @@ define %List* @List.new() { entry: %1 = call i8* @malloc(i32 64) call void @memset(i8* %1, i32 0, i32 64) - %2 = bitcast i8* %1 to i8** + %2 = bitcast i8* %1 to i8*** %3 = alloca %List, align 8 %4 = getelementptr inbounds %List, %List* %3, i32 0, i32 0 - store i8** %2, i8*** %4 + store i8*** %2, i8**** %4 %5 = getelementptr inbounds %List, %List* %3, i32 0, i32 1 store i32 0, i32* %5 ret %List* %3 @@ -148,7 +148,7 @@ entry: } define %List* @List.filter(%List* %15, ptr %16) { entry: - %17 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 2 + %17 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 2 %18 = load ptr, ptr %17 %19 = call %List* %18() %20 = alloca i32, align 4 @@ -169,7 +169,7 @@ for_body1: %31 = call i1 %16(i8* %30) br i1 %31, label %label3, label %label5 label3: - %32 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1720339, i32 0, i32 6 + %32 = getelementptr inbounds <{i16, i16, ptr, ptr, ptr, ptr, ptr}>, ptr @trait_1714550218, i32 0, i32 6 %33 = load ptr, ptr %32 %34 = getelementptr inbounds %List, %List* %15, i32 0, i32 0 %35 = load i8**, i8*** %34 diff --git a/bard/output/output.exe b/bard/output/output.exe index 569187653150accd5667fe5c8a728f26a45cb654..91c5c3db4d9da5230a326e92c10b1dbcc549dfc5 100644 GIT binary patch delta 27 icmZqpz~1nIeZmi>yU~rmw*F%5+5}{6Z`;gR <{ i16 ${obj.size}, diff --git a/stdlib/src/collections.sl b/stdlib/src/collections.sn similarity index 100% rename from stdlib/src/collections.sl rename to stdlib/src/collections.sn diff --git a/stdlib/src/io.sl b/stdlib/src/io.sn similarity index 100% rename from stdlib/src/io.sl rename to stdlib/src/io.sn diff --git a/stdlib/src/math.sl b/stdlib/src/math.sn similarity index 100% rename from stdlib/src/math.sl rename to stdlib/src/math.sn diff --git a/stdlib/src/networking.sl b/stdlib/src/networking.sn similarity index 100% rename from stdlib/src/networking.sl rename to stdlib/src/networking.sn diff --git a/stdlib/src/str.sl b/stdlib/src/str.sn similarity index 100% rename from stdlib/src/str.sl rename to stdlib/src/str.sn diff --git a/stdlib/src/types.sl b/stdlib/src/types.sn similarity index 100% rename from stdlib/src/types.sl rename to stdlib/src/types.sn