Skip to content

Commit

Permalink
remove transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Jan 3, 2024
1 parent 1430d19 commit 62f0b2e
Show file tree
Hide file tree
Showing 91 changed files with 120 additions and 208 deletions.
2 changes: 1 addition & 1 deletion apps/vscode-wing/syntaxes/wing.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
},
{
"name": "support.function.wing",
"match": "\\b(log|assert|unsafeCast|nodeof)\\b"
"match": "\\b(log|assert|throw|panic)\\b"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/07-examples/80-singletons.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SingletonBucket {
}
```
The `SingletonBucket.of()` static method uses `nodeof(scope).root` to find the root node of the app.
The `SingletonBucket.of()` static method uses `std.Node.of(scope).root` to find the root node of the app.
Then, if there is already a child with the identifier `SingletonBucket` at that level, it returns
it or otherwise it creates a new bucket with this id (`as uid`) under the root node (`in root`).
Expand Down
14 changes: 5 additions & 9 deletions libs/wingc/src/closure_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,15 @@ impl Fold for ClosureTransformer {

// class_init_body :=
// ```
// std.Node.of(this).hidden = true;
// nodeof(this).hidden = true;
// ```
let std_display_of_this = Expr::new(
ExprKind::Call {
callee: CalleeKind::Expr(Box::new(Expr::new(
ExprKind::Reference(Reference::TypeMember {
type_name: UserDefinedType {
root: Symbol::new("std", WingSpan::for_file(file_id)),
fields: vec![Symbol::new("Node", WingSpan::for_file(file_id))],
span: WingSpan::for_file(file_id),
},
property: Symbol::new("of", WingSpan::for_file(file_id)),
}),
ExprKind::Reference(Reference::Identifier(Symbol::new(
"nodeof",
WingSpan::for_file(file_id),
))),
WingSpan::for_file(file_id),
))),
arg_list: ArgList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/builtins.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand All @@ -97,7 +97,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/capture_token.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
4 changes: 2 additions & 2 deletions libs/wingc/src/jsify/snapshots/closure_field.snap
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down Expand Up @@ -184,7 +184,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/enum_value.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/func_returns_func.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/indirect_capture.snap
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/inline_inflight_class.snap
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/json_object.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
4 changes: 2 additions & 2 deletions libs/wingc/src/jsify/snapshots/lift_inflight_closure.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand All @@ -98,7 +98,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
2 changes: 1 addition & 1 deletion libs/wingc/src/jsify/snapshots/lift_string.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class $Root extends $stdlib.std.Resource {
_hash = require('crypto').createHash('md5').update(this._toInflight()).digest('hex');
constructor($scope, $id, ) {
super($scope, $id);
(std.Node.of(this)).hidden = true;
$helpers.nodeof(this).hidden = true;
}
static _toInflightType() {
return `
Expand Down
Loading

0 comments on commit 62f0b2e

Please sign in to comment.