Skip to content

Commit 4872c73

Browse files
authored
Add note on traversal order for bound nodes (#80872)
1 parent 3eae1b8 commit 4872c73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/compilers/Design/Bound Node Design.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Generally speaking, that means that there is an isomorphism between the syntax a
99
1. Parenthesized expressions do not appear in the bound nodes because they have no semantic meaning.
1010
2. Query expressions are given a semantic meaning by correspondence to a translated form, so the bound nodes may model the translated form.
1111

12+
Default visit order for bound nodes should match order of evaluation, which usually matches lexical order.
13+
1214
### Bound nodes should capture all semantic information embedded in the syntax
1315

1416
A consumer of the bound nodes should not need to examine the syntax from which they were produced to understand the meaning of the bound nodes. All relevant semantic information that comes from the syntax should be summarized in the fields of the bound node. If a consumer of a bound node needs to refer to the syntax to affect the meaning of the code, that is a design smell.

0 commit comments

Comments
 (0)