about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-06-11 00:10:59 +0200
committerBaitinq <[email protected]>2025-06-11 00:11:01 +0200
commit8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5 (patch)
tree80e8e9319734e112558f1a9c31485b1c01bccb41 /src
parentBoostrap: fix aarch64 linking (diff)
downloadpry-lang-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.tar.gz
pry-lang-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.tar.bz2
pry-lang-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.zip
stdlib: Remove println
varargs forwarding is platform specific with llvm, so we cannot easily
have this function
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/codegen.src16
-rw-r--r--src/bootstrap/main.src4
-rw-r--r--src/bootstrap/parser.src14
-rw-r--r--src/bootstrap/tokenizer.src10
4 files changed, 22 insertions, 22 deletions
diff --git a/src/bootstrap/codegen.src b/src/bootstrap/codegen.src
index fa4c45d..7059508 100644
--- a/src/bootstrap/codegen.src
+++ b/src/bootstrap/codegen.src
@@ -63,7 +63,7 @@ let codegen_generate_expression_value = (c: *codegen, expression: *Node, name: *
 	if ((*expression).type == NODE_PRIMARY_EXPRESSION_NUMBER) {
 		let n = (*cast(*NODE_PRIMARY_EXPRESSION_NUMBER_DATA, (*expression).data)).value;
 		
-		println("X: %d", n);
+		printf("X: %d\n", n);
 
 		let node_type = Node{};
 		node_type.type = NODE_TYPE_SIMPLE_TYPE;
@@ -77,9 +77,9 @@ let codegen_generate_expression_value = (c: *codegen, expression: *Node, name: *
 	};
 	
 	if ((*expression).type == NODE_FUNCTION_DEFINITION) {
-		println("ASS %d", (*expression).type);
+		printf("ASS %d\n", (*expression).type);
 		assert(false); /* TODO */
-		println("ERT");
+		printf("ERT\n");
 	};
 
 	assert(false);
@@ -93,7 +93,7 @@ let codegen_generate_assignment_statement = (c: *codegen, stmt: *NODE_ASSIGNMENT
 
 	if (lhs.type == NODE_PRIMARY_EXPRESSION_IDENTIFIER) {
 		let identifier = (*cast(*NODE_PRIMARY_EXPRESSION_IDENTIFIER_DATA, lhs.data)).name;
-		println("XX %s", identifier);
+		printf("XX %s\n", identifier);
 		let variable = codegen_generate_expression_value(c, prhs, identifier);
 		assert(variable != cast(*Variable, null));
 		return 0;
@@ -111,7 +111,7 @@ let codegen_generate_statement = (c: *codegen, statement: *Node) => i64 {
 	if res != 0 {
 		return 1;
 	};
-	println("STMT: %d", stmt.type);
+	printf("STMT: %d\n", stmt.type);
 	return 0;
 };
 
@@ -145,7 +145,7 @@ let codegen_compile = (c: *codegen) => i64 {
         let message = cast(**i8, null);
         let result = LLVMGetTargetFromTriple(triple, target_ref, message);
         if result != 0 {
-            println("Target output: %s", *message);
+            printf("Target output: %s\n", *message);
             LLVMDisposeMessage(*message);
         };
         let target_machine = LLVMCreateTargetMachine(
@@ -160,7 +160,7 @@ let codegen_compile = (c: *codegen) => i64 {
         LLVMDisposeMessage(triple);
         result = LLVMVerifyModule((*c).llvm_module, LLVMAbortProcessAction, message);
         if result != 0 {
-            println("Verification output: %s", *message);
+            printf("Verification output: %s\n", *message);
             LLVMDisposeMessage(*message);
         };
 
@@ -174,7 +174,7 @@ let codegen_compile = (c: *codegen) => i64 {
             cast(**i8, null),
         );
         LLVMDisposeTargetMachine(target_machine);
-        println("Object file generated: %s", filename);
+        printf("Object file generated: %s\n", filename);
 
 	return 0;
 };
diff --git a/src/bootstrap/main.src b/src/bootstrap/main.src
index 6cb2949..571cc03 100644
--- a/src/bootstrap/main.src
+++ b/src/bootstrap/main.src
@@ -40,13 +40,13 @@ let read_file = (filename: *i8, alloc: *arena) => slice {
 
 let main = (argc: i64, argv: **i8) => i64 {
 	if argc < 2 {
-		println("Need filename!");
+		printf("Need filename!\n");
 		return 1;
 	};
 
 	let filename = *(argv + cast(**i8, 1));
 
-	println("%s", filename);
+	printf("%s\n", filename);
 
 	let alloc = arena_init(999999999);
 
diff --git a/src/bootstrap/parser.src b/src/bootstrap/parser.src
index 44e5761..daac296 100644
--- a/src/bootstrap/parser.src
+++ b/src/bootstrap/parser.src
@@ -379,7 +379,7 @@ let parser_parse_primary_expression = (p: *parser) => *Node {
 
 	let tok = parser_consume_token(p);
 	if tok == cast(*token, null) {
-	println("NO TOK");
+	printf("NO TOK\n");
 	    return cast(*Node, null); 
 	};
 
@@ -402,7 +402,7 @@ let parser_parse_primary_expression = (p: *parser) => *Node {
 	    return create_node(p, n);
 	};
 
-	println("DIFF TYPE: %d", (*tok).type);
+	printf("DIFF TYPE: %d\n", (*tok).type);
 
 	return cast(*Node, null);
 };
@@ -437,7 +437,7 @@ let parser_parse_expression = (p: *parser) => *Node {
 let parse_assignment_statement = (p: *parser) => *Node {
 	let is_declaration = false;
 	if parser_accept_token(p, TOKEN_LET) != cast(*token, null) {
-	    println("IS DECLARATION");
+	    printf("IS DECLARATION\n");
 	    is_declaration = true;
 	};
 
@@ -445,7 +445,7 @@ let parse_assignment_statement = (p: *parser) => *Node {
 
 	let lhs = parser_parse_expression(p); /* TODO */
 	if lhs == cast(*Node, null) {
-	println("ANOTHER BNLL");
+	printf("ANOTHER BNLL\n");
 	    return cast(*Node, null);
 	};	
 	
@@ -455,7 +455,7 @@ let parse_assignment_statement = (p: *parser) => *Node {
 	
 	let rhs = parser_parse_expression(p); /* TODO */
 	if rhs == cast(*Node, null) {
-		println("NUL EXP");
+		printf("NUL EXP\n");
 	    return cast(*Node, null);
 	};
 
@@ -467,7 +467,7 @@ let parse_assignment_statement = (p: *parser) => *Node {
 	let n = Node{};
 	n.type = NODE_ASSIGNMENT_STATEMENT;
 	n.data = cast(*void, d);
-	println("CONTINUE");
+	printf("CONTINUE\n");
 	return create_node(p, n);
 };
 
@@ -490,7 +490,7 @@ let parser_parse_statement = (p: *parser) => *Node {
 	};
 
 
-	println("None");
+	printf("None\n");
 	
 	return cast(*Node, null);
 };
diff --git a/src/bootstrap/tokenizer.src b/src/bootstrap/tokenizer.src
index 70ec1bb..8d7f997 100644
--- a/src/bootstrap/tokenizer.src
+++ b/src/bootstrap/tokenizer.src
@@ -503,7 +503,7 @@ let tokenizer_next = (t: *tokenizer) => *token {
 		return true;
 	});
 	if strlen(string) == 0 {
-		println("NO IDENT!");
+		printf("NO IDENT!\n");
 		return cast(*token, null);
 	};
 
@@ -520,9 +520,9 @@ let tokenizer_init = (alloc: *arena, file: slice) => *tokenizer {
 	(*t).buf = cast(*i8, file.data);
 	(*t).buf_len = file.data_len;
 
-	println("File size: %d", (*t).buf_len);
+	printf("File size: %d\n", (*t).buf_len);
 
-	println("%s", (*t).buf);
+	printf("%s\n", (*t).buf);
 
 	return t;
 };
@@ -536,13 +536,13 @@ let tokenizer_tokenize = (t: *tokenizer) => slice {
 		if tk == cast(*token, null) {
 			break;
 		};
-		println("Add token: %d", (*tk).type);
+		printf("Add token: %d\n", (*tk).type);
 
 		(*(tokens + cast(*token, tokens_len))) = *tk;
 		tokens_len = tokens_len + 1;
 	};
 
-	println("PRINT TOKENS: %d", tokens_len);
+	printf("PRINT TOKENS: %d\n", tokens_len);
 
 	print_tokens(tokens, tokens_len);