Files
bux-lang/_test_json_assign/src/Main.bux
T
dimgigov 49264b5d06 feat: add Std::Json — JSON parser and serializer
- JsonValue struct supporting null, bool, number, string, array, object
- Json_Parse(s: String) -> JsonValue: recursive descent parser
- Json_Stringify(v: JsonValue) -> String: recursive serializer
- Access helpers: Json_ObjectGet, Json_ObjectSet, Json_ObjectHas,
  Json_ArrayGet, Json_ArrayPush, Json_ArrayLen, Json_ObjectLen
- Constructors: Json_Null, Json_Bool, Json_Number, Json_String,
  Json_Array, Json_Object
- Type accessors: Json_IsNull, Json_AsBool, Json_AsNumber, Json_AsString
- examples/json.bux: demonstrates parse, access, build programmatically
- Add os_time, process, json to test-examples suite
2026-06-05 21:26:51 +03:00

17 lines
319 B
Plaintext

import Std::Io::{PrintLine};
struct JsonValue {
tag: int,
strVal: String,
numVal: float64
}
func Main() -> int {
var a: JsonValue = JsonValue { tag: 1, strVal: "hello", numVal: 3.14 };
var b: JsonValue = a;
b.strVal = "world";
PrintLine(a.strVal);
PrintLine(b.strVal);
return 0;
}