This reverts commit 65a3c2b36a.
It was merged by accident with a dependent change. Will re-land
independently.
No files matched your search
@@ -37,7 +37,7 @@ documentation to see how to use the bundle.
|
||||
## Samples
|
||||
|
||||
`Samples/` holds Carbon sources that exercise the grammar, each with an SVG
|
||||
rendering of the scopes this bundle gives it. Some deliberately contain invalid
|
||||
rendering of how this bundle highlights it. Some deliberately contain invalid
|
||||
code, to show that highlighting stays sensible while something is being typed.
|
||||
|
||||
The renderings are generated, not screenshotted, so they always reflect the
|
||||
@@ -47,13 +47,3 @@ the grammar, so a reviewer can see what the change does to real code:
|
||||
```shell
|
||||
utils/textmate/render_sample.py utils/textmate/Samples/*.carbon
|
||||
```
|
||||
|
||||
The colors are a palette built for this grammar rather than an editor's theme.
|
||||
Each family of related scopes gets one color, and bold, italic, and underline
|
||||
distinguish the scopes within a family. Every scope the grammar picks from
|
||||
context renders differently, so a change to what the grammar scopes is visible
|
||||
in the image. Scopes that follow from the spelling alone, such as a bracket's
|
||||
shape, can share a rendering, since the text already shows them. Unscoped text
|
||||
is dimmer than any scope's color, so text the grammar misses stands out. A scope
|
||||
with no entry of its own takes its family's color and style, so give a new
|
||||
context-dependent scope an entry of its own.
|
||||
@@ -1,13 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="712" height="195" viewBox="0 0 712 195">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086">1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086">2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086">3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086">4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086">5 </tspan><tspan fill="#cba6f7">choice</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">SomeChoice</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086">6 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#eba0ac" font-weight="bold">Val1</tspan><tspan fill="#74c7ec">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086">7 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#eba0ac" font-weight="bold">Val2</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">array</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">5</tspan><tspan fill="#74c7ec">),</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">t</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086">8 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#eba0ac" font-weight="bold">Val3</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086">9 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681">1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681">2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681">3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681">4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681">5 </tspan><tspan fill="#569cd6">choice</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">SomeChoice</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">) {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681">6 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Val1</tspan><tspan fill="#d4d4d4">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681">7 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Val2</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">array</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#b5cea8">5</tspan><tspan fill="#d4d4d4">), </tspan><tspan fill="#9cdcfe">t</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681">8 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Val3</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681">9 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -8,8 +8,6 @@
|
||||
//@dump-sem-ir-begin
|
||||
//@dump-sem-ir-end
|
||||
//@include-in-dumps
|
||||
//@include-in-dumps
|
||||
//@dump-sem-ir-begin with trailing text is an ordinary comment
|
||||
//@dump-sem-ir-
|
||||
//no whitespace after double slash
|
||||
/* invalid comment pattern. */
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="366" viewBox="0 0 721 366">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="328" viewBox="0 0 721 328">
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> This is a comment.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Comment with whitespace.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> class C; fn F[T: A](a: T) -> i32 { return 86; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-weight="bold">@dump-sem-ir-begin</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-weight="bold">@dump-sem-ir-end</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-weight="bold">@include-in-dumps</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-weight="bold">@include-in-dumps</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic">@dump-sem-ir-begin with trailing text is an ordinary comment</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic">@dump-sem-ir-</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic">no whitespace after double slash</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#94e2d5">/*</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">invalid</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">comment</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">pattern</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">*/</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic">/ invalid comment pattern.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Comment after a statement/expression/declaration.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Trailing, with no space before the introducer.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#6a9955">// This is a comment.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#6a9955">// Comment with whitespace.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#6a9955">// class C; fn F[T: A](a: T) -> i32 { return 86; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#6a9955">//</tspan><tspan fill="#569cd6">@dump-sem-ir-begin</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#6a9955">//</tspan><tspan fill="#569cd6">@dump-sem-ir-end</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#6a9955">//</tspan><tspan fill="#569cd6">@include-in-dumps</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#6a9955">//@dump-sem-ir-</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan><tspan fill="#6a9955">//no whitespace after double slash</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#d4d4d4">/* </tspan><tspan fill="#9cdcfe">invalid</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">comment</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">pattern</tspan><tspan fill="#d4d4d4">. */</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#6a9955">/// invalid comment pattern.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4">; </tspan><tspan fill="#6a9955">// Comment after a statement/expression/declaration.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">;</tspan><tspan fill="#6a9955">// Trailing, with no space before the introducer.</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -1,15 +1,15 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="233" viewBox="0 0 721 233">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#cba6f7">package</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">SomePackage</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan><tspan fill="#f9e2af" font-weight="bold">Core</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">SomeCore</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">SomePackage</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#89b4fa">CallFunction</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">a</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">b</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">c</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">d</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#cdd6f4">unidentified</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#569cd6">package</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">SomePackage</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan><tspan fill="#4ec9b0">Core</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">SomeCore</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#569cd6">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">SomePackage</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#dcdcaa">CallFunction</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">c</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">d</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#9cdcfe">unidentified</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -28,7 +28,6 @@ generic a: T = b;
|
||||
a: A in some_list;
|
||||
var a: T;
|
||||
let b: T;
|
||||
let unused c: T = d;
|
||||
binding: T;
|
||||
generic binding: T;
|
||||
var
|
||||
@@ -51,17 +50,3 @@ r#class
|
||||
r#if
|
||||
r#i32
|
||||
var r#var: i32 = r#class;
|
||||
|
||||
// --- member access through a pointer
|
||||
|
||||
p->field;
|
||||
p->Method(a);
|
||||
p->0;
|
||||
(*p).field;
|
||||
t.0.1;
|
||||
q.value()->size();
|
||||
|
||||
// --- builtin function definitions
|
||||
|
||||
fn Add(a: i32, b: i32) -> i32 = "int.sadd";
|
||||
fn Bits(n: IntLiteral) -> type = "int.make_type_signed";
|
||||
@@ -1,71 +1,56 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1297" viewBox="0 0 721 1297">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1012" viewBox="0 0 721 1012">
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F1</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Func</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Generic</tspan><tspan fill="#74c7ec">[</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">U</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">I</tspan><tspan fill="#74c7ec">](</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">U</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">U</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Lambda</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">a</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">5</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#cba6f7">fn</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">MultiLine</tspan><tspan fill="#74c7ec">[</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">A</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">B</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C1</tspan><tspan fill="#74c7ec">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">C</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C2</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">](</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af">B</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C</tspan><tspan fill="#74c7ec">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">B</tspan><tspan fill="#74c7ec">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">c</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Invalid</tspan><tspan fill="#a6adc8">#</tspan><tspan fill="#94e2d5">+?</tspan><tspan fill="#89b4fa">Name</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#74c7ec">.(</tspan><tspan fill="#cdd6f4">I</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">F</tspan><tspan fill="#74c7ec">)()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">b</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">array</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">5</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan><tspan fill="#cba6f7" font-style="italic">generic</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#cba6f7" font-style="italic">generic</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">b</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">in</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">some_list</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6c7086">30 </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6c7086">31 </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">unused </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">c</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">d</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6c7086">32 </tspan><tspan fill="#cdd6f4" font-style="italic">binding</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6c7086">33 </tspan><tspan fill="#cba6f7" font-style="italic">generic</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">binding</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6c7086">34 </tspan><tspan fill="#cba6f7">var</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6c7086">35 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">multiline</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6c7086">36 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6c7086">37 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cba6f7" font-style="italic">ref</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">const</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">ref</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">B</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6c7086">38 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6c7086">39 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">T</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">U</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">val</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6c7086">40 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">val</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6c7086">41 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6c7086">42 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- lambdas and positional parameters</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6c7086">43 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6c7086">44 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">explicit</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">auto</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6c7086">45 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">expression</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">auto</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6c7086">46 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">positional</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">auto</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">Print</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">$0</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">$1</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">$42</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6c7086">47 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6c7086">48 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- raw identifiers</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6c7086">49 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6c7086">50 </tspan><tspan fill="#74c7ec" font-weight="bold" font-style="italic">r#</tspan><tspan fill="#cdd6f4">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6c7086">51 </tspan><tspan fill="#74c7ec" font-weight="bold" font-style="italic">r#</tspan><tspan fill="#cdd6f4">if</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6c7086">52 </tspan><tspan fill="#74c7ec" font-weight="bold" font-style="italic">r#</tspan><tspan fill="#cdd6f4">i32</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6c7086">53 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-weight="bold" font-style="italic">r#</tspan><tspan fill="#cdd6f4">var</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-weight="bold" font-style="italic">r#</tspan><tspan fill="#cdd6f4">class</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6c7086">54 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6c7086">55 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- member access through a pointer</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1071"><tspan fill="#6c7086">56 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1090"><tspan fill="#6c7086">57 </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">-></tspan><tspan fill="#eba0ac" font-style="italic">field</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1109"><tspan fill="#6c7086">58 </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">-></tspan><tspan fill="#89b4fa" font-style="italic">Method</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">a</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1128"><tspan fill="#6c7086">59 </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">-></tspan><tspan fill="#fab387">0</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1147"><tspan fill="#6c7086">60 </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#94e2d5">*</tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#eba0ac" font-style="italic">field</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1166"><tspan fill="#6c7086">61 </tspan><tspan fill="#cdd6f4">t</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#fab387">0</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1185"><tspan fill="#6c7086">62 </tspan><tspan fill="#cdd6f4">q</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-style="italic">value</tspan><tspan fill="#74c7ec">()-></tspan><tspan fill="#89b4fa" font-style="italic">size</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1204"><tspan fill="#6c7086">63 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1223"><tspan fill="#6c7086">64 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- builtin function definitions</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1242"><tspan fill="#6c7086">65 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1261"><tspan fill="#6c7086">66 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Add</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#89b4fa" font-weight="bold" font-style="italic">int.sadd</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1280"><tspan fill="#6c7086">67 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Bits</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">n</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">IntLiteral</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#89b4fa" font-weight="bold" font-style="italic">int.make_type_signed</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F1</tspan><tspan fill="#d4d4d4">();</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Func</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Generic</tspan><tspan fill="#d4d4d4">[</tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">U</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">](</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">U</tspan><tspan fill="#d4d4d4">) -> </tspan><tspan fill="#4ec9b0">U</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Lambda</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">) -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> => </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4"> + </tspan><tspan fill="#b5cea8">5</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#569cd6">fn</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">MultiLine</tspan><tspan fill="#d4d4d4">[</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">C1</tspan><tspan fill="#d4d4d4">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">C2</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan><tspan fill="#d4d4d4"> ](</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#dcdcaa">A</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">,</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">c</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Invalid</tspan><tspan fill="#d4d4d4">#+?</tspan><tspan fill="#dcdcaa">Name</tspan><tspan fill="#d4d4d4">();</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4">.(</tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#4ec9b0">F</tspan><tspan fill="#d4d4d4">)();</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4"> = (</tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">array</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#b5cea8">5</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan><tspan fill="#569cd6">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#569cd6">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">in</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">some_list</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6e7681">30 </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6e7681">31 </tspan><tspan fill="#9cdcfe">binding</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6e7681">32 </tspan><tspan fill="#569cd6">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">binding</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6e7681">33 </tspan><tspan fill="#569cd6">var</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6e7681">34 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">multiline</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6e7681">35 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6e7681">36 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#569cd6">ref</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#569cd6">const</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">ref</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6e7681">37 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6e7681">38 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#4ec9b0">U</tspan><tspan fill="#d4d4d4"> { </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">val</tspan><tspan fill="#d4d4d4">; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6e7681">39 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> => </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">val</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#6a9955">// --- lambdas and positional parameters</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6e7681">42 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6e7681">43 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">explicit</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">auto</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">) -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> { </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4"> + </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">; };</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6e7681">44 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">expression</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">auto</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">) => </tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4"> + </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6e7681">45 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">positional</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">auto</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> { </tspan><tspan fill="#dcdcaa">Print</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#9cdcfe">$0</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">$1</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">$42</tspan><tspan fill="#d4d4d4">); };</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6e7681">46 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6e7681">47 </tspan><tspan fill="#6a9955">// --- raw identifiers</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6e7681">48 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6e7681">49 </tspan><tspan fill="#d4d4d4">r#</tspan><tspan fill="#9cdcfe">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6e7681">50 </tspan><tspan fill="#d4d4d4">r#</tspan><tspan fill="#9cdcfe">if</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6e7681">51 </tspan><tspan fill="#d4d4d4">r#</tspan><tspan fill="#9cdcfe">i32</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6e7681">52 </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> r#</tspan><tspan fill="#9cdcfe">var</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> = r#</tspan><tspan fill="#9cdcfe">class</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 14 KiB |
@@ -1,33 +1,33 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="730" height="575" viewBox="0 0 730 575">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan><tspan fill="#7f849c">//</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Inline C++ is scoped `meta.embedded.block.cpp`, so an editor that has a C++</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> grammar highlights them as C++; these renderings come from the Carbon grammar</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> alone, so that content shows plain.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#cba6f7">package</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">Sample</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">library</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#f5e0dc" font-weight="bold">interop</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">library</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#f5e0dc" font-weight="bold"><cstdio></tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">library</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#f5e0dc" font-weight="bold"><string_view></tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">inline</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#f5e0dc" font-style="italic">c++</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#a6adc8" font-style="italic">int FromImport() { return 1; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">inline</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6adc8" font-style="italic">int OneLiner() { return 2; }</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#cba6f7">inline</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan><tspan fill="#a6adc8" font-style="italic">int FromBlock() { return 3; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Uses</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">value</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">int</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">int</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">widened</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">size_t</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">value</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">size_t</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">back</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">value</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">unsafe</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-style="italic">printf</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">%d</tspan><tspan fill="#f5c2e7">\n</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">value</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan><tspan fill="#6a9955">//</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#6a9955">// Inline C++ is scoped `meta.embedded.block.cpp`, so an editor that has a C++</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan><tspan fill="#6a9955">// grammar highlights them as C++; these renderings come from the Carbon grammar</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#6a9955">// alone, so that content shows plain.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#569cd6">package</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Sample</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"interop"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#569cd6">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"<cstdio>"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan><tspan fill="#569cd6">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"<string_view>"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#569cd6">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> '''</tspan><tspan fill="#569cd6">c++</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#d4d4d4">int FromImport() { return 1; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan><tspan fill="#d4d4d4">''';</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#569cd6">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> "int OneLiner() { return 2; }";</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4"> '''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan><tspan fill="#d4d4d4">int FromBlock() { return 3; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#d4d4d4">''';</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Uses</tspan><tspan fill="#d4d4d4">() {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">value</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">int</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">int</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">widened</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">size_t</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#9cdcfe">value</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">size_t</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">back</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#9cdcfe">value</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">unsafe</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#dcdcaa">printf</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#ce9178">"%d</tspan><tspan fill="#d7ba7d">\n</tspan><tspan fill="#ce9178">"</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">value</tspan><tspan fill="#d4d4d4">);</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 6.9 KiB |
@@ -1,59 +1,59 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1069" viewBox="0 0 721 1069">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- operators</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#94e2d5">>>=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><=></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><<=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">->?</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">&=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">^=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">:=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">:?</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">==</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">!=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">>=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">>></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><<</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><-</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">--</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">%=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">|=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">++</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">/=</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#94e2d5">*=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">~=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">&</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">@</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">^</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">!</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5"><</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">%</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">|</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">?</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">/</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">*</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">~</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">\</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#f38ba8">and</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">in</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">like</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">not</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">or</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">typeof</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- special-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#f38ba8">break</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">case</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">continue</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">else</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">if</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">for</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">match</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">returned</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">then</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">while</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#f38ba8">default</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=></tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- introducer-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#cba6f7">adapt</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">alias</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">choice</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">constraint</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">import</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">inline</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">interface</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">library</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan><tspan fill="#cba6f7">match_first</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">namespace</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">observe</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">require</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#cba6f7">base</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan><tspan fill="#cba6f7">export</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#cba6f7">impl</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan><tspan fill="#cba6f7">package</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- modifier-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#cba6f7" font-style="italic">abstract</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">const</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">eval</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">extend</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">extern</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">final</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">generic</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">musteval</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">override</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">partial</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan><tspan fill="#cba6f7" font-style="italic">private</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">protected</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">ref</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">runtime</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">static</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">template</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">unsafe</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">unused</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">val</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">virtual</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan><tspan fill="#cba6f7" font-style="italic">base</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6c7086">30 </tspan><tspan fill="#cba6f7" font-style="italic">default</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6c7086">31 </tspan><tspan fill="#cba6f7" font-style="italic">export</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">import</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6c7086">32 </tspan><tspan fill="#cba6f7" font-style="italic">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6c7086">33 </tspan><tspan fill="#cba6f7" font-style="italic">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">library</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6c7086">34 </tspan><tspan fill="#cba6f7" font-style="italic">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">package</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6c7086">35 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6c7086">36 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- misc-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6c7086">37 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6c7086">38 </tspan><tspan fill="#94e2d5" font-style="italic">destroy</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">each</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">expand</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">forall</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">form</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">friend</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6c7086">39 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">destroy</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6c7086">40 </tspan><tspan fill="#74c7ec">...</tspan><tspan fill="#94e2d5" font-style="italic">expand</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6c7086">41 </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#94e2d5" font-style="italic">base</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6c7086">42 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6c7086">43 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- self-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6c7086">44 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6c7086">45 </tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6c7086">46 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6c7086">47 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- package-roots</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6c7086">48 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6c7086">49 </tspan><tspan fill="#f9e2af" font-weight="bold">Core</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6c7086">50 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6c7086">51 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- underscore</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6c7086">52 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6c7086">53 </tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6c7086">54 </tspan><tspan fill="#cdd6f4" font-weight="bold">_</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6c7086">55 </tspan><tspan fill="#cdd6f4">_some_var</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#6a9955">// --- operators</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#d4d4d4">>>= <=> <<= ->? &= ^= := :? == => != >= >> <= <> << <- -= -> -- %= |= += ++ /=</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#d4d4d4">*= ~= & @ ^ : = ! > < - % . | + ? / * ~ \</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#c586c0">and</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">impls</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">in</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">like</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">not</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">or</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">typeof</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">where</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#6a9955">// --- special-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#c586c0">break</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">case</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">continue</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">else</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">if</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">for</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">match</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">returned</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">then</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">while</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#c586c0">default</tspan><tspan fill="#d4d4d4"> =></tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan><tspan fill="#6a9955">// --- introducer-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#569cd6">adapt</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">alias</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">choice</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">constraint</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">import</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">interface</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan><tspan fill="#569cd6">match_first</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">namespace</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">observe</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">require</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#569cd6">base</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan><tspan fill="#569cd6">export</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#569cd6">impl</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan><tspan fill="#569cd6">package</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan><tspan fill="#6a9955">// --- modifier-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#569cd6">abstract</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">const</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">eval</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">extend</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">extern</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">final</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">musteval</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">override</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">partial</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan><tspan fill="#569cd6">private</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">protected</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">ref</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">runtime</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">static</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">template</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">unsafe</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">unused</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">val</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">virtual</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#569cd6">base</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6e7681">30 </tspan><tspan fill="#569cd6">default</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6e7681">31 </tspan><tspan fill="#569cd6">export</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">import</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6e7681">32 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6e7681">33 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6e7681">34 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">package</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6e7681">35 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6e7681">36 </tspan><tspan fill="#6a9955">// --- misc-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6e7681">37 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6e7681">38 </tspan><tspan fill="#569cd6">destroy</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">each</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">expand</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">forall</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">form</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">friend</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6e7681">39 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">destroy</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan><tspan fill="#d4d4d4">...</tspan><tspan fill="#569cd6">expand</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#569cd6">base</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6e7681">42 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6e7681">43 </tspan><tspan fill="#6a9955">// --- self-keywords</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6e7681">44 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6e7681">45 </tspan><tspan fill="#569cd6">self</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">Self</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6e7681">46 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6e7681">47 </tspan><tspan fill="#6a9955">// --- package-roots</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6e7681">48 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6e7681">49 </tspan><tspan fill="#4ec9b0">Core</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6e7681">50 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6e7681">51 </tspan><tspan fill="#6a9955">// --- underscore</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6e7681">52 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6e7681">53 </tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6e7681">54 </tspan><tspan fill="#569cd6">_</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6e7681">55 </tspan><tspan fill="#9cdcfe">_some_var</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
@@ -14,12 +14,6 @@
|
||||
'''py
|
||||
Block literal with a file type indicator.
|
||||
'''
|
||||
'''sql // A trailing comment on the introducer line.
|
||||
SELECT 1;
|
||||
'''
|
||||
''' // A comment with no file type indicator.
|
||||
Text.
|
||||
'''
|
||||
|
||||
#"a raw \n literal, where \#n is the escape"#
|
||||
##"nested "# stays inside, and \##n is the escape"##
|
||||
@@ -33,7 +27,6 @@
|
||||
|
||||
'a' '\n' '\0' '\u{1F600}'
|
||||
'\x70'
|
||||
"\x4F is an escape, \x4f is not"
|
||||
''
|
||||
'abcde'
|
||||
|
||||
|
||||
@@ -1,79 +1,72 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1449" viewBox="0 0 721 1449">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1316" viewBox="0 0 721 1316">
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- string</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6e3a1" font-style="italic">C</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">Hello</tspan><tspan fill="#f5c2e7">\n</tspan><tspan fill="#a6e3a1">World</tspan><tspan fill="#f5c2e7">\n</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#f5c2e7">\"\'\t\r\n</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#f5e0dc" font-style="italic">Single</tspan><tspan fill="#a6e3a1" font-weight="bold"> line string</tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#a6e3a1" font-weight="bold"> Multi line</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan><tspan fill="#a6e3a1" font-weight="bold"> string</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#f5e0dc" font-style="italic">py</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#a6e3a1" font-weight="bold"> Block literal with a file type indicator.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#f5e0dc" font-style="italic">sql</tspan><tspan fill="#a6e3a1" font-weight="bold"> </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> A trailing comment on the introducer line.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#a6e3a1" font-weight="bold"> SELECT 1;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan><tspan fill="#a6e3a1" font-weight="bold"> </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> A comment with no file type indicator.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan><tspan fill="#a6e3a1" font-weight="bold"> Text.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#74c7ec" font-style="italic">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan><tspan fill="#74c7ec" font-style="italic">#"</tspan><tspan fill="#a6e3a1">a raw \n literal, where </tspan><tspan fill="#f5c2e7">\#n</tspan><tspan fill="#a6e3a1"> is the escape</tspan><tspan fill="#74c7ec" font-style="italic">"#</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan><tspan fill="#74c7ec" font-style="italic">##"</tspan><tspan fill="#a6e3a1">nested "# stays inside, and </tspan><tspan fill="#f5c2e7">\##n</tspan><tspan fill="#a6e3a1"> is the escape</tspan><tspan fill="#74c7ec" font-style="italic">"##</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan><tspan fill="#74c7ec" font-style="italic">#'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#a6e3a1" font-weight="bold"> A raw block literal.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan><tspan fill="#74c7ec" font-style="italic">'''#</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6c7086">30 </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">unterminated</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6c7086">31 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6c7086">32 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- characters</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6c7086">33 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6c7086">34 </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6e3a1" font-style="italic">a</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#f5c2e7">\n</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#f5c2e7">\0</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#f5c2e7">\u{1F600}</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6c7086">35 </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#f5c2e7">\x70</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6c7086">36 </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#f5c2e7">\x4F</tspan><tspan fill="#a6e3a1"> is an escape, \x4f is not</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6c7086">37 </tspan><tspan fill="#74c7ec" font-style="italic">''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6c7086">38 </tspan><tspan fill="#74c7ec" font-style="italic">'</tspan><tspan fill="#a6e3a1" font-style="italic">abcde</tspan><tspan fill="#74c7ec" font-style="italic">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6c7086">39 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6c7086">40 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- true-false</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6c7086">41 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6c7086">42 </tspan><tspan fill="#cba6f7" font-weight="bold">true</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-weight="bold">false</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6c7086">43 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6c7086">44 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- type-literals</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6c7086">45 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6c7086">46 </tspan><tspan fill="#f9e2af" font-style="italic">array</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">auto</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">bool</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">char</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">str</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6c7086">47 </tspan><tspan fill="#f9e2af" font-style="italic">i8</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i16</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i64</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i128</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i10</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6c7086">48 </tspan><tspan fill="#f9e2af" font-style="italic">u8</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">u16</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">u32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">u64</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">u128</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">u11</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6c7086">49 </tspan><tspan fill="#f9e2af" font-style="italic">f8</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">f16</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">f32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">f64</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">f128</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">f12</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6c7086">50 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6c7086">51 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- numbers</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6c7086">52 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6c7086">53 </tspan><tspan fill="#fab387">12345</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">6789</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">00012345</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6c7086">54 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6c7086">55 </tspan><tspan fill="#fab387">1234.56789</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1071"><tspan fill="#6c7086">56 </tspan><tspan fill="#fab387">0.875</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1090"><tspan fill="#6c7086">57 </tspan><tspan fill="#fab387">0.3e5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1109"><tspan fill="#6c7086">58 </tspan><tspan fill="#fab387">1e5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1128"><tspan fill="#6c7086">59 </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#fab387">123</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1147"><tspan fill="#6c7086">60 </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#fab387">1e3</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1166"><tspan fill="#6c7086">61 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1185"><tspan fill="#6c7086">62 </tspan><tspan fill="#94e2d5" font-style="italic">0o</tspan><tspan fill="#fab387" font-weight="bold" font-style="italic">755</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1204"><tspan fill="#6c7086">63 </tspan><tspan fill="#94e2d5" font-style="italic">0o</tspan><tspan fill="#fab387" font-weight="bold" font-style="italic">_17</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1223"><tspan fill="#6c7086">64 </tspan><tspan fill="#94e2d5" font-style="italic">0o</tspan><tspan fill="#fab387" font-weight="bold" font-style="italic">8</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1242"><tspan fill="#6c7086">65 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1261"><tspan fill="#6c7086">66 </tspan><tspan fill="#94e2d5" font-style="italic">0b</tspan><tspan fill="#fab387" font-weight="bold">1011_0010</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1280"><tspan fill="#6c7086">67 </tspan><tspan fill="#94e2d5" font-style="italic">0b</tspan><tspan fill="#fab387" font-weight="bold">_010</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1299"><tspan fill="#6c7086">68 </tspan><tspan fill="#94e2d5" font-style="italic">0b</tspan><tspan fill="#fab387" font-weight="bold">2345</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1318"><tspan fill="#6c7086">69 </tspan><tspan fill="#fab387">0B011</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1337"><tspan fill="#6c7086">70 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1356"><tspan fill="#6c7086">71 </tspan><tspan fill="#94e2d5" font-style="italic">0x</tspan><tspan fill="#fab387" font-style="italic">2AE5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1375"><tspan fill="#6c7086">72 </tspan><tspan fill="#94e2d5" font-style="italic">0x</tspan><tspan fill="#fab387" font-style="italic">_F109</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1394"><tspan fill="#6c7086">73 </tspan><tspan fill="#94e2d5" font-style="italic">0x</tspan><tspan fill="#fab387" font-style="italic">D8_E2.5F_7Bp8</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1413"><tspan fill="#6c7086">74 </tspan><tspan fill="#94e2d5" font-style="italic">0x</tspan><tspan fill="#fab387" font-style="italic">abcdef.abcdef</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1432"><tspan fill="#6c7086">75 </tspan><tspan fill="#fab387">0XA85CE</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#6a9955">// --- string</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#ce9178">'C'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#ce9178">"Hello</tspan><tspan fill="#d7ba7d">\n</tspan><tspan fill="#ce9178">World</tspan><tspan fill="#d7ba7d">\n</tspan><tspan fill="#ce9178">"</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#ce9178">"</tspan><tspan fill="#d7ba7d">\"\'\t\r\n</tspan><tspan fill="#ce9178">"</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#ce9178">'''</tspan><tspan fill="#569cd6">Single</tspan><tspan fill="#ce9178"> line string'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#ce9178">''' Multi line</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan><tspan fill="#ce9178"> string</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#ce9178">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#ce9178">'''</tspan><tspan fill="#569cd6">py</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#ce9178"> Block literal with a file type indicator.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan><tspan fill="#ce9178">'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#ce9178">#"a raw \n literal, where </tspan><tspan fill="#d7ba7d">\#n</tspan><tspan fill="#ce9178"> is the escape"#</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan><tspan fill="#ce9178">##"nested "# stays inside, and </tspan><tspan fill="#d7ba7d">\##n</tspan><tspan fill="#ce9178"> is the escape"##</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#ce9178">#'''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan><tspan fill="#ce9178"> A raw block literal.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#ce9178">'''#</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan><tspan fill="#ce9178">"unterminated</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan><tspan fill="#6a9955">// --- characters</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan><tspan fill="#ce9178">'a'</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d7ba7d">\n</tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d7ba7d">\0</tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d7ba7d">\u{1F600}</tspan><tspan fill="#ce9178">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#ce9178">'</tspan><tspan fill="#d7ba7d">\x70</tspan><tspan fill="#ce9178">'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6e7681">30 </tspan><tspan fill="#ce9178">''</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6e7681">31 </tspan><tspan fill="#ce9178">'abcde'</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6e7681">32 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6e7681">33 </tspan><tspan fill="#6a9955">// --- true-false</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6e7681">34 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6e7681">35 </tspan><tspan fill="#569cd6">true</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">false</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6e7681">36 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6e7681">37 </tspan><tspan fill="#6a9955">// --- type-literals</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6e7681">38 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6e7681">39 </tspan><tspan fill="#4ec9b0">array</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">auto</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">bool</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">char</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">str</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">type</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan><tspan fill="#4ec9b0">i8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i10</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#4ec9b0">u8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">u16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">u32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">u64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">u128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">u11</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6e7681">42 </tspan><tspan fill="#4ec9b0">f8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">f16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">f32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">f64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">f128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">f12</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6e7681">43 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6e7681">44 </tspan><tspan fill="#6a9955">// --- numbers</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6e7681">45 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6e7681">46 </tspan><tspan fill="#b5cea8">12345</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#b5cea8">6789</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#b5cea8">00012345</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6e7681">47 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6e7681">48 </tspan><tspan fill="#b5cea8">1234.56789</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6e7681">49 </tspan><tspan fill="#b5cea8">0.875</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6e7681">50 </tspan><tspan fill="#b5cea8">0.3e5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6e7681">51 </tspan><tspan fill="#b5cea8">1e5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6e7681">52 </tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#b5cea8">123</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6e7681">53 </tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#b5cea8">1e3</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6e7681">54 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6e7681">55 </tspan><tspan fill="#b5cea8">0o755</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1071"><tspan fill="#6e7681">56 </tspan><tspan fill="#b5cea8">0o_17</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1090"><tspan fill="#6e7681">57 </tspan><tspan fill="#b5cea8">0o</tspan><tspan fill="#d4d4d4">8</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1109"><tspan fill="#6e7681">58 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1128"><tspan fill="#6e7681">59 </tspan><tspan fill="#b5cea8">0b1011_0010</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1147"><tspan fill="#6e7681">60 </tspan><tspan fill="#b5cea8">0b_010</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1166"><tspan fill="#6e7681">61 </tspan><tspan fill="#b5cea8">0b</tspan><tspan fill="#d4d4d4">2345</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1185"><tspan fill="#6e7681">62 </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">B011</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1204"><tspan fill="#6e7681">63 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1223"><tspan fill="#6e7681">64 </tspan><tspan fill="#b5cea8">0x2AE5</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1242"><tspan fill="#6e7681">65 </tspan><tspan fill="#b5cea8">0x_F109</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1261"><tspan fill="#6e7681">66 </tspan><tspan fill="#b5cea8">0xD8_E2.5F_7Bp8</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1280"><tspan fill="#6e7681">67 </tspan><tspan fill="#b5cea8">0xabcdef.abcdef</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1299"><tspan fill="#6e7681">68 </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">XA85CE</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,50 +1,50 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="898" viewBox="0 0 721 898">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> More single line comments</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#cba6f7">package</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">Carbon</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#cba6f7">interface</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">HasValueParam</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">V</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Go</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">HasValueParam</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">5</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Go</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">42</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">Point</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Origin</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{.</tspan><tspan fill="#eba0ac" font-style="italic">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">0</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">y</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">0</tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">y</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Procedure</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">returned</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">zoop</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">0</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">while</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#89b4fa">DoSomeJob</tspan><tspan fill="#74c7ec">())</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">zoop</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">+=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6c7086">30 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6c7086">31 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6c7086">32 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6c7086">33 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6c7086">34 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6c7086">35 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Main</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6c7086">36 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">str</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">Hello world</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6c7086">37 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">hex</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">0x</tspan><tspan fill="#fab387" font-style="italic">ABCDEF1234567890</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6c7086">38 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">bin</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">0b</tspan><tspan fill="#fab387" font-weight="bold">0000111001010010</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6c7086">39 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">dec</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">123456789012345678</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6c7086">40 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6c7086">41 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">big</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Core</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">Int</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#fab387">1024</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1234</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6c7086">42 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">aaa</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">auto</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">Carbon</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6c7086">43 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">view</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">str</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#a6e3a1">Carbon</tspan><tspan fill="#74c7ec" font-style="italic">"</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6c7086">44 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6c7086">45 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">return</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">Procedure</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6c7086">46 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#6a9955">// More single line comments</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#569cd6">package</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Carbon</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#569cd6">interface</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">HasValueParam</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">V</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">) {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Go</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#569cd6">self</tspan><tspan fill="#d4d4d4">) -> </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> () </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">HasValueParam</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#b5cea8">5</tspan><tspan fill="#d4d4d4">) {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Go</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#569cd6">self</tspan><tspan fill="#d4d4d4">) -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> { </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#b5cea8">42</tspan><tspan fill="#d4d4d4">; }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Point</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Origin</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#569cd6">Self</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> {.</tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">, .</tspan><tspan fill="#9cdcfe">y</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">};</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#d4d4d4"> }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">x</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">y</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Procedure</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">returned</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">zoop</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">while</tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#dcdcaa">DoSomeJob</tspan><tspan fill="#d4d4d4">()) {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">zoop</tspan><tspan fill="#d4d4d4"> += </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6e7681">30 </tspan><tspan fill="#d4d4d4"> }</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6e7681">31 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6e7681">32 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6e7681">33 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6e7681">34 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6e7681">35 </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Main</tspan><tspan fill="#d4d4d4">() -> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6e7681">36 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">str</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#ce9178">"Hello world"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6e7681">37 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">hex</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">0xABCDEF1234567890</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6e7681">38 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">bin</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">0b0000111001010010</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6e7681">39 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">dec</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">123456789012345678</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">big</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">Core</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#dcdcaa">Int</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#b5cea8">1024</tspan><tspan fill="#d4d4d4">) = </tspan><tspan fill="#b5cea8">1234</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6e7681">42 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">aaa</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">auto</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#ce9178">"Carbon"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6e7681">43 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">let</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">view</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">str</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#ce9178">"Carbon"</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6e7681">44 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6e7681">45 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#dcdcaa">Procedure</tspan><tspan fill="#d4d4d4">();</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6e7681">46 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 11 KiB |
@@ -30,7 +30,6 @@ interface I;
|
||||
impl C as (I(A, B, C.(D.E(F, G)).H)) {}
|
||||
impl C as I where .A = (B where .Self = {}) {}
|
||||
impl C as I where .A = {} and .B = C {}
|
||||
impl forall [T: I where .A = i32] T as J where .B = T.A {}
|
||||
impl Self as I;
|
||||
impl as I;
|
||||
|
||||
@@ -40,40 +39,3 @@ constraint Constraint {
|
||||
require impls I;
|
||||
extern require impls I;
|
||||
}
|
||||
|
||||
namespace N;
|
||||
|
||||
class N.C1 {
|
||||
fn N.C1.Make() -> Self;
|
||||
}
|
||||
alias N.A = N.C1;
|
||||
fn N.C1.Other();
|
||||
class Outer(T: type).Inner(U: type) {}
|
||||
fn Outer(T: type).Inner(U: type).F[self: Self](x: T) -> U;
|
||||
fn N.Base(N.T).Member() {}
|
||||
interface N.I2;
|
||||
constraint N.C2 {}
|
||||
|
||||
class C6 {
|
||||
fn destroy(ref self);
|
||||
}
|
||||
fn C6.destroy(ref self) {}
|
||||
|
||||
var p: C6* = &c6;
|
||||
var q: typeof(p) = p;
|
||||
var r: typeof(Make(p, (q))).Pointee = *p;
|
||||
|
||||
// --- the same names in type and expression positions
|
||||
|
||||
var o: Optional(Slice(i32)) = Optional(Slice(i32)).None();
|
||||
let origin: Point = Point.Origin();
|
||||
let t: type = Point;
|
||||
var c: Core.Int(64) = x as Core.Int(64);
|
||||
var v: Cpp.std.vector(i32) = Make(i32, Vector(Point));
|
||||
var s: {.x: i32, .y: Point} = {.x = 1, .y = p};
|
||||
var tup: (i32, Point) = (1, p);
|
||||
fn Pick[T: Hashable & Eq where .Key = i32](t: T) -> T.Key;
|
||||
fn Iter() -> Vector(T).Iterator;
|
||||
if (T == Point and x impls Hashable) {}
|
||||
alias lower = i32;
|
||||
var l: lower = a * b;
|
||||
@@ -1,83 +1,45 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1525" viewBox="0 0 721 1525">
|
||||
<rect width="100%" height="100%" fill="#1e1e2e"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="803" viewBox="0 0 721 803">
|
||||
<rect width="100%" height="100%" fill="#1f1f1f"/>
|
||||
<g xml:space="preserve" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6c7086"> 1 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6c7086"> 2 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6c7086"> 3 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6c7086"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6c7086"> 5 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6c7086"> 6 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C2</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T1</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">T2</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C1</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6c7086"> 7 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C3</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6c7086"> 8 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">extend</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">base</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">C1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6c7086"> 9 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6c7086">10 </tspan><tspan fill="#cba6f7">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6c7086">11 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#89b4fa">C4</tspan><tspan fill="#74c7ec">(</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6c7086">12 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T1</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6c7086">13 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-style="italic">T2</tspan><tspan fill="#94e2d5">:</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6c7086">14 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">A</tspan><tspan fill="#74c7ec">.(</tspan><tspan fill="#89b4fa">B</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">E</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">F</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">G</tspan><tspan fill="#74c7ec">)).</tspan><tspan fill="#eba0ac" font-style="italic">C</tspan><tspan fill="#74c7ec">)</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6c7086">15 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">D</tspan><tspan fill="#74c7ec">)))</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6c7086">16 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6c7086">17 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C5</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6c7086">18 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6c7086">19 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">extend</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6c7086">20 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6c7086">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6c7086">22 </tspan><tspan fill="#cba6f7">alias</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">a1</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">C1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6c7086">23 </tspan><tspan fill="#cba6f7">alias</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">a2</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6c7086">24 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6c7086">25 </tspan><tspan fill="#cba6f7">adapt</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">SomeClass</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6c7086">26 </tspan><tspan fill="#cba6f7">adapt</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{.</tspan><tspan fill="#eba0ac" font-style="italic">a</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">SomeClass</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">b</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6c7086">27 </tspan><tspan fill="#cba6f7">adapt</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6c7086">28 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6c7086">29 </tspan><tspan fill="#cba6f7">interface</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6c7086">30 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">A</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">B</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">C</tspan><tspan fill="#74c7ec">.(</tspan><tspan fill="#cdd6f4">D</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-style="italic">E</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">F</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">G</tspan><tspan fill="#74c7ec">)).</tspan><tspan fill="#eba0ac" font-style="italic">H</tspan><tspan fill="#74c7ec">))</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6c7086">31 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">B</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{})</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6c7086">32 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">and</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">B</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">C</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6c7086">33 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">forall</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">[</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">I</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">]</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">J</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">B</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">T</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6c7086">34 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6c7086">35 </tspan><tspan fill="#cba6f7">impl</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6c7086">36 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6c7086">37 </tspan><tspan fill="#cba6f7">constraint</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Constraint</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6c7086">38 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">require</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6c7086">39 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">require</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6c7086">40 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">require</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6c7086">41 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7" font-style="italic">extern</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">require</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">I</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="805"><tspan fill="#6c7086">42 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="824"><tspan fill="#6c7086">43 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="843"><tspan fill="#6c7086">44 </tspan><tspan fill="#cba6f7">namespace</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc">N</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="862"><tspan fill="#6c7086">45 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="881"><tspan fill="#6c7086">46 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C1</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="900"><tspan fill="#6c7086">47 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">C1</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-weight="bold">Make</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="919"><tspan fill="#6c7086">48 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="938"><tspan fill="#6c7086">49 </tspan><tspan fill="#cba6f7">alias</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">A</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">C1</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="957"><tspan fill="#6c7086">50 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">C1</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-weight="bold">Other</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="976"><tspan fill="#6c7086">51 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">Outer</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">Inner</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">U</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="995"><tspan fill="#6c7086">52 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">Outer</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">Inner</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4" font-style="italic">U</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#89b4fa" font-weight="bold">F</tspan><tspan fill="#74c7ec">[</tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">Self</tspan><tspan fill="#74c7ec">](</tspan><tspan fill="#cdd6f4" font-style="italic">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">U</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6c7086">53 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">Base</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#89b4fa" font-weight="bold">Member</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1033"><tspan fill="#6c7086">54 </tspan><tspan fill="#cba6f7">interface</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">I2</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1052"><tspan fill="#6c7086">55 </tspan><tspan fill="#cba6f7">constraint</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">N</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">C2</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1071"><tspan fill="#6c7086">56 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1090"><tspan fill="#6c7086">57 </tspan><tspan fill="#cba6f7">class</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold" font-style="italic">C6</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1109"><tspan fill="#6c7086">58 </tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">destroy</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cba6f7" font-style="italic">ref</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1128"><tspan fill="#6c7086">59 </tspan><tspan fill="#74c7ec">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1147"><tspan fill="#6c7086">60 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">C6</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#94e2d5" font-style="italic">destroy</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cba6f7" font-style="italic">ref</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold">self</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1166"><tspan fill="#6c7086">61 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1185"><tspan fill="#6c7086">62 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">C6</tspan><tspan fill="#94e2d5" font-weight="bold">*</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">&</tspan><tspan fill="#cdd6f4">c6</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1204"><tspan fill="#6c7086">63 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">q</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">typeof</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1223"><tspan fill="#6c7086">64 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">r</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">typeof</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#89b4fa">Make</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">q</tspan><tspan fill="#74c7ec">))).</tspan><tspan fill="#f9e2af">Pointee</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">*</tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1242"><tspan fill="#6c7086">65 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1261"><tspan fill="#6c7086">66 </tspan><tspan fill="#7f849c">//</tspan><tspan fill="#7f849c" font-style="italic"> --- the same names in type and expression positions</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1280"><tspan fill="#6c7086">67 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1299"><tspan fill="#6c7086">68 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">o</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Optional</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af">Slice</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">))</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">Optional</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#89b4fa">Slice</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)).</tspan><tspan fill="#89b4fa" font-style="italic">None</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1318"><tspan fill="#6c7086">69 </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">origin</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Point</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">Point</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#89b4fa" font-style="italic">Origin</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1337"><tspan fill="#6c7086">70 </tspan><tspan fill="#cba6f7">let</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4" font-weight="bold" font-style="italic">t</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">type</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">Point</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1356"><tspan fill="#6c7086">71 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">c</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Core</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">Int</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#fab387">64</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">as</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Core</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">Int</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#fab387">64</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1375"><tspan fill="#6c7086">72 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">v</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-weight="bold">Cpp</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">std</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">vector</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">Make</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa">Vector</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">Point</tspan><tspan fill="#74c7ec">))</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1394"><tspan fill="#6c7086">73 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">s</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{.</tspan><tspan fill="#eba0ac" font-style="italic">x</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">y</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Point</tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{.</tspan><tspan fill="#eba0ac" font-style="italic">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">y</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">}</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1413"><tspan fill="#6c7086">74 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">tup</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Point</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#fab387">1</tspan><tspan fill="#74c7ec">,</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">p</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1432"><tspan fill="#6c7086">75 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Pick</tspan><tspan fill="#74c7ec">[</tspan><tspan fill="#cdd6f4" font-style="italic">T</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Hashable</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">&</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">Eq</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5" font-style="italic">where</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#eba0ac" font-style="italic">Key</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec">](</tspan><tspan fill="#cdd6f4" font-style="italic">t</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">T</tspan><tspan fill="#74c7ec">.</tspan><tspan fill="#f9e2af">Key</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1451"><tspan fill="#6c7086">76 </tspan><tspan fill="#cba6f7">fn</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#89b4fa" font-weight="bold">Iter</tspan><tspan fill="#74c7ec">()</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">-></tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f5e0dc" font-weight="bold" font-style="italic">Vector</tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#f9e2af">T</tspan><tspan fill="#74c7ec">).</tspan><tspan fill="#f9e2af">Iterator</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1470"><tspan fill="#6c7086">77 </tspan><tspan fill="#f38ba8">if</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">(</tspan><tspan fill="#cdd6f4">T</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">==</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">Point</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f38ba8">and</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">x</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">impls</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" text-decoration="underline">Hashable</tspan><tspan fill="#74c7ec">)</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#74c7ec">{}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1489"><tspan fill="#6c7086">78 </tspan><tspan fill="#cba6f7">alias</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">lower</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af" font-style="italic">i32</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="1508"><tspan fill="#6c7086">79 </tspan><tspan fill="#cba6f7">var</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">l</tspan><tspan fill="#94e2d5">:</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#f9e2af">lower</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">=</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">a</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#94e2d5">*</tspan><tspan fill="#a6adc8"> </tspan><tspan fill="#cdd6f4">b</tspan><tspan fill="#74c7ec" font-weight="bold">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="26"><tspan fill="#6e7681"> 1 </tspan><tspan fill="#6a9955">// Part of the Carbon Language project, under the Apache License v2.0 with LLVM</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="45"><tspan fill="#6e7681"> 2 </tspan><tspan fill="#6a9955">// Exceptions. See /LICENSE for license information.</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="64"><tspan fill="#6e7681"> 3 </tspan><tspan fill="#6a9955">// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="83"><tspan fill="#6e7681"> 4 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="102"><tspan fill="#6e7681"> 5 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C1</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="121"><tspan fill="#6e7681"> 6 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C2</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">T1</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">T2</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">C1</tspan><tspan fill="#d4d4d4">) {}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="140"><tspan fill="#6e7681"> 7 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C3</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">extend</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">base</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">C1</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#569cd6">class</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#dcdcaa">C4</tspan><tspan fill="#d4d4d4">(</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="235"><tspan fill="#6e7681">12 </tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#4ec9b0">T1</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">type</tspan><tspan fill="#d4d4d4">),</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="254"><tspan fill="#6e7681">13 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">T2</tspan><tspan fill="#d4d4d4">:</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="273"><tspan fill="#6e7681">14 </tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">.(</tspan><tspan fill="#dcdcaa">B</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">E</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#dcdcaa">F</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">G</tspan><tspan fill="#d4d4d4">)).</tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4">)</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="292"><tspan fill="#6e7681">15 </tspan><tspan fill="#d4d4d4"> .</tspan><tspan fill="#4ec9b0">D</tspan><tspan fill="#d4d4d4">))) ;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="311"><tspan fill="#6e7681">16 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="330"><tspan fill="#6e7681">17 </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C5</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="349"><tspan fill="#6e7681">18 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="368"><tspan fill="#6e7681">19 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">extend</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="387"><tspan fill="#6e7681">20 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="406"><tspan fill="#6e7681">21 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="425"><tspan fill="#6e7681">22 </tspan><tspan fill="#569cd6">alias</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">a1</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#4ec9b0">C1</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="444"><tspan fill="#6e7681">23 </tspan><tspan fill="#569cd6">alias</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">a2</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="463"><tspan fill="#6e7681">24 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="482"><tspan fill="#6e7681">25 </tspan><tspan fill="#569cd6">adapt</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">SomeClass</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="501"><tspan fill="#6e7681">26 </tspan><tspan fill="#569cd6">adapt</tspan><tspan fill="#d4d4d4"> {.</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">SomeClass</tspan><tspan fill="#d4d4d4">, .</tspan><tspan fill="#9cdcfe">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">};</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#569cd6">adapt</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">i32</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="539"><tspan fill="#6e7681">28 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="558"><tspan fill="#6e7681">29 </tspan><tspan fill="#569cd6">interface</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="577"><tspan fill="#6e7681">30 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> (</tspan><tspan fill="#dcdcaa">I</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4">.(</tspan><tspan fill="#4ec9b0">D</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#dcdcaa">E</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">F</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4ec9b0">G</tspan><tspan fill="#d4d4d4">)).</tspan><tspan fill="#4ec9b0">H</tspan><tspan fill="#d4d4d4">)) {}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="596"><tspan fill="#6e7681">31 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">where</tspan><tspan fill="#d4d4d4"> .</tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4"> = (</tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">where</tspan><tspan fill="#d4d4d4"> .</tspan><tspan fill="#569cd6">Self</tspan><tspan fill="#d4d4d4"> = {}) {}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="615"><tspan fill="#6e7681">32 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">where</tspan><tspan fill="#d4d4d4"> .</tspan><tspan fill="#4ec9b0">A</tspan><tspan fill="#d4d4d4"> = {} </tspan><tspan fill="#c586c0">and</tspan><tspan fill="#d4d4d4"> .</tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#4ec9b0">C</tspan><tspan fill="#d4d4d4"> {}</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="634"><tspan fill="#6e7681">33 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">Self</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="653"><tspan fill="#6e7681">34 </tspan><tspan fill="#569cd6">impl</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="672"><tspan fill="#6e7681">35 </tspan></text>
|
||||
<text style="white-space:pre" x="12" y="691"><tspan fill="#6e7681">36 </tspan><tspan fill="#569cd6">constraint</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Constraint</tspan><tspan fill="#d4d4d4"> {</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="710"><tspan fill="#6e7681">37 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">require</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">T</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">impls</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="729"><tspan fill="#6e7681">38 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">require</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">Self</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">impls</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="748"><tspan fill="#6e7681">39 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">require</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">impls</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">extern</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">require</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">impls</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">I</tspan><tspan fill="#d4d4d4">;</tspan></text>
|
||||
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#d4d4d4">}</tspan></text>
|
||||
</g></svg>
|
||||
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 11 KiB |
@@ -11,7 +11,10 @@ the grammar in this repository actually produces rather than whatever an editor
|
||||
looked like when someone last took a screenshot by hand.
|
||||
|
||||
The SVG holds the source as text rather than as outlines, so whatever displays
|
||||
it lays the text out and draws the glyphs; nothing here rasterizes.
|
||||
it lays the text out and draws the glyphs; nothing here rasterizes. Colors are
|
||||
VS Code's Dark+. A scope the theme does not style resolves outward through the
|
||||
scope stack, which is what makes a string's quotes take the string color and a
|
||||
comment's `//` take the comment color.
|
||||
"""
|
||||
|
||||
__copyright__ = """
|
||||
@@ -21,11 +24,9 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import html
|
||||
import itertools
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Iterator, Optional
|
||||
from typing import Optional
|
||||
|
||||
import tmlanguage
|
||||
|
||||
@@ -35,97 +36,39 @@ _GRAMMAR_PATH = (
|
||||
Path(__file__).resolve().parents[1] / "vscode" / "carbon.tmLanguage.json"
|
||||
)
|
||||
|
||||
# A theme built for this grammar rather than taken from an editor. Each family
|
||||
# of related scopes gets one color, and bold, italic, and underline distinguish
|
||||
# the scopes within a family. Every scope the grammar picks from context renders
|
||||
# differently, so a change to what it scopes is visible in the rendering. Scopes
|
||||
# that follow from the spelling alone, such as a bracket's shape, can share a
|
||||
# rendering, since the text already shows them. A scope with no entry of its own
|
||||
# takes its family's. The colors are Catppuccin Mocha's.
|
||||
_COLORS = {
|
||||
"comment": "#7f849c",
|
||||
"punctuation.definition.comment": "#7f849c",
|
||||
"keyword.other.directive": "#7f849c",
|
||||
"storage": "#cba6f7",
|
||||
"constant.language": "#cba6f7",
|
||||
"keyword.control": "#f38ba8",
|
||||
"keyword.operator": "#94e2d5",
|
||||
"keyword.other": "#94e2d5",
|
||||
"punctuation": "#74c7ec",
|
||||
"entity.name.type": "#f9e2af",
|
||||
"support.type": "#f9e2af",
|
||||
"support.class": "#f9e2af",
|
||||
"entity.other.inherited-class": "#f9e2af",
|
||||
"entity.name.namespace": "#f5e0dc",
|
||||
"entity.name.scope-resolution": "#f5e0dc",
|
||||
"entity.name.tag": "#f5e0dc",
|
||||
"entity.name.function": "#89b4fa",
|
||||
"support.function": "#89b4fa",
|
||||
"variable": "#cdd6f4",
|
||||
# Members of something else: a field or other member read through `.` or
|
||||
# `->`, and a choice's alternatives.
|
||||
"variable.other.property": "#eba0ac",
|
||||
"variable.other.enummember": "#eba0ac",
|
||||
"string": "#a6e3a1",
|
||||
"constant.character.escape": "#f5c2e7",
|
||||
"constant.numeric": "#fab387",
|
||||
# Inline C++ is highlighted by the C++ grammar, so here it gets the color of
|
||||
# unscoped text.
|
||||
"meta.embedded": "#a6adc8",
|
||||
# VS Code's Dark+, keyed by the selectors the theme itself uses. Matching is by
|
||||
# longest dotted prefix, as a real theme does, so this stays correct for any
|
||||
# grammar rather than only the scope names in use today.
|
||||
_THEME = {
|
||||
"comment": "#6a9955",
|
||||
"constant.character.escape": "#d7ba7d",
|
||||
"constant.language": "#569cd6",
|
||||
"constant.numeric": "#b5cea8",
|
||||
"entity.name.function": "#dcdcaa",
|
||||
"entity.name.namespace": "#4ec9b0",
|
||||
"entity.name.tag": "#569cd6",
|
||||
"entity.name.type": "#4ec9b0",
|
||||
"keyword.control": "#c586c0",
|
||||
"keyword.operator": "#d4d4d4",
|
||||
"keyword.other": "#569cd6",
|
||||
"meta.embedded": "#d4d4d4",
|
||||
"storage.modifier": "#569cd6",
|
||||
"storage.type": "#569cd6",
|
||||
"string": "#ce9178",
|
||||
"support.class": "#4ec9b0",
|
||||
"support.function": "#dcdcaa",
|
||||
"support.type": "#4ec9b0",
|
||||
"support.type.property-name": "#9cdcfe",
|
||||
"support.variable": "#9cdcfe",
|
||||
"variable.language": "#569cd6",
|
||||
"variable.other": "#9cdcfe",
|
||||
"variable.other.enummember": "#4fc1ff",
|
||||
"variable.parameter": "#9cdcfe",
|
||||
}
|
||||
|
||||
# A theme resolves the font style separately from the color, so a scope takes
|
||||
# its color from its family and its style from its own entry. An empty style
|
||||
# clears one an enclosing scope set, which keeps an escape non-italic inside an
|
||||
# italic single-quoted string.
|
||||
_STYLES = {
|
||||
"comment": "italic",
|
||||
"punctuation.definition.comment": "",
|
||||
"keyword.other.directive": "bold",
|
||||
"storage.modifier": "italic",
|
||||
"constant.language": "bold",
|
||||
"keyword.other": "italic",
|
||||
"keyword.operator.type.pointer": "bold",
|
||||
"punctuation.terminator": "bold",
|
||||
"punctuation.definition.string": "italic",
|
||||
"punctuation.definition.raw-identifier": "bold italic",
|
||||
"support.type": "italic",
|
||||
"support.class": "bold",
|
||||
"entity.name.type.class": "bold italic",
|
||||
"entity.other.inherited-class": "underline",
|
||||
"entity.name.namespace.library": "bold",
|
||||
"entity.name.scope-resolution": "bold italic",
|
||||
"entity.name.tag": "italic",
|
||||
"entity.name.function.definition": "bold",
|
||||
"entity.name.function.member": "italic",
|
||||
"support.function": "bold italic",
|
||||
"variable.parameter": "italic",
|
||||
"variable.language": "bold",
|
||||
"variable.other.constant": "bold italic",
|
||||
"variable.other.property": "italic",
|
||||
"variable.other.enummember": "bold",
|
||||
"string.quoted.single": "italic",
|
||||
"string.quoted.triple": "bold",
|
||||
"constant.character.escape": "",
|
||||
"constant.numeric.hex": "italic",
|
||||
"constant.numeric.binary": "bold",
|
||||
"constant.numeric.octal": "bold italic",
|
||||
"meta.embedded": "italic",
|
||||
}
|
||||
|
||||
# The four font styles a theme can name, as SVG presentation attributes.
|
||||
_STYLE_ATTRS = {
|
||||
"italic": ' font-style="italic"',
|
||||
"bold": ' font-weight="bold"',
|
||||
"underline": ' text-decoration="underline"',
|
||||
"strikethrough": ' text-decoration="line-through"',
|
||||
}
|
||||
|
||||
_BACKGROUND = "#1e1e2e"
|
||||
# Unscoped text. It is dimmer than any scope's color, so text the grammar misses
|
||||
# stands out.
|
||||
_FOREGROUND = "#a6adc8"
|
||||
_GUTTER = "#6c7086"
|
||||
_BACKGROUND = "#1f1f1f"
|
||||
_FOREGROUND = "#d4d4d4"
|
||||
_GUTTER = "#6e7681"
|
||||
# Whatever monospace font the viewer has: nothing can be fetched, because
|
||||
# GitHub serves SVG under `default-src 'none'` and a web font would be blocked.
|
||||
# The text simply flows, so the font's own metrics lay each line out.
|
||||
@@ -141,56 +84,55 @@ _DESCENT = 5
|
||||
_PAD = 12
|
||||
|
||||
|
||||
def _select(table: dict[str, str], scopes: list[str], default: str) -> str:
|
||||
"""Resolves a scope stack against one table, innermost scope first.
|
||||
def _color_for(scopes: list[str]) -> str:
|
||||
"""Resolves a scope stack to a color, innermost scope first.
|
||||
|
||||
Within a scope the longest matching prefix wins, so a selector such as
|
||||
`keyword.other.directive` beats `keyword.other`. A scope the table names at
|
||||
no prefix falls back to its enclosing scope, as a theme does.
|
||||
Within a scope the longest matching prefix wins, so that a selector such as
|
||||
`variable.other.enummember` beats `variable.other`. A scope the theme does
|
||||
not style resolves outward to its enclosing scope, which is what gives a
|
||||
string's quotes the string color.
|
||||
"""
|
||||
for scope in reversed(scopes):
|
||||
while scope:
|
||||
if scope in table:
|
||||
return table[scope]
|
||||
scope = scope.rpartition(".")[0]
|
||||
return default
|
||||
parts = scope.split(".")
|
||||
for end in range(len(parts), 0, -1):
|
||||
color = _THEME.get(".".join(parts[:end]))
|
||||
if color:
|
||||
return color
|
||||
return _FOREGROUND
|
||||
|
||||
|
||||
def _span_for(scopes: list[str]) -> str:
|
||||
"""Resolves a scope stack to the attributes its `tspan` carries."""
|
||||
attrs = "".join(
|
||||
_STYLE_ATTRS[word]
|
||||
for word in _select(_STYLES, scopes, "").split()
|
||||
if word in _STYLE_ATTRS
|
||||
)
|
||||
return f'fill="{_select(_COLORS, scopes, _FOREGROUND)}"{attrs}'
|
||||
def _escape(text: str) -> str:
|
||||
"""Escapes source text for an SVG text node, as one would for HTML."""
|
||||
return text.replace("&", "&").replace("<", "<").replace(">", ">")
|
||||
|
||||
|
||||
def _runs(spans: list[str]) -> Iterator[tuple[int, int, str]]:
|
||||
"""Merges a per-character attribute list into `(start, end, attrs)` runs."""
|
||||
end = 0
|
||||
for attrs, run in itertools.groupby(spans):
|
||||
start, end = end, end + len(list(run))
|
||||
yield start, end, attrs
|
||||
def _runs(colors: list[str]) -> list[tuple[int, int, str]]:
|
||||
"""Merges a per-character color list into `(start, end, color)` runs."""
|
||||
runs: list[tuple[int, int, str]] = []
|
||||
for index, color in enumerate(colors):
|
||||
if runs and runs[-1][2] == color:
|
||||
runs[-1] = (runs[-1][0], index + 1, color)
|
||||
else:
|
||||
runs.append((index, index + 1, color))
|
||||
return runs
|
||||
|
||||
|
||||
def render(grammar: tmlanguage.Grammar, source: str) -> str:
|
||||
"""Renders a Carbon source as a standalone SVG document."""
|
||||
lines = tmlanguage.split_lines(source)
|
||||
plain = f'fill="{_FOREGROUND}"'
|
||||
styled = [[plain] * len(line) for line in lines]
|
||||
colored = [[_FOREGROUND] * len(line) for line in lines]
|
||||
for token in tmlanguage.tokenize(grammar, source):
|
||||
attrs = _span_for(token.scopes)
|
||||
row = styled[token.line]
|
||||
color = _color_for(token.scopes)
|
||||
row = colored[token.line]
|
||||
# A token runs one past the line, over the newline it was tokenized
|
||||
# with, and there is no column there to style.
|
||||
# with, and there is no column there to color.
|
||||
for column in range(token.start, min(token.end, len(row))):
|
||||
row[column] = attrs
|
||||
row[column] = color
|
||||
|
||||
# Trailing blank lines would only pad the bottom of the image.
|
||||
while lines and not lines[-1].strip():
|
||||
lines.pop()
|
||||
styled.pop()
|
||||
colored.pop()
|
||||
|
||||
digits = len(str(len(lines))) if lines else 1
|
||||
longest = max((len(line) for line in lines), default=0)
|
||||
@@ -213,9 +155,8 @@ def render(grammar: tmlanguage.Grammar, source: str) -> str:
|
||||
spans = [
|
||||
f'<tspan fill="{_GUTTER}">{str(linenum + 1).rjust(digits)} </tspan>'
|
||||
] + [
|
||||
f"<tspan {attrs}>"
|
||||
f"{html.escape(linetext[start:end], quote=False)}</tspan>"
|
||||
for start, end, attrs in _runs(styled[linenum])
|
||||
f'<tspan fill="{color}">{_escape(linetext[start:end])}</tspan>'
|
||||
for start, end, color in _runs(colored[linenum])
|
||||
]
|
||||
out.append(
|
||||
f'<text style="white-space:pre" x="{_PAD}" y="{baseline}">'
|
||||
|
||||
@@ -234,42 +234,30 @@ def _append_capture_tokens(
|
||||
group's text takes on top of `scopes`; group `"0"` is the whole match. The
|
||||
tokens tile the match with no gaps: text not covered by a listed group is
|
||||
still appended, under `scopes` alone.
|
||||
|
||||
Groups nest, so the scopes do too: text inside `((//)(@x))` carries the
|
||||
scope of group 1 and then the scope of whichever of 2 and 3 covers it.
|
||||
Enclosing groups have the lower number, which is what puts them lower in
|
||||
the stack.
|
||||
"""
|
||||
if not captures:
|
||||
_append_token(tokens, linenum, match.start(), match.end(), scopes)
|
||||
return
|
||||
spans = []
|
||||
pos = match.start()
|
||||
for group in range((match.re.groups or 0) + 1):
|
||||
spec = captures.get(str(group))
|
||||
start, end = match.span(group)
|
||||
# Skip a group the grammar does not name, one that did not participate
|
||||
# in the match, whose `start` is then -1, and one that matched empty.
|
||||
if spec is None or start < 0 or start == end:
|
||||
# Skip a group the grammar does not name, one that did not
|
||||
# participate in the match (`start` is then -1), and one that lies
|
||||
# behind text already appended, since tokens come out in order.
|
||||
if spec is None or match.start(group) < pos:
|
||||
continue
|
||||
spans.append((start, end, spec["name"]))
|
||||
edges = sorted(
|
||||
{match.start(), match.end()}.union(
|
||||
point for start, end, _ in spans for point in (start, end)
|
||||
)
|
||||
)
|
||||
for start, end in zip(edges, edges[1:]):
|
||||
if match.start(group) == match.end(group):
|
||||
continue
|
||||
_append_token(tokens, linenum, pos, match.start(group), scopes)
|
||||
_append_token(
|
||||
tokens,
|
||||
linenum,
|
||||
start,
|
||||
end,
|
||||
scopes
|
||||
+ [
|
||||
name
|
||||
for span_start, span_end, name in spans
|
||||
if span_start <= start and end <= span_end
|
||||
],
|
||||
match.start(group),
|
||||
match.end(group),
|
||||
scopes + [spec["name"]],
|
||||
)
|
||||
pos = match.end(group)
|
||||
_append_token(tokens, linenum, pos, match.end(), scopes)
|
||||
|
||||
|
||||
def _push_scope(
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
{ "include": "#comments" },
|
||||
{ "include": "#cpp-inline" },
|
||||
{ "include": "#strings" },
|
||||
{ "include": "#builtin-functions" },
|
||||
{ "include": "#choice-definitions" },
|
||||
{ "include": "#declarations" },
|
||||
{ "include": "#inheritance" },
|
||||
{ "include": "#type-annotation" },
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{ "include": "#numbers" },
|
||||
@@ -26,12 +22,12 @@
|
||||
"comments": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Toolchain directives. The comment scope sits on a capture rather than on the rule, to leave the leading indentation outside it.",
|
||||
"match": "^\\s*((//)(@(?:dump-sem-ir-(?:begin|end)|include-in-dumps)))$",
|
||||
"comment": "Toolchain directives, which are comments the driver acts on.",
|
||||
"name": "comment.line.double-slash.carbon",
|
||||
"match": "(//)(@(?:dump-sem-ir-(?:begin|end)|include-in-dumps))\\b.*$",
|
||||
"captures": {
|
||||
"1": { "name": "comment.line.double-slash.carbon" },
|
||||
"2": { "name": "punctuation.definition.comment.carbon" },
|
||||
"3": { "name": "keyword.other.directive.carbon" }
|
||||
"1": { "name": "punctuation.definition.comment.carbon" },
|
||||
"2": { "name": "keyword.other.directive.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -47,22 +43,20 @@
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Inline C++, block form.",
|
||||
"begin": "\\b(?:(import)\\s+(Cpp)\\s+(inline)|(inline)\\s+(Cpp))\\s*(''')([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "\\b(?:(import)\\s+(Cpp)\\s+(inline)|(inline)\\s+(Cpp))\\s*(''')([^\\s'\\\"#]*)",
|
||||
"end": "(''')\\s*(;)?",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.control.import.carbon" },
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "support.class.carbon" },
|
||||
"3": { "name": "storage.type.carbon" },
|
||||
"4": { "name": "storage.type.carbon" },
|
||||
"5": { "name": "support.class.carbon" },
|
||||
"6": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"7": { "name": "entity.name.tag.language.carbon" },
|
||||
"8": { "name": "comment.line.double-slash.carbon" },
|
||||
"9": { "name": "punctuation.definition.comment.carbon" }
|
||||
"7": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" },
|
||||
"2": { "name": "punctuation.terminator.statement.carbon" }
|
||||
"2": { "name": "punctuation.terminator.carbon" }
|
||||
},
|
||||
"contentName": "meta.embedded.block.cpp",
|
||||
"patterns": [{ "include": "source.cpp" }]
|
||||
@@ -72,7 +66,7 @@
|
||||
"begin": "\\b(?:(import)\\s+(Cpp)\\s+(inline)|(inline)\\s+(Cpp))\\s*(\")",
|
||||
"end": "(\")\\s*(;)?",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.control.import.carbon" },
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "support.class.carbon" },
|
||||
"3": { "name": "storage.type.carbon" },
|
||||
"4": { "name": "storage.type.carbon" },
|
||||
@@ -81,7 +75,7 @@
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" },
|
||||
"2": { "name": "punctuation.terminator.statement.carbon" }
|
||||
"2": { "name": "punctuation.terminator.carbon" }
|
||||
},
|
||||
"contentName": "meta.embedded.inline.cpp",
|
||||
"patterns": [{ "include": "source.cpp" }]
|
||||
@@ -93,14 +87,12 @@
|
||||
{
|
||||
"comment": "Block string literal, with an optional file type indicator, raw at `###` level.",
|
||||
"name": "string.quoted.triple.carbon",
|
||||
"begin": "(#{3,})(''')([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "(#{3,})(''')([^\\s'\\\"#]*)",
|
||||
"end": "(''')\\1",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"2": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"3": { "name": "entity.name.tag.language.carbon" },
|
||||
"4": { "name": "comment.line.double-slash.carbon" },
|
||||
"5": { "name": "punctuation.definition.comment.carbon" }
|
||||
"3": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" }
|
||||
@@ -110,14 +102,12 @@
|
||||
{
|
||||
"comment": "Block string literal, with an optional file type indicator, raw at `##` level.",
|
||||
"name": "string.quoted.triple.carbon",
|
||||
"begin": "(##)(''')([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "(##)(''')([^\\s'\\\"#]*)",
|
||||
"end": "('''##)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"2": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"3": { "name": "entity.name.tag.language.carbon" },
|
||||
"4": { "name": "comment.line.double-slash.carbon" },
|
||||
"5": { "name": "punctuation.definition.comment.carbon" }
|
||||
"3": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" }
|
||||
@@ -127,14 +117,12 @@
|
||||
{
|
||||
"comment": "Block string literal, with an optional file type indicator, raw at `#` level.",
|
||||
"name": "string.quoted.triple.carbon",
|
||||
"begin": "(#)(''')([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "(#)(''')([^\\s'\\\"#]*)",
|
||||
"end": "('''#)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"2": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"3": { "name": "entity.name.tag.language.carbon" },
|
||||
"4": { "name": "comment.line.double-slash.carbon" },
|
||||
"5": { "name": "punctuation.definition.comment.carbon" }
|
||||
"3": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" }
|
||||
@@ -144,13 +132,11 @@
|
||||
{
|
||||
"comment": "Block string literal, with an optional file type indicator.",
|
||||
"name": "string.quoted.triple.carbon",
|
||||
"begin": "(''')([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "(''')([^\\s'\\\"#]*)",
|
||||
"end": "(''')",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"2": { "name": "entity.name.tag.language.carbon" },
|
||||
"3": { "name": "comment.line.double-slash.carbon" },
|
||||
"4": { "name": "punctuation.definition.comment.carbon" }
|
||||
"2": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" }
|
||||
@@ -160,13 +146,11 @@
|
||||
{
|
||||
"comment": "A `\"\"\"` block is always an error, but highlighting it as a block string keeps the rest of the file readable.",
|
||||
"name": "string.quoted.triple.carbon",
|
||||
"begin": "(\"\"\")([^\\s'\\\"#]*)(?:[ \\t]*((//)(?:[ \\t][^\\n]*)?)$)?",
|
||||
"begin": "(\"\"\")([^\\s'\\\"#]*)",
|
||||
"end": "(\"\"\")",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"2": { "name": "entity.name.tag.language.carbon" },
|
||||
"3": { "name": "comment.line.double-slash.carbon" },
|
||||
"4": { "name": "punctuation.definition.comment.carbon" }
|
||||
"2": { "name": "entity.name.tag.language.carbon" }
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.definition.string.end.carbon" }
|
||||
@@ -247,7 +231,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.carbon",
|
||||
"match": "\\\\(?:[tnr0'\\\"\\\\]|x[0-9A-F]{2}|u\\{[0-9A-F]+\\})"
|
||||
"match": "\\\\(?:[tnr0'\\\"\\\\]|x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]+\\})"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -255,7 +239,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.carbon",
|
||||
"match": "\\\\#(?:[tnr0'\\\"\\\\]|x[0-9A-F]{2}|u\\{[0-9A-F]+\\})"
|
||||
"match": "\\\\#(?:[tnr0'\\\"\\\\]|x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]+\\})"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -263,7 +247,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.carbon",
|
||||
"match": "\\\\##(?:[tnr0'\\\"\\\\]|x[0-9A-F]{2}|u\\{[0-9A-F]+\\})"
|
||||
"match": "\\\\##(?:[tnr0'\\\"\\\\]|x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]+\\})"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -271,383 +255,46 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.carbon",
|
||||
"match": "\\\\#{3,}(?:[tnr0'\\\"\\\\]|x[0-9A-F]{2}|u\\{[0-9A-F]+\\})"
|
||||
}
|
||||
]
|
||||
},
|
||||
"builtin-functions": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "A builtin function declaration (`fn ... = \"...\"`), scoping the string contents as `support.function.builtin`.",
|
||||
"begin": "\\b(fn)\\b(?=[^\"/;]*=\\s*\")",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.carbon" }
|
||||
},
|
||||
"end": "(?=;)|$",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(=)\\s*((\")([^\"\\\\\\n]*)(\"))",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.operator.carbon" },
|
||||
"2": { "name": "string.quoted.double.carbon" },
|
||||
"3": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"4": { "name": "support.function.builtin.carbon" },
|
||||
"5": { "name": "punctuation.definition.string.end.carbon" }
|
||||
}
|
||||
},
|
||||
{ "include": "#declarations" },
|
||||
{ "include": "#comments" },
|
||||
{ "include": "#strings" },
|
||||
{ "include": "#type-annotation" },
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{ "include": "#numbers" },
|
||||
{ "include": "#operators" },
|
||||
{ "include": "#identifiers" },
|
||||
{ "include": "#punctuation" }
|
||||
]
|
||||
"match": "\\\\#{3,}(?:[tnr0'\\\"\\\\]|x[0-9A-Fa-f]{2}|u\\{[0-9A-Fa-f]+\\})"
|
||||
}
|
||||
]
|
||||
},
|
||||
"declarations": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "The name a function declaration declares, after any qualifiers, or the `destroy` keyword.",
|
||||
"begin": "(?<=\\bfn)\\s+(?=(?:r#)?[A-Za-z_])",
|
||||
"end": "(?:(destroy)|((?:r#)?[A-Za-z_][A-Za-z0-9_]*))\\b(?!\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)|(?=[^\\sA-Za-z_])|$",
|
||||
"endCaptures": {
|
||||
"1": { "name": "keyword.other.carbon" },
|
||||
"2": { "name": "entity.name.function.definition.carbon" }
|
||||
},
|
||||
"patterns": [{ "include": "#declared-name-qualifier" }]
|
||||
},
|
||||
{
|
||||
"comment": "The name a class declaration declares, given `entity.name.type.class` for themes that color classes apart from other types.",
|
||||
"begin": "(?<=\\bclass)\\s+(?=(?:r#)?[A-Za-z_])",
|
||||
"end": "((?:r#)?[A-Za-z_][A-Za-z0-9_]*)\\b(?!\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)|(?=[^\\sA-Za-z_])|$",
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.type.class.carbon" }
|
||||
},
|
||||
"patterns": [{ "include": "#declared-name-qualifier" }]
|
||||
},
|
||||
{
|
||||
"comment": "The name the other nominal type declarations declare.",
|
||||
"begin": "(?:(?<=\\balias)|(?<=\\bconstraint)|(?<=\\binterface))\\s+(?=(?:r#)?[A-Za-z_])",
|
||||
"end": "((?:r#)?[A-Za-z_][A-Za-z0-9_]*)\\b(?!\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)|(?=[^\\sA-Za-z_])|$",
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.type.carbon" }
|
||||
},
|
||||
"patterns": [{ "include": "#declared-name-qualifier" }]
|
||||
},
|
||||
{
|
||||
"comment": "`let` and `var` bindings, with optional modifiers before the name. `_` and `self` are left to `#literals`.",
|
||||
"match": "\\b(let)\\s+((?:(?:generic|ref|template|unused|var)\\s+)*)(?!_\\s*:)(r#)?([A-Za-z_][A-Za-z0-9_]*)(?=\\s*:(?![=!?]))",
|
||||
"comment": "Function declarations, including lambdas with a name. `destroy` is a keyword naming a destructor, not a name.",
|
||||
"match": "\\b(fn)\\s+(?!destroy\\b)((?:r#)?[A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "storage.modifier.carbon" },
|
||||
"3": { "name": "punctuation.definition.raw-identifier.carbon" },
|
||||
"4": { "name": "variable.other.constant.carbon" }
|
||||
"2": { "name": "entity.name.function.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "\\b(var)\\s+((?:(?:generic|ref|template|unused)\\s+)*)(?!(?:_|self)\\s*:)(r#)?([A-Za-z_][A-Za-z0-9_]*)(?=\\s*:(?![=!?]))",
|
||||
"comment": "Nominal type declarations.",
|
||||
"match": "\\b(alias|choice|class|constraint|interface)\\s+((?:r#)?[A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "storage.modifier.carbon" },
|
||||
"3": { "name": "punctuation.definition.raw-identifier.carbon" },
|
||||
"4": { "name": "variable.other.carbon" }
|
||||
"2": { "name": "entity.name.type.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Package, namespace, and import names, excluding keywords (`library`, `inline`) and `Core` and `Cpp`.",
|
||||
"match": "\\b(import)\\s+(?!(?:library|inline|Core|Cpp)\\b)((?:r#)?[A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.control.import.carbon" },
|
||||
"2": { "name": "entity.name.namespace.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "\\b(package|namespace)\\s+(?!(?:library|Core|Cpp)\\b)((?:r#)?[A-Za-z_][A-Za-z0-9_]*)",
|
||||
"comment": "Package, namespace, and import names. `library` and `inline` are keywords that may follow `import`, not names.",
|
||||
"match": "\\b(package|namespace|import)\\s+(?!(?:library|inline)\\b)((?:r#)?[A-Za-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "entity.name.namespace.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "A library name, written as a string, with `entity.name.namespace.library` nested inside the string scope.",
|
||||
"match": "\\b(library)\\s+((\")((?:\\\\.|[^\"\\\\\\n])*)(\"))",
|
||||
"captures": {
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "string.quoted.double.carbon" },
|
||||
"3": { "name": "punctuation.definition.string.begin.carbon" },
|
||||
"4": { "name": "entity.name.namespace.library.carbon" },
|
||||
"5": { "name": "punctuation.definition.string.end.carbon" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"declared-name-qualifier": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "One qualifier on a declared name, such as `N.` or `Base(T: type).`, matched when followed by `.` after any parameter lists. `entity.name.scope-resolution` is nested inside `entity.name.type` so themes without a scope-resolution rule fall back to the type color.",
|
||||
"begin": "(((?:r#)?[A-Za-z_][A-Za-z0-9_]*))\\b(?=\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "entity.name.type.carbon" },
|
||||
"2": { "name": "entity.name.scope-resolution.carbon" }
|
||||
},
|
||||
"end": "(\\.)",
|
||||
"endCaptures": {
|
||||
"1": { "name": "punctuation.separator.dot-access.carbon" }
|
||||
},
|
||||
"patterns": [{ "include": "#type-body" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
"type-annotation": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "A type expression, from the token that introduces it to the first token that cannot continue one.",
|
||||
"name": "meta.type.annotation.carbon",
|
||||
"begin": "(:!)|(:\\?)|(:(?![=!?]))|((?<![A-Za-z0-9_)\\]}])\\->\\?)|((?<![A-Za-z0-9_)\\]}])\\->(?!\\?))|\\b(as)\\b|\\b(adapt)\\b|\\b(require)\\b",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.operator.type.annotation.symbolic.carbon" },
|
||||
"2": { "name": "keyword.operator.type.annotation.form.carbon" },
|
||||
"3": { "name": "keyword.operator.type.annotation.carbon" },
|
||||
"4": { "name": "keyword.operator.function-result.form.carbon" },
|
||||
"5": { "name": "keyword.operator.function-result.carbon" },
|
||||
"6": { "name": "keyword.operator.expression.as.carbon" },
|
||||
"7": { "name": "storage.type.carbon" },
|
||||
"8": { "name": "storage.type.carbon" }
|
||||
},
|
||||
"end": "(?=[,;={}\\)\\]]|[-+/%!<>|^~?@\\\\]|//|\\b(?:in|and|or|not|as|impls)\\b|$)",
|
||||
"patterns": [{ "include": "#type-body" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
"type-body": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Argument and grouping parentheses, which nest rather than ending the type.",
|
||||
"begin": "\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#type-body" }]
|
||||
},
|
||||
{
|
||||
"begin": "\\[",
|
||||
"end": "(\\])|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.brackets.begin.bracket.square.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.brackets.end.bracket.square.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#type-body" }]
|
||||
},
|
||||
{
|
||||
"comment": "A `where` clause switches to expression scoping so `=` does not end the enclosing type as an initializer, and ends at a `)` or `]` it did not open.",
|
||||
"begin": "\\bwhere\\b",
|
||||
"beginCaptures": {
|
||||
"0": { "name": "keyword.other.where.carbon" }
|
||||
},
|
||||
"end": "(?=[;{}\\)\\]]|$)",
|
||||
"patterns": [
|
||||
{ "include": "#expression-parens" },
|
||||
{ "include": "$self" }
|
||||
]
|
||||
},
|
||||
{ "include": "#impls-clause" },
|
||||
{ "include": "#comments" },
|
||||
{ "include": "#strings" },
|
||||
{
|
||||
"comment": "`typeof` takes an expression operand, switching out of `#type-body`.",
|
||||
"begin": "\\b(typeof)\\s*(\\()",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.operator.expression.typeof.carbon" },
|
||||
"2": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#expression-parens" },
|
||||
{ "include": "$self" }
|
||||
]
|
||||
},
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{ "include": "#numbers" },
|
||||
{
|
||||
"comment": "Pointer `*`, written directly after the pointee type.",
|
||||
"name": "keyword.operator.type.pointer.carbon",
|
||||
"match": "(?<=[A-Za-z0-9_)\\]*])\\*(?!=)"
|
||||
},
|
||||
{ "include": "#operators" },
|
||||
{ "include": "#bindings" },
|
||||
{
|
||||
"comment": "A qualifier in a type, which `#declared-name-qualifier` scopes the same way on a declared name.",
|
||||
"name": "entity.name.type.carbon",
|
||||
"match": "(?:(?<=[A-Za-z0-9_)\\]]\\.)|(?<!\\.))\\b((?:r#)?[A-Za-z_][A-Za-z0-9_]*)\\b(?=\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)",
|
||||
"captures": {
|
||||
"1": { "name": "entity.name.scope-resolution.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Unqualified names and qualified member names in a type context. A `.` with no preceding qualifier (such as a struct field `.x`) is left to `#identifiers`.",
|
||||
"name": "entity.name.type.carbon",
|
||||
"match": "(?:(?<=[A-Za-z0-9_)\\]]\\.)|(?<!\\.))\\b(r#)?[A-Za-z_][A-Za-z0-9_]*\\b",
|
||||
"captures": {
|
||||
"1": { "name": "punctuation.definition.raw-identifier.carbon" }
|
||||
}
|
||||
},
|
||||
{ "include": "#identifiers" },
|
||||
{ "include": "#punctuation" }
|
||||
]
|
||||
},
|
||||
"inheritance": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "An `impl` declaration (when `impl` does not precede another declaration keyword), scoping the type before `as` with `#type-body` and the interface after `as` with `#inheritance-body`.",
|
||||
"begin": "\\b(impl)\\b(?!\\s*(?:adapt|alias|base|choice|class|constraint|export|fn|impl|import|interface|let|library|match_first|namespace|observe|package|require|var)\\b)",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.carbon" }
|
||||
},
|
||||
"end": "(?=[;{]|$)",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.inheritance-clause.carbon",
|
||||
"begin": "\\b(as)\\b",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.operator.expression.as.carbon" }
|
||||
},
|
||||
"end": "(?=[,;={}\\)\\]]|[-+/%!<>|^~?@\\\\]|//|\\b(?:in|and|or|not|as|impls)\\b|$)",
|
||||
"patterns": [{ "include": "#inheritance-body" }]
|
||||
},
|
||||
{ "include": "#type-body" }
|
||||
],
|
||||
"name": "meta.type.annotation.carbon"
|
||||
},
|
||||
{
|
||||
"comment": "A `base:` declaration, excluding `.base` member access and `base class`.",
|
||||
"name": "meta.inheritance-clause.carbon",
|
||||
"begin": "(?<!\\.)\\b(base)\\s*(:)(?![=!?])",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.carbon" },
|
||||
"2": { "name": "keyword.operator.type.annotation.carbon" }
|
||||
},
|
||||
"end": "(?=[,;={}\\)\\]]|[-+/%!<>|^~?@\\\\]|//|\\b(?:in|and|or|not|as|impls)\\b|$)",
|
||||
"patterns": [{ "include": "#inheritance-body" }]
|
||||
},
|
||||
{ "include": "#impls-clause" }
|
||||
]
|
||||
},
|
||||
"impls-clause": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.inheritance-clause.carbon",
|
||||
"begin": "\\b(impls)\\b",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.operator.expression.impls.carbon" }
|
||||
},
|
||||
"end": "(?=[,;={}\\)\\]]|[-+/%!<>|^~?@\\\\]|//|\\b(?:in|and|or|not|as|impls)\\b|$)",
|
||||
"patterns": [{ "include": "#inheritance-body" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
"inheritance-body": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Only the interface itself is scoped as `entity.other.inherited-class`; its argument list switches to expression scoping.",
|
||||
"begin": "(?<=[A-Za-z0-9_\\]])\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#expression-parens" },
|
||||
{ "include": "$self" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "Grouping parentheses around an interface name stay in `#inheritance-body`.",
|
||||
"begin": "\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#inheritance-body" }]
|
||||
},
|
||||
{
|
||||
"comment": "A `where` clause switches to expression scoping and ends at a `)` or `]` it did not open.",
|
||||
"begin": "\\b(where)\\b",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "keyword.other.where.carbon" }
|
||||
},
|
||||
"end": "(?=[;{}\\)\\]]|$)",
|
||||
"patterns": [
|
||||
{ "include": "#expression-parens" },
|
||||
{ "include": "$self" }
|
||||
]
|
||||
},
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{
|
||||
"comment": "The final identifier of the interface or base class name; any preceding qualifiers fall through to `#type-body`.",
|
||||
"name": "entity.other.inherited-class.carbon",
|
||||
"match": "\\b(?:r#)?[A-Za-z_][A-Za-z0-9_]*\\b(?!\\s*\\.)"
|
||||
},
|
||||
{ "include": "#type-body" }
|
||||
]
|
||||
},
|
||||
"keywords": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "`.base` member access, matched before `base` as an introducer.",
|
||||
"name": "keyword.other.base.carbon",
|
||||
"match": "(?<=\\.)\\b(base)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.import.carbon",
|
||||
"match": "\\b(import)\\b"
|
||||
},
|
||||
{
|
||||
"name": "storage.type.carbon",
|
||||
"match": "\\b(adapt|alias|choice|class|constraint|fn|inline|interface|let|library|match_first|namespace|observe|require|var)\\b"
|
||||
"match": "\\b(adapt|alias|choice|class|constraint|fn|import|inline|interface|let|library|match_first|namespace|observe|require|var)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "`base` as an introducer (not `base class`).",
|
||||
"comment": "`base` introduces a base class declaration unless it modifies one.",
|
||||
"name": "storage.type.carbon",
|
||||
"match": "\\b(base)\\b(?!\\s*class\\b)"
|
||||
},
|
||||
@@ -657,10 +304,10 @@
|
||||
},
|
||||
{
|
||||
"name": "storage.type.carbon",
|
||||
"match": "\\b(impl)\\b(?!\\s*(adapt|alias|base|choice|class|constraint|export|fn|impl|import|interface|let|library|match_first|namespace|observe|package|require|var)\\b)"
|
||||
"match": "\\b(impl)\\b(?!\\s*(fn|library|package)\\b)"
|
||||
},
|
||||
{
|
||||
"comment": "`package` as an introducer (not `package.`).",
|
||||
"comment": "`package` is an introducer unless it begins a qualified name.",
|
||||
"name": "storage.type.carbon",
|
||||
"match": "\\b(package)\\b(?!\\.)"
|
||||
},
|
||||
@@ -669,7 +316,7 @@
|
||||
"match": "\\b(abstract|const|eval|extend|extern|final|generic|musteval|override|partial|private|protected|ref|runtime|static|template|unsafe|unused|val|virtual)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "`default` as a modifier (not `default =>`).",
|
||||
"comment": "`default` is a declaration modifier unless it opens a match arm.",
|
||||
"name": "storage.modifier.carbon",
|
||||
"match": "\\b(default)\\b(?!\\s*=>)"
|
||||
},
|
||||
@@ -683,50 +330,29 @@
|
||||
},
|
||||
{
|
||||
"name": "storage.modifier.carbon",
|
||||
"match": "\\b(impl)\\b(?=\\s*(adapt|alias|base|choice|class|constraint|export|fn|impl|import|interface|let|library|match_first|namespace|observe|package|require|var)\\b)"
|
||||
"match": "\\b(impl)\\b(?=\\s*(fn|library|package)\\b)"
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.carbon",
|
||||
"match": "\\b(break|case|continue|else|for|if|match|return|returned|then|while)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "`default` in a `match` clause.",
|
||||
"comment": "`default` is a match arm here, and a declaration modifier elsewhere.",
|
||||
"name": "keyword.control.carbon",
|
||||
"match": "\\b(default)\\b(?=\\s*=>)"
|
||||
},
|
||||
{
|
||||
"name": "keyword.control.carbon",
|
||||
"match": "\\b(and|or)\\b"
|
||||
"match": "\\b(and|as|impls|in|like|not|or|typeof|where)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.not.carbon",
|
||||
"match": "\\b(not)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Fallback when not matched by `#type-annotation` or `#inheritance`.",
|
||||
"name": "keyword.operator.expression.as.carbon",
|
||||
"match": "\\b(as)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.impls.carbon",
|
||||
"match": "\\b(impls)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.in.carbon",
|
||||
"match": "\\b(in)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.like.carbon",
|
||||
"match": "\\b(like)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.expression.typeof.carbon",
|
||||
"match": "\\b(typeof)\\b"
|
||||
},
|
||||
{ "name": "keyword.other.where.carbon", "match": "\\b(where)\\b" },
|
||||
{
|
||||
"name": "keyword.other.carbon",
|
||||
"match": "\\b(destroy|each|expand|forall|form|friend)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "`.base` names the base class subobject.",
|
||||
"name": "keyword.other.carbon",
|
||||
"match": "(?<=\\.)\\b(base)\\b"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -739,27 +365,23 @@
|
||||
"match": "\\b(_)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Built-in package names.",
|
||||
"comment": "Language-provided package roots.",
|
||||
"name": "support.class.carbon",
|
||||
"match": "\\b(Core|Cpp)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "`package` as a qualifier.",
|
||||
"comment": "`package` as a qualified-name root names the current package.",
|
||||
"name": "variable.language.carbon",
|
||||
"match": "\\b(package)\\b(?=\\.)"
|
||||
},
|
||||
{ "name": "constant.language.carbon", "match": "\\b(true|false)\\b" },
|
||||
{
|
||||
"name": "support.type.builtin.carbon",
|
||||
"match": "\\b(array|auto|type)\\b"
|
||||
"match": "\\b(array|auto|bool|char|str|type)\\b"
|
||||
},
|
||||
{
|
||||
"name": "support.type.primitive.carbon",
|
||||
"match": "\\b(bool|char|str)\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Integer and floating-point type literals.",
|
||||
"name": "support.type.primitive.carbon",
|
||||
"comment": "Integer and float type literals. The lexer accepts any width, so this must not be restricted to the common ones.",
|
||||
"name": "support.type.builtin.carbon",
|
||||
"match": "\\b[iuf][1-9][0-9]*\\b"
|
||||
}
|
||||
]
|
||||
@@ -767,41 +389,14 @@
|
||||
"numbers": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Each numeric rule matches a full alphanumeric word starting with a digit so a malformed suffix is not split into an identifier. Real literals exclude a leading `.` or `->` so tuple access like `t.0.1` is not matched as a real.",
|
||||
"name": "constant.numeric.hex.carbon",
|
||||
"match": "(?<!\\.)(?<!->)\\b(0x)[_0-9A-Za-z]*\\.[0-9A-Za-z][_0-9A-Za-z]*(?:(?<=[a-z])[-+][0-9A-Za-z][_0-9A-Za-z]*)?",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.other.unit.hexadecimal.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "constant.numeric.hex.carbon",
|
||||
"match": "\\b(0x)[_0-9A-Za-z]*",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.other.unit.hexadecimal.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "constant.numeric.octal.carbon",
|
||||
"match": "\\b(0o)[_0-9A-Za-z]*",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.other.unit.octal.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "constant.numeric.binary.carbon",
|
||||
"match": "\\b(0b)[_0-9A-Za-z]*",
|
||||
"captures": {
|
||||
"1": { "name": "keyword.other.unit.binary.carbon" }
|
||||
}
|
||||
"match": "\\b0x[_0-9A-Fa-f]*(?:\\.[_0-9A-Fa-f]*)?(?:[pP][-+]?[0-9]+)?"
|
||||
},
|
||||
{ "name": "constant.numeric.octal.carbon", "match": "\\b0o[_0-7]*" },
|
||||
{ "name": "constant.numeric.binary.carbon", "match": "\\b0b[_01]*" },
|
||||
{
|
||||
"name": "constant.numeric.decimal.carbon",
|
||||
"match": "(?<!\\.)(?<!->)\\b[0-9][_0-9A-Za-z]*\\.[0-9A-Za-z][_0-9A-Za-z]*(?:(?<=[a-z])[-+][0-9A-Za-z][_0-9A-Za-z]*)?"
|
||||
},
|
||||
{
|
||||
"name": "constant.numeric.decimal.carbon",
|
||||
"match": "\\b[0-9][_0-9A-Za-z]*"
|
||||
"match": "\\b[0-9][_0-9]*(?:\\.[_0-9]+)?(?:[eE][-+]?[0-9]+)?"
|
||||
},
|
||||
{
|
||||
"comment": "Positional parameter, as used in lambdas.",
|
||||
@@ -812,247 +407,50 @@
|
||||
},
|
||||
"operators": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "keyword.operator.type.annotation.symbolic.carbon",
|
||||
"match": ":!"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.type.annotation.form.carbon",
|
||||
"match": ":\\?"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.type.annotation.carbon",
|
||||
"match": ":(?![=!?])"
|
||||
},
|
||||
{
|
||||
"comment": "`->` directly after an operand is pointer member access rather than a return type arrow.",
|
||||
"name": "punctuation.separator.pointer-access.carbon",
|
||||
"match": "(?<=[A-Za-z0-9_)\\]}])\\->(?!\\?)"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.function-result.form.carbon",
|
||||
"match": "\\->\\?"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.function-result.carbon",
|
||||
"match": "\\->(?!\\?)"
|
||||
},
|
||||
{ "name": "keyword.operator.arrow.fat.carbon", "match": "=>" },
|
||||
{
|
||||
"name": "keyword.operator.carbon",
|
||||
"match": "<=>|<<=|>>=|==|!=|<=|>=|<<|>>|\\+\\+|--|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|~=|:=|<-|<>|[-+*/%&|^~!<>=@?\\\\]"
|
||||
"match": "(\\->\\?|>>=|<=>|<<=|\\&=|\\^=|:=|:\\?|==|=>|!=|>=|>>|<=|<>|<<|<\\-|\\-=|\\->|\\-\\-|%=|\\|=|\\+=|\\+\\+|/=|\\*=|\\~=|\\&|@|\\^|:|=|!|>|<|\\-|%|\\.|\\||\\+|\\?|/|\\*|\\~|\\\\)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"identifiers": {
|
||||
"patterns": [
|
||||
{ "include": "#bindings" },
|
||||
{
|
||||
"comment": "Raw identifiers.",
|
||||
"name": "variable.other.carbon",
|
||||
"match": "\\b(r#)([A-Za-z_][A-Za-z0-9_]*)",
|
||||
"comment": "Raw identifiers, which suppress keyword meaning.",
|
||||
"match": "\\b(r#)([A-Z][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "punctuation.definition.raw-identifier.carbon" }
|
||||
"1": { "name": "punctuation.definition.raw-identifier.carbon" },
|
||||
"2": { "name": "entity.name.type.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Member function call.",
|
||||
"name": "entity.name.function.member.carbon",
|
||||
"match": "(?:(?<=\\.)|(?<=\\->))[A-Za-z_][A-Za-z0-9_]*(?=\\s*\\()"
|
||||
"match": "\\b(r#)([a-z_][A-Za-z0-9_]*)",
|
||||
"captures": {
|
||||
"1": { "name": "punctuation.definition.raw-identifier.carbon" },
|
||||
"2": { "name": "variable.other.carbon" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Member access via `.` or `->`.",
|
||||
"name": "variable.other.property.carbon",
|
||||
"match": "(?:(?<=\\.)|(?<=\\->))[A-Za-z_][A-Za-z0-9_]*\\b"
|
||||
},
|
||||
{
|
||||
"comment": "Function call.",
|
||||
"name": "entity.name.function.call.carbon",
|
||||
"comment": "An identifier applied to an argument list is a call.",
|
||||
"name": "entity.name.function.carbon",
|
||||
"match": "\\b[A-Za-z_][A-Za-z0-9_]*(?=\\s*\\()"
|
||||
},
|
||||
{
|
||||
"comment": "UpperCamel names a type.",
|
||||
"name": "entity.name.type.carbon",
|
||||
"match": "\\b[A-Z][A-Za-z0-9_]*\\b"
|
||||
},
|
||||
{
|
||||
"comment": "lower_snake names a value.",
|
||||
"name": "variable.other.carbon",
|
||||
"match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b"
|
||||
"match": "\\b[a-z_][A-Za-z0-9_]*\\b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"punctuation": {
|
||||
"patterns": [
|
||||
{
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon",
|
||||
"match": "\\("
|
||||
},
|
||||
{
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon",
|
||||
"match": "\\)"
|
||||
},
|
||||
{
|
||||
"name": "punctuation.section.block.begin.bracket.curly.carbon",
|
||||
"match": "\\{"
|
||||
},
|
||||
{
|
||||
"name": "punctuation.section.block.end.bracket.curly.carbon",
|
||||
"match": "\\}"
|
||||
},
|
||||
{
|
||||
"name": "punctuation.section.brackets.begin.bracket.square.carbon",
|
||||
"match": "\\["
|
||||
},
|
||||
{
|
||||
"name": "punctuation.section.brackets.end.bracket.square.carbon",
|
||||
"match": "\\]"
|
||||
},
|
||||
{ "name": "punctuation.separator.dot-access.carbon", "match": "\\." },
|
||||
{ "name": "punctuation.separator.comma.carbon", "match": "," },
|
||||
{ "name": "punctuation.terminator.statement.carbon", "match": ";" }
|
||||
]
|
||||
},
|
||||
"choice-definitions": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "A `choice` declaration, scoping names in its body as enum members and closing immediately if there is no body.",
|
||||
"begin": "\\b(choice)\\b",
|
||||
"beginCaptures": {
|
||||
"1": { "name": "storage.type.carbon" }
|
||||
},
|
||||
"end": "(?<=\\})|(?=[^\\s({])",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?<=\\bchoice)\\s+(?=(?:r#)?[A-Za-z_])",
|
||||
"end": "((?:r#)?[A-Za-z_][A-Za-z0-9_]*)\\b(?!\\s*(?:\\[[^\\[\\]]*\\]\\s*)?(?:\\([^()]*(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*)?\\.)|(?=[^\\sA-Za-z_])|$",
|
||||
"endCaptures": {
|
||||
"1": { "name": "entity.name.type.carbon" }
|
||||
},
|
||||
"patterns": [{ "include": "#declared-name-qualifier" }]
|
||||
},
|
||||
{ "include": "#comments" },
|
||||
{
|
||||
"comment": "Choice parameters.",
|
||||
"begin": "\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#choice-parameters" }]
|
||||
},
|
||||
{
|
||||
"comment": "Choice body.",
|
||||
"begin": "\\{",
|
||||
"end": "(\\})|(?=[;=])",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.begin.bracket.curly.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.block.end.bracket.curly.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#comments" },
|
||||
{
|
||||
"comment": "Alternative parameters.",
|
||||
"begin": "\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#choice-parameters" }]
|
||||
},
|
||||
{
|
||||
"comment": "Invalid implicit parameter list on an alternative, matched so its contents are not scoped as enum members.",
|
||||
"begin": "\\[",
|
||||
"end": "(\\])|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.brackets.begin.bracket.square.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.brackets.end.bracket.square.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [{ "include": "#choice-parameters" }]
|
||||
},
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{
|
||||
"name": "variable.other.enummember.carbon",
|
||||
"match": "\\b(?:r#)?[A-Za-z_][A-Za-z0-9_]*\\b"
|
||||
},
|
||||
{ "include": "#numbers" },
|
||||
{ "include": "#operators" },
|
||||
{ "include": "#punctuation" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"choice-parameters": {
|
||||
"patterns": [
|
||||
{ "include": "#comments" },
|
||||
{ "include": "#strings" },
|
||||
{ "include": "#inheritance" },
|
||||
{ "include": "#type-annotation" },
|
||||
{ "include": "#keywords" },
|
||||
{ "include": "#literals" },
|
||||
{ "include": "#numbers" },
|
||||
{ "include": "#operators" },
|
||||
{ "include": "#identifiers" },
|
||||
{ "include": "#punctuation" }
|
||||
]
|
||||
},
|
||||
"bindings": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Parameter bindings (`name: Type` when not preceded by `let` or `var`), with `variable.parameter` nested inside `variable.other`.",
|
||||
"name": "variable.other.carbon",
|
||||
"match": "(?<!\\.)(?<!->)\\b(r#)?([A-Za-z_][A-Za-z0-9_]*)(?=\\s*:(?![=!?]))",
|
||||
"captures": {
|
||||
"1": { "name": "punctuation.definition.raw-identifier.carbon" },
|
||||
"2": { "name": "variable.parameter.carbon" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"expression-parens": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "Parentheses nested in an expression that sits inside a type, so that only the matching `)` ends the expression.",
|
||||
"begin": "\\(",
|
||||
"end": "(\\))|$",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.carbon"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{ "include": "#expression-parens" },
|
||||
{ "include": "$self" }
|
||||
]
|
||||
}
|
||||
{ "name": "punctuation.separator.carbon", "match": "," },
|
||||
{ "name": "punctuation.terminator.carbon", "match": ";" }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||