You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/compute-engine/types-kernel-serialization.ts
+30-26Lines changed: 30 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -150,47 +150,51 @@ export type ReplaceOptions = {
150
150
iterationLimit: number;
151
151
152
152
/**
153
-
* Specify the canonical-status of _replaced_ sub-expressions.
153
+
* Canonical-status of replaced sub-expressions.
154
154
*
155
-
* The specified canonical value/form may propagate upward to the input expression/root according
156
-
* to 'eager' replacement polcicy. See `replace()` documentation for details.
155
+
* Equivalent to `form`: `true` maps to `'canonical'`, `false` to `'raw'`,
156
+
* and a `CanonicalForm` (or array of them) is used as-is. Specifying both
157
+
* `canonical` and `form` is an error.
157
158
*
158
-
159
-
/**
160
-
* @deprecated This is a legacy property: see option `form` for a wider span of forms.
159
+
* @deprecated Use `form` instead, which covers a wider range of forms.
161
160
*/
162
161
canonical?: CanonicalOptions;
163
162
164
163
/**
165
-
* `form` policy for *replaced* expressions. \
164
+
* The form (`'canonical'`, `'structural'`, `'raw'`, or specific canonical
165
+
* transforms) applied to *replaced* sub-expressions.
166
+
*
167
+
* The form does not automatically apply to the entire input expression.
168
+
* However, a non-`'raw'` form propagates upward through the expression tree:
169
+
* an expression whose operands all share a form after replacement assumes
170
+
* that form as well.
166
171
*
167
-
* (If there is a recursive replacement -) Does not automatically apply to the entire input expression... However, the present `replace()` policy is to 'eagerly' propagate any specified replaced-expression replacement form the entire way 'up' an expression-tree.
168
-
* A value of
172
+
* To guarantee a form for the *entire* result, either ensure the input is
173
+
* already in the requested form before replacing, or request the form on the
174
+
* result after replacement (e.g. with `.canonical`).
169
175
*
170
-
* If wishing to therefore ensure a the requested form for the *entire input* expression, either
171
-
* ensure the input is already in the requested form before any replacement, or simply request the
172
-
* form post-replacement.
176
+
* If no `form` (or `canonical`) option is specified, the form of each
177
+
* replacement is determined by the rule itself: see `replace()`.
173
178
*
174
-
* ::Additional notes
175
-
* - form `'raw'` loses its applicability if the replaced expression - according to replacement mechanics - already assumes a form according to
176
-
* replacement rule logic. (for example if the applying rule is of type `RuleFunction` and the
177
-
* produced expression has a non-raw form).
179
+
* Note: a `'raw'` form does not undo a form the replacement already has,
180
+
* e.g. when a `RuleFunction` returns an expression that is already
181
+
* canonical.
178
182
*/
179
183
form: FormOption;
180
184
181
-
/** *Traversal* direction (through the node 'tree') for both Rule matching & replacement.
182
-
* Can be significant in the production of the final, overall replacement result (if operating
183
-
* recursively) - if rule is a `RuleFunction` with arbitrary logic (e.g. replacements being
184
-
* index-based).
185
-
*
186
-
* In 'tree' data-structure traversal terminology, possible values span:
185
+
/**
186
+
* Traversal direction through the expression tree, for both rule matching
0 commit comments