2020-07-25 12:11:29 -04:00
|
|
|
template wp_Proxy do
|
2020-07-31 10:44:39 -04:00
|
|
|
|
2020-07-25 12:11:29 -04:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
template wp_NamedProxy extends wp_Proxy do
|
|
|
|
|
var name : text;
|
|
|
|
|
var symbol : text;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
template wp_Unit extends wp_NamedProxy do
|
2020-08-16 22:41:53 -04:00
|
|
|
# TODO: this shoud really be: \e<child (\ v: wp_Function ()).fold (c: "", c: (c & v.contents), c: (c & ",\n"))>
|
|
|
|
|
# doesn't work for now, reg exp for wrappers are broken. to fix...
|
|
|
|
|
|
2020-08-20 12:56:58 -04:00
|
|
|
var contents : text => defer (i"""
|
2020-07-31 10:44:39 -04:00
|
|
|
{
|
|
|
|
|
"name":"\e<name>",
|
2020-08-16 22:41:53 -04:00
|
|
|
"functions": [
|
2020-08-23 22:03:48 -04:00
|
|
|
\e<child (wp_Function ()).filter (\ true).fold ("", @ & it.contents, @ & ",\n")>
|
2020-08-20 23:33:39 -04:00
|
|
|
],
|
|
|
|
|
"classes": [
|
2020-08-23 22:03:48 -04:00
|
|
|
\e<child (wp_Class ()).fold ("", @ & it.contents, @ & ",\n")>
|
2020-08-16 22:41:53 -04:00
|
|
|
]
|
2020-07-31 10:44:39 -04:00
|
|
|
}""");
|
2020-07-25 12:11:29 -04:00
|
|
|
end;
|
|
|
|
|
|
2020-08-20 23:33:39 -04:00
|
|
|
template wp_Class extends wp_NamedProxy do
|
|
|
|
|
var contents: text => defer (i"""
|
|
|
|
|
{
|
|
|
|
|
"name": "\e<name>"
|
|
|
|
|
}
|
|
|
|
|
""");
|
|
|
|
|
end;
|
|
|
|
|
|
2020-07-25 12:11:29 -04:00
|
|
|
template wp_Function extends wp_NamedProxy do
|
|
|
|
|
var type : text;
|
2020-07-31 10:44:39 -04:00
|
|
|
|
2020-08-20 12:56:58 -04:00
|
|
|
var contents : text => defer(i"""
|
2020-08-16 22:41:53 -04:00
|
|
|
{
|
2020-07-31 10:44:39 -04:00
|
|
|
"name": "\e<name>",
|
|
|
|
|
"symbol": "\e<symbol>",
|
|
|
|
|
"type": "\e<type>",
|
2020-08-16 22:41:53 -04:00
|
|
|
"parameters": [
|
2020-08-23 22:03:48 -04:00
|
|
|
\e<child (wp_Parameter ()).fold ("", @ & it.contents, @ & ",\n")>
|
2020-08-16 22:41:53 -04:00
|
|
|
]
|
2020-07-31 10:44:39 -04:00
|
|
|
}""");
|
2020-07-25 12:11:29 -04:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
template wp_Parameter extends wp_NamedProxy do
|
|
|
|
|
var type : text;
|
2020-07-31 10:44:39 -04:00
|
|
|
|
2020-08-20 12:56:58 -04:00
|
|
|
var contents : text => defer(i"""
|
2020-08-16 22:41:53 -04:00
|
|
|
{
|
2020-07-31 10:44:39 -04:00
|
|
|
"name": "\e<name>",
|
|
|
|
|
"type": "\e<type>"
|
|
|
|
|
}""");
|
2020-07-25 12:11:29 -04:00
|
|
|
end;
|
|
|
|
|
|
2020-07-31 16:19:22 -04:00
|
|
|
template wp_TypeExpr extends wp_Proxy do
|
2020-08-16 22:41:53 -04:00
|
|
|
var txt : text;
|
2020-07-31 16:19:22 -04:00
|
|
|
end;
|
|
|
|
|
|
2020-08-04 19:05:24 -04:00
|
|
|
template generate_proxy2json pick origin do
|
2020-07-25 12:11:29 -04:00
|
|
|
match wp_Unit ()
|
2020-09-14 21:58:50 -04:00
|
|
|
wrap standard.file (defer (name & ".json"), defer (contents));
|
2020-07-25 12:11:29 -04:00
|
|
|
end;
|