|
| 1 | +let escaped = "a\nb\rc" |
| 2 | +let raw = #"\n"# |
| 3 | +let multiline = """ |
| 4 | + aa| |
| 5 | + bb |
| 6 | + """ |
| 7 | +let interpolated = "a\(raw)b" |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +sourceFile |
| 12 | + endOfFileToken: endOfFile |
| 13 | + statements: |
| 14 | + codeBlockItem |
| 15 | + item: |
| 16 | + variableDecl |
| 17 | + attributes: |
| 18 | + modifiers: |
| 19 | + bindingSpecifier: let |
| 20 | + bindings: |
| 21 | + patternBinding |
| 22 | + initializer: |
| 23 | + initializerClause |
| 24 | + equal: = |
| 25 | + value: |
| 26 | + stringLiteralExpr |
| 27 | + closingQuote: " |
| 28 | + openingQuote: " |
| 29 | + segments: |
| 30 | + stringSegment |
| 31 | + content: stringSegment "a\\n" |
| 32 | + stringSegment |
| 33 | + content: stringSegment "b\\r" |
| 34 | + stringSegment |
| 35 | + content: stringSegment "c" |
| 36 | + pattern: |
| 37 | + identifierPattern |
| 38 | + identifier: identifier "escaped" |
| 39 | + codeBlockItem |
| 40 | + item: |
| 41 | + variableDecl |
| 42 | + attributes: |
| 43 | + modifiers: |
| 44 | + bindingSpecifier: let |
| 45 | + bindings: |
| 46 | + patternBinding |
| 47 | + initializer: |
| 48 | + initializerClause |
| 49 | + equal: = |
| 50 | + value: |
| 51 | + stringLiteralExpr |
| 52 | + closingPounds: rawStringPoundDelimiter "#" |
| 53 | + openingPounds: rawStringPoundDelimiter "#" |
| 54 | + closingQuote: " |
| 55 | + openingQuote: " |
| 56 | + segments: |
| 57 | + stringSegment |
| 58 | + content: stringSegment "\\n" |
| 59 | + pattern: |
| 60 | + identifierPattern |
| 61 | + identifier: identifier "raw" |
| 62 | + codeBlockItem |
| 63 | + item: |
| 64 | + variableDecl |
| 65 | + attributes: |
| 66 | + modifiers: |
| 67 | + bindingSpecifier: let |
| 68 | + bindings: |
| 69 | + patternBinding |
| 70 | + initializer: |
| 71 | + initializerClause |
| 72 | + equal: = |
| 73 | + value: |
| 74 | + stringLiteralExpr |
| 75 | + closingQuote: """ |
| 76 | + openingQuote: """ |
| 77 | + segments: |
| 78 | + stringSegment |
| 79 | + content: stringSegment "aa|\n" |
| 80 | + stringSegment |
| 81 | + content: stringSegment "bb" |
| 82 | + pattern: |
| 83 | + identifierPattern |
| 84 | + identifier: identifier "multiline" |
| 85 | + codeBlockItem |
| 86 | + item: |
| 87 | + variableDecl |
| 88 | + attributes: |
| 89 | + modifiers: |
| 90 | + bindingSpecifier: let |
| 91 | + bindings: |
| 92 | + patternBinding |
| 93 | + initializer: |
| 94 | + initializerClause |
| 95 | + equal: = |
| 96 | + value: |
| 97 | + stringLiteralExpr |
| 98 | + closingQuote: " |
| 99 | + openingQuote: " |
| 100 | + segments: |
| 101 | + stringSegment |
| 102 | + content: stringSegment "a" |
| 103 | + expressionSegment |
| 104 | + leftParen: ( |
| 105 | + rightParen: ) |
| 106 | + backslash: \ |
| 107 | + expressions: |
| 108 | + labeledExpr |
| 109 | + expression: |
| 110 | + declReferenceExpr |
| 111 | + baseName: identifier "raw" |
| 112 | + stringSegment |
| 113 | + content: stringSegment "b" |
| 114 | + pattern: |
| 115 | + identifierPattern |
| 116 | + identifier: identifier "interpolated" |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +top_level source="⟨body⟩" |
| 121 | + body: |
| 122 | + block source="⟨stmt⟩\n⟨stmt⟩\n⟨stmt⟩\n⟨stmt⟩" |
| 123 | + stmt: |
| 124 | + variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩" |
| 125 | + modifier: modifier "let" source="let" |
| 126 | + pattern: identifier "escaped" source="escaped" |
| 127 | + value: |
| 128 | + string_interpolation_expr source="\"⟨element⟩⟨element⟩⟨element⟩\"" |
| 129 | + element: |
| 130 | + string_literal "a\\n" source="a\\n" |
| 131 | + string_literal "b\\r" source="b\\r" |
| 132 | + string_literal "c" source="c" |
| 133 | + variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩" |
| 134 | + modifier: modifier "let" source="let" |
| 135 | + pattern: identifier "raw" source="raw" |
| 136 | + value: string_literal "#\"\\n\"#" source="#\"\\n\"#" |
| 137 | + variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩" |
| 138 | + modifier: modifier "let" source="let" |
| 139 | + pattern: identifier "multiline" source="multiline" |
| 140 | + value: |
| 141 | + string_interpolation_expr source="\"\"\"\n ⟨element⟩ ⟨element⟩\n \"\"\"" |
| 142 | + element: |
| 143 | + string_literal "aa|\n" source="aa|\n" |
| 144 | + string_literal "bb" source="bb" |
| 145 | + variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩" |
| 146 | + modifier: modifier "let" source="let" |
| 147 | + pattern: identifier "interpolated" source="interpolated" |
| 148 | + value: |
| 149 | + string_interpolation_expr source="\"⟨element⟩⟨element⟩⟨element⟩\"" |
| 150 | + element: |
| 151 | + string_literal "a" source="a" |
| 152 | + call_expr source="\\(⟨argument⟩)" |
| 153 | + callee: builtin_expr "interpolation" source="" |
| 154 | + argument: |
| 155 | + argument source="⟨value⟩" |
| 156 | + value: identifier "raw" source="raw" |
| 157 | + string_literal "b" source="b" |
0 commit comments