Files
bux-lang/_test_strings/src/Main.bux
T
dimgigov eb8179b6d0 fix(qbe): any-child terminator check in QBE_IsTerminator for hBlock — QBE SSA now fully valid
- QBE_IsTerminator(hBlock) checks ALL children, not just last
- Removed legacy c_backend.bux and nim_backend.bux from _selfhost/src/
- QBE self-hosting QBE phase: PASSES (SSA valid, assembled to .s)
- Remaining: linker errors from missing String_Eq/StringBuilder in runtime
2026-06-02 13:56:12 +03:00

35 lines
866 B
Plaintext

// Strings - String manipulation with Std::String
import Std::Io::{PrintLine, PrintInt};
import Std::String::{String_Len, String_Eq, String_Concat};
func Main() -> int {
let hello: String = "Hello";
let world: String = "World";
PrintLine("String operations:");
// Length
PrintLine("Length of 'Hello':");
PrintInt(String_Len(hello));
PrintLine("");
// Concatenation
let greeting: String = String_Concat(hello, ", ");
let greeting2: String = String_Concat(greeting, world);
let full: String = String_Concat(greeting2, "!");
PrintLine("Concatenated:");
PrintLine(full);
// Equality
if String_Eq(hello, "Hello") {
PrintLine("'Hello' equals 'Hello'");
}
if !String_Eq(hello, world) {
PrintLine("'Hello' does not equal 'World'");
}
return 0;
}