Generate the TextMate sample renderings (#7762)

The images beside the samples were screenshots taken by hand, so they
drifted: they still showed `package Carbon api;`, syntax the language
dropped in 2024.

`render_sample.py` renders a sample the way the grammar in this
repository actually highlights it, using `tmlanguage.py`, a small
TextMate tokenizer. VS Code runs grammars under Oniguruma, which we
cannot depend on here, but this grammar uses no Oniguruma-only syntax,
so `re` runs its regexes unchanged and the two agree on every character
of every Carbon file in the repository. The output is SVG, so
regenerating needs nothing but Python, and a later grammar change gets a
same-path image diff showing what it did to real code.

The samples change where a construct left the language (`api`, `Carbon`
as the package name, `StringView`, `destructor`), refresh the
`keywords.carbon` inventory against `token_kind.def`, and add sections
for octal, raw and block literals, character literals, lambdas, and raw
identifiers. `interop.carbon` is new, covering inline C++. These are
highlighting fixtures rather than programs, so the deliberately invalid
lines stay.

Assisted-by: Claude Code

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
Chandler Carruth
2026-09-15 20:29:22 +00:00
committed by GitHub
co-authored by Dana Jansens
parent e962b12e53
commit 37949a2066
27 changed files with 1051 additions and 11 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

+13
View File
@@ -0,0 +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="#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="#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="#9cdcfe">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">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="#4fc1ff">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="#4fc1ff">Val2</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4fc1ff">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">i32</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#4fc1ff">b</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">array</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4fc1ff">T</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#b5cea8">5</tspan><tspan fill="#d4d4d4">), </tspan><tspan fill="#4fc1ff">t</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#4fc1ff">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="#4fc1ff">Val3</tspan></text>
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681">9 </tspan><tspan fill="#d4d4d4">}</tspan></text>
</g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+2
View File
@@ -7,8 +7,10 @@
// class C; fn F[T: A](a: T) -> i32 { return 86; }
//@dump-sem-ir-begin
//@dump-sem-ir-end
//@include-in-dumps
//@dump-sem-ir-
//no whitespace after double slash
/* invalid comment pattern. */
/// invalid comment pattern.
class C; // Comment after a statement/expression/declaration.
var x: i32 = 1;// Trailing, with no space before the introducer.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

+20
View File
@@ -0,0 +1,20 @@
<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="#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="#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) -&gt; i32 { return 86; }</tspan></text>
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#6a9955">//@dump-sem-ir-begin</tspan></text>
<text style="white-space:pre" x="12" y="178"><tspan fill="#6e7681"> 9 </tspan><tspan fill="#6a9955">//@dump-sem-ir-end</tspan></text>
<text style="white-space:pre" x="12" y="197"><tspan fill="#6e7681">10 </tspan><tspan fill="#6a9955">//@include-in-dumps</tspan></text>
<text style="white-space:pre" x="12" y="216"><tspan fill="#6e7681">11 </tspan><tspan fill="#d4d4d4">//@</tspan><tspan fill="#9cdcfe">dump</tspan><tspan fill="#d4d4d4">-</tspan><tspan fill="#9cdcfe">sem</tspan><tspan fill="#d4d4d4">-</tspan><tspan fill="#9cdcfe">ir</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="#9cdcfe">no</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">whitespace</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">after</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">double</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">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="#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="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="#9cdcfe">Comment</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">after</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">statement</tspan><tspan fill="#d4d4d4">/</tspan><tspan fill="#9cdcfe">expression</tspan><tspan fill="#d4d4d4">/</tspan><tspan fill="#9cdcfe">declaration</tspan><tspan fill="#d4d4d4">.</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="#569cd6">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">;// </tspan><tspan fill="#9cdcfe">Trailing</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">with</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">no</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">space</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">before</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">the</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">introducer</tspan><tspan fill="#d4d4d4">.</tspan></text>
</g></svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+1 -1
View File
@@ -2,7 +2,7 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
package SomePackage api;
package SomePackage;
Core SomeCore;
import SomePackage;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

+15
View File
@@ -0,0 +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="#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="#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="#9cdcfe">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="#9cdcfe">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="#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>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -37,3 +37,16 @@ fn F(ref a: A, const ref b: B);
fn F() -> T;
fn F() -> T.U { return val; }
fn F() -> i32 => return val;
// --- lambdas and positional parameters
var explicit: auto = fn (x: i32) -> i32 { return x + 1; };
var expression: auto = fn (x: i32) => x + 1;
var positional: auto = fn { Print($0, $1, $42); };
// --- raw identifiers
r#class
r#if
r#i32
var r#var: i32 = r#class;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

@@ -0,0 +1,56 @@
<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="#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="#569cd6">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="#9cdcfe">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">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">) -&gt; </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="#569cd6">i32</tspan><tspan fill="#d4d4d4">) -&gt; </tspan><tspan fill="#569cd6">i32</tspan><tspan fill="#d4d4d4"> =&gt; </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="#dcdcaa">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="#9cdcfe">A</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">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="#9cdcfe">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="#9cdcfe">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="#4ec9b0">A</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">B</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">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="#569cd6">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="#9cdcfe">I</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#9cdcfe">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="#569cd6">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="#569cd6">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="#c586c0">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">type</tspan><tspan fill="#d4d4d4">;</tspan></text>
<text style="white-space:pre" x="12" y="520"><tspan fill="#6e7681">27 </tspan><tspan fill="#c586c0">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="#c586c0">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="#c586c0">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="#c586c0">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">() -&gt; </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">() -&gt; </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="#9cdcfe">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">() -&gt; </tspan><tspan fill="#569cd6">i32</tspan><tspan fill="#d4d4d4"> =&gt; </tspan><tspan fill="#c586c0">return</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">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="#569cd6">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="#569cd6">i32</tspan><tspan fill="#d4d4d4">) -&gt; </tspan><tspan fill="#569cd6">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="#569cd6">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="#569cd6">i32</tspan><tspan fill="#d4d4d4">) =&gt; </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="#569cd6">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="#b5cea8">0</tspan><tspan fill="#d4d4d4">, $</tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">, $</tspan><tspan fill="#b5cea8">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="#9cdcfe">r</tspan><tspan fill="#d4d4d4">#</tspan><tspan fill="#569cd6">class</tspan></text>
<text style="white-space:pre" x="12" y="957"><tspan fill="#6e7681">50 </tspan><tspan fill="#4ec9b0">r</tspan><tspan fill="#d4d4d4">#</tspan><tspan fill="#c586c0">if</tspan></text>
<text style="white-space:pre" x="12" y="976"><tspan fill="#6e7681">51 </tspan><tspan fill="#4ec9b0">r</tspan><tspan fill="#d4d4d4">#</tspan><tspan fill="#569cd6">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"> </tspan><tspan fill="#4ec9b0">r</tspan><tspan fill="#d4d4d4">#</tspan><tspan fill="#569cd6">var</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#4ec9b0">r</tspan><tspan fill="#d4d4d4">#</tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4">;</tspan></text>
</g></svg>

After

Width:  |  Height:  |  Size: 15 KiB

+29
View File
@@ -0,0 +1,29 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Inline C++ is scoped `meta.embedded.block.cpp`, so an editor that has a C++
// grammar highlights them as C++; these renderings come from the Carbon grammar
// alone, so that content shows plain.
package Sample library "interop";
import Cpp library "<cstdio>";
import Cpp library "<string_view>";
import Cpp inline '''c++
int FromImport() { return 1; }
''';
import Cpp inline "int OneLiner() { return 2; }";
inline Cpp '''
int FromBlock() { return 3; }
''';
fn Uses() {
var value: Cpp.int = 1 as Cpp.int;
var widened: Cpp.size_t = value as Cpp.size_t;
var back: i32 = value unsafe as i32;
Cpp.printf("%d\n", value);
}
+33
View File
@@ -0,0 +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="#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="#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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"&lt;cstdio&gt;"</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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">library</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"&lt;string_view&gt;"</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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">'''</tspan><tspan fill="#d7ba7d">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="#ce9178">'''</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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">inline</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">"</tspan><tspan fill="#d4d4d4">int OneLiner() { return 2; }</tspan><tspan fill="#ce9178">"</tspan><tspan fill="#d4d4d4">;</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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#ce9178">'''</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="#ce9178">'''</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="#4ec9b0">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="#4ec9b0">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="#4ec9b0">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="#569cd6">i32</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#9cdcfe">value</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">unsafe</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">as</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">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="#9cdcfe">Cpp</tspan><tspan fill="#d4d4d4">.</tspan><tspan fill="#dcdcaa">printf(</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>

After

Width:  |  Height:  |  Size: 7.1 KiB

+12 -5
View File
@@ -4,8 +4,9 @@
// --- operators
>>= <=> <<= &= == != >= >> <= << -= -> -- %= \ = += ++ /= *= & ^ = > < - % . | + / *
and as impls in like not or partial ref template where
>>= <=> <<= ->? &= ^= := :? == => != >= >> <= <> << <- -= -> -- %= |= += ++ /=
*= ~= & @ ^ : = ! > < - % . | + ? / * ~ \
and as impls in like not or where
// --- special-keywords
@@ -14,7 +15,8 @@ default =>
// --- introducer-keywords
adapt alias choice class constraint fn import interface let library namespace var
adapt alias choice class constraint fn import inline interface let library
match_first namespace observe require var
base
export
impl
@@ -22,7 +24,8 @@ package
// --- modifier-keywords
abstract const extend extern final private protected virtual
abstract const eval extend extern final generic musteval override partial
private protected ref runtime static template unsafe unused val virtual
base class
default
export import
@@ -32,13 +35,17 @@ impl package
// --- misc-keywords
auto destructor forall friend observe override require
forall form friend
.base
// --- self-keywords
self Self
// --- package-roots
Core Cpp
// --- underscore
;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

+57
View File
@@ -0,0 +1,57 @@
<svg xmlns="http://www.w3.org/2000/svg" width="721" height="1031" viewBox="0 0 721 1031">
<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="#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">&gt;&gt;= &lt;=&gt; &lt;&lt;= -&gt;? &amp;= ^= := :? == =&gt; != &gt;= &gt;&gt; &lt;= &lt;&gt; &lt;&lt; &lt;- -= -&gt; -- %= |= += ++ /=</tspan></text>
<text style="white-space:pre" x="12" y="159"><tspan fill="#6e7681"> 8 </tspan><tspan fill="#d4d4d4">*= ~= &amp; @ ^ : = ! &gt; &lt; - % . | + ? / * ~ \</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">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"> =&gt;</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="#569cd6">choice</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">class</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">constraint</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">fn</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">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="#569cd6">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="#4ec9b0">match_first</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">namespace</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">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="#4ec9b0">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="#c586c0">generic</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">musteval</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">override</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">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="#c586c0">ref</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">runtime</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">static</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">template</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">unsafe</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#c586c0">unused</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">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">forall</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">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="#d4d4d4">.</tspan><tspan fill="#569cd6">base</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">// --- self-keywords</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">self</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">Self</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="#6a9955">// --- package-roots</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="#4ec9b0">Core</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#4ec9b0">Cpp</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="#6a9955">// --- underscore</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="#d4d4d4">;</tspan></text>
<text style="white-space:pre" x="12" y="995"><tspan fill="#6e7681">52 </tspan><tspan fill="#569cd6">_</tspan></text>
<text style="white-space:pre" x="12" y="1014"><tspan fill="#6e7681">53 </tspan><tspan fill="#9cdcfe">_some_var</tspan></text>
</g></svg>

After

Width:  |  Height:  |  Size: 10 KiB

+23 -1
View File
@@ -11,6 +11,24 @@
''' Multi line
string
'''
'''py
Block literal with a file type indicator.
'''
#"a raw \n literal, where \#n is the escape"#
##"nested "# stays inside, and \##n is the escape"##
#'''
A raw block literal.
'''#
"unterminated
// --- characters
'a' '\n' '\0' '\u{1F600}'
'\x70'
''
'abcde'
// --- true-false
@@ -18,7 +36,7 @@ true false
// --- type-literals
array bool char str type ;
array auto bool char str type
i8 i16 i32 i64 i128 i10
u8 u16 u32 u64 u128 u11
f8 f16 f32 f64 f128 f12
@@ -34,6 +52,10 @@ f8 f16 f32 f64 f128 f12
.123
.1e3
0o755
0o_17
0o8
0b1011_0010
0b_010
0b2345
Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

+72
View File
@@ -0,0 +1,72 @@
<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="#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="#d4d4d4">'</tspan><tspan fill="#9cdcfe">C</tspan><tspan fill="#d4d4d4">'</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">'''Single 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="#d7ba7d">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="#d4d4d4">#</tspan><tspan fill="#ce9178">"a raw </tspan><tspan fill="#d7ba7d">\n</tspan><tspan fill="#ce9178"> literal, where \#n is the escape"</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="#ce9178">"nested "</tspan><tspan fill="#d4d4d4"># </tspan><tspan fill="#9cdcfe">stays</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">inside</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#c586c0">and</tspan><tspan fill="#d4d4d4"> \##</tspan><tspan fill="#9cdcfe">n</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">is</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">the</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">escape</tspan><tspan fill="#ce9178">"##</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">"</tspan><tspan fill="#9cdcfe">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="#d4d4d4">'</tspan><tspan fill="#9cdcfe">a</tspan><tspan fill="#d4d4d4">' '\</tspan><tspan fill="#9cdcfe">n</tspan><tspan fill="#d4d4d4">' '\</tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">' '\</tspan><tspan fill="#9cdcfe">u</tspan><tspan fill="#d4d4d4">{</tspan><tspan fill="#b5cea8">1</tspan><tspan fill="#d4d4d4">F</tspan><tspan fill="#b5cea8">600</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">x70</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><tspan fill="#d4d4d4">'</tspan><tspan fill="#9cdcfe">abcde</tspan><tspan fill="#d4d4d4">'</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="#569cd6">array</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">auto</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">bool</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">char</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">str</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">type</tspan></text>
<text style="white-space:pre" x="12" y="767"><tspan fill="#6e7681">40 </tspan><tspan fill="#569cd6">i8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">i16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">i32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">i64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">i128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">i10</tspan></text>
<text style="white-space:pre" x="12" y="786"><tspan fill="#6e7681">41 </tspan><tspan fill="#569cd6">u8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">u16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">u32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">u64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">u128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">u11</tspan></text>
<text style="white-space:pre" x="12" y="805"><tspan fill="#6e7681">42 </tspan><tspan fill="#569cd6">f8</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">f16</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">f32</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">f64</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#569cd6">f128</tspan><tspan fill="#d4d4d4"> </tspan><tspan fill="#9cdcfe">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">1</tspan><tspan fill="#d4d4d4">e</tspan><tspan fill="#b5cea8">5</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">1</tspan><tspan fill="#d4d4d4">e</tspan><tspan fill="#b5cea8">3</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">0</tspan><tspan fill="#d4d4d4">o</tspan><tspan fill="#b5cea8">755</tspan></text>
<text style="white-space:pre" x="12" y="1071"><tspan fill="#6e7681">56 </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">o_</tspan><tspan fill="#b5cea8">17</tspan></text>
<text style="white-space:pre" x="12" y="1090"><tspan fill="#6e7681">57 </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">o</tspan><tspan fill="#b5cea8">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">0b2345</tspan></text>
<text style="white-space:pre" x="12" y="1185"><tspan fill="#6e7681">62 </tspan><tspan fill="#b5cea8">0</tspan><tspan fill="#d4d4d4">B</tspan><tspan fill="#b5cea8">011</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">XA</tspan><tspan fill="#b5cea8">85</tspan><tspan fill="#d4d4d4">CE</tspan></text>
</g></svg>

After

Width:  |  Height:  |  Size: 12 KiB

+4 -4
View File
@@ -4,7 +4,7 @@
// More single line comments
package Carbon api;
package Carbon;
interface HasValueParam(T: type, V: T) {
fn Go(self) -> T;
@@ -25,7 +25,7 @@ class Point {
fn Procedure() -> i32 {
returned var zoop: i32 = 0;
while (DoSomeJob() {
while (DoSomeJob()) {
zoop += 1;
}
@@ -38,9 +38,9 @@ fn Main() -> i32 {
let bin = 0b0000111001010010;
let dec = 123456789012345678;
let big: Carbon.Int(1024) = 1234;
let big: Core.Int(1024) = 1234;
let aaa: auto = "Carbon";
let view: StringView = "Carbon";
let view: str = "Carbon";
return Procedure();
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

+50
View File
@@ -0,0 +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="#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="#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="#9cdcfe">T</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">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">) -&gt; </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="#4ec9b0">HasValueParam</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#569cd6">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">) -&gt; </tspan><tspan fill="#569cd6">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">() -&gt; </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="#569cd6">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="#569cd6">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">() -&gt; </tspan><tspan fill="#569cd6">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="#569cd6">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="#9cdcfe">Main</tspan><tspan fill="#d4d4d4">() -&gt; </tspan><tspan fill="#569cd6">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="#569cd6">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="#4ec9b0">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="#569cd6">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="#569cd6">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>

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

+45
View File
@@ -0,0 +1,45 @@
<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="#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="#9cdcfe">T1</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">type</tspan><tspan fill="#d4d4d4">, </tspan><tspan fill="#9cdcfe">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="#4ec9b0">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="#9cdcfe">T1</tspan><tspan fill="#d4d4d4">: </tspan><tspan fill="#569cd6">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="#9cdcfe">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="#4ec9b0">B</tspan><tspan fill="#d4d4d4">(</tspan><tspan fill="#4ec9b0">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">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="#569cd6">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="#569cd6">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="#569cd6">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="#4ec9b0">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="#4ec9b0">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="#9cdcfe">B</tspan><tspan fill="#d4d4d4"> = </tspan><tspan fill="#9cdcfe">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="#9cdcfe">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>

After

Width:  |  Height:  |  Size: 11 KiB