Snippets

YellowAfterlife eaGEkj: Untitled snippet

Created by VadimD
import gml.ds.AnonMap;

class Test {
    static function main() {
        var q:Response = AnonMap.parse('{"i":1,"s":"hi"}');
		trace(q.i);
		trace(q.s.length);
    }
}
@:dsMap typedef Response = {
	var i:Int;
	var s:String;
};
1
2
3
4
5
6
7
8
9
#define sftest
// Generated at 2018-07-07 10:54:22 (261ms) for v1.4.1804+
test_main();

#define test_main
/// test_main()
var q = json_decode('{"i":1,"s":"hi"}');
trace("src/Test.hx:6:", q[?"i"]);
trace("src/Test.hx:7:", string_length(q[?"s"]));

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.