|
| 1 | +#expect(value == 42) |
| 2 | + |
| 3 | +#custom<Int>(value) { |
| 4 | + value |
| 5 | +} completion: { |
| 6 | + value |
| 7 | +} |
| 8 | + |
| 9 | +#Preview { |
| 10 | + let previewValue = 42 |
| 11 | + previewValue |
| 12 | +} |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +sourceFile |
| 17 | + endOfFileToken: endOfFile |
| 18 | + statements: |
| 19 | + codeBlockItem |
| 20 | + item: |
| 21 | + macroExpansionExpr |
| 22 | + leftParen: ( |
| 23 | + rightParen: ) |
| 24 | + arguments: |
| 25 | + labeledExpr |
| 26 | + expression: |
| 27 | + infixOperatorExpr |
| 28 | + operator: |
| 29 | + binaryOperatorExpr |
| 30 | + operator: binaryOperator "==" |
| 31 | + leftOperand: |
| 32 | + declReferenceExpr |
| 33 | + baseName: identifier "value" |
| 34 | + rightOperand: |
| 35 | + integerLiteralExpr |
| 36 | + literal: integerLiteral "42" |
| 37 | + additionalTrailingClosures: |
| 38 | + macroName: identifier "expect" |
| 39 | + pound: # |
| 40 | + codeBlockItem |
| 41 | + item: |
| 42 | + macroExpansionExpr |
| 43 | + leftParen: ( |
| 44 | + rightParen: ) |
| 45 | + arguments: |
| 46 | + labeledExpr |
| 47 | + expression: |
| 48 | + declReferenceExpr |
| 49 | + baseName: identifier "value" |
| 50 | + additionalTrailingClosures: |
| 51 | + multipleTrailingClosureElement |
| 52 | + colon: : |
| 53 | + label: identifier "completion" |
| 54 | + closure: |
| 55 | + closureExpr |
| 56 | + leftBrace: { |
| 57 | + rightBrace: } |
| 58 | + statements: |
| 59 | + codeBlockItem |
| 60 | + item: |
| 61 | + declReferenceExpr |
| 62 | + baseName: identifier "value" |
| 63 | + trailingClosure: |
| 64 | + closureExpr |
| 65 | + leftBrace: { |
| 66 | + rightBrace: } |
| 67 | + statements: |
| 68 | + codeBlockItem |
| 69 | + item: |
| 70 | + declReferenceExpr |
| 71 | + baseName: identifier "value" |
| 72 | + genericArgumentClause: |
| 73 | + genericArgumentClause |
| 74 | + arguments: |
| 75 | + genericArgument |
| 76 | + argument: |
| 77 | + identifierType |
| 78 | + name: identifier "Int" |
| 79 | + leftAngle: < |
| 80 | + rightAngle: > |
| 81 | + macroName: identifier "custom" |
| 82 | + pound: # |
| 83 | + codeBlockItem |
| 84 | + item: |
| 85 | + macroExpansionExpr |
| 86 | + arguments: |
| 87 | + additionalTrailingClosures: |
| 88 | + trailingClosure: |
| 89 | + closureExpr |
| 90 | + leftBrace: { |
| 91 | + rightBrace: } |
| 92 | + statements: |
| 93 | + codeBlockItem |
| 94 | + item: |
| 95 | + variableDecl |
| 96 | + attributes: |
| 97 | + modifiers: |
| 98 | + bindingSpecifier: let |
| 99 | + bindings: |
| 100 | + patternBinding |
| 101 | + initializer: |
| 102 | + initializerClause |
| 103 | + equal: = |
| 104 | + value: |
| 105 | + integerLiteralExpr |
| 106 | + literal: integerLiteral "42" |
| 107 | + pattern: |
| 108 | + identifierPattern |
| 109 | + identifier: identifier "previewValue" |
| 110 | + codeBlockItem |
| 111 | + item: |
| 112 | + declReferenceExpr |
| 113 | + baseName: identifier "previewValue" |
| 114 | + macroName: identifier "Preview" |
| 115 | + pound: # |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +top_level source="⟨body⟩" |
| 120 | + body: |
| 121 | + block source="⟨stmt⟩\n\n⟨stmt⟩\n\n⟨stmt⟩" |
| 122 | + stmt: |
| 123 | + macro_call_expr source="#⟨macro_name_node⟩(⟨argument⟩)" |
| 124 | + macro_name_node: identifier "expect" source="expect" |
| 125 | + argument: |
| 126 | + argument source="⟨value⟩" |
| 127 | + value: |
| 128 | + binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩" |
| 129 | + left: identifier "value" source="value" |
| 130 | + operator: infix_operator "==" source="==" |
| 131 | + right: int_literal "42" source="42" |
| 132 | + macro_call_expr source="#⟨macro_name_node⟩<⟨type_argument⟩>(⟨argument⟩) ⟨argument⟩ ⟨argument⟩" |
| 133 | + macro_name_node: identifier "custom" source="custom" |
| 134 | + type_argument: identifier "Int" source="Int" |
| 135 | + argument: |
| 136 | + argument source="⟨value⟩" |
| 137 | + value: identifier "value" source="value" |
| 138 | + argument source="⟨value⟩" |
| 139 | + value: |
| 140 | + function_expr source="{\n ⟨body⟩\n}" |
| 141 | + body: |
| 142 | + block source="⟨stmt⟩" |
| 143 | + stmt: identifier "value" source="value" |
| 144 | + argument source="⟨name_node⟩: ⟨value⟩" |
| 145 | + name_node: identifier "completion" source="completion" |
| 146 | + value: |
| 147 | + function_expr source="{\n ⟨body⟩\n}" |
| 148 | + body: |
| 149 | + block source="⟨stmt⟩" |
| 150 | + stmt: identifier "value" source="value" |
| 151 | + macro_call_expr source="#⟨macro_name_node⟩ ⟨argument⟩" |
| 152 | + macro_name_node: identifier "Preview" source="Preview" |
| 153 | + argument: |
| 154 | + argument source="⟨value⟩" |
| 155 | + value: |
| 156 | + function_expr source="{\n ⟨body⟩\n}" |
| 157 | + body: |
| 158 | + block source="⟨stmt⟩\n ⟨stmt⟩" |
| 159 | + stmt: |
| 160 | + variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩" |
| 161 | + modifier: modifier "let" source="let" |
| 162 | + pattern: identifier "previewValue" source="previewValue" |
| 163 | + value: int_literal "42" source="42" |
| 164 | + identifier "previewValue" source="previewValue" |
0 commit comments