Files
carbon-lang/utils/textmate/Samples/interop.svg
T
Chandler Carruth 25b77cd3d4 Revert "Improve the TextMate grammar scopes and precision (#7888)" (#7909)
This reverts commit 65a3c2b36a.

It was merged by accident with a dependent change. Will re-land
independently.
2026-10-06 20:17:51 +00:00

34 lines
6.9 KiB
XML

<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="#4ec9b0">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="#4ec9b0">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="#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>