Add typeof to syntax highlighters. (#7859)

Assisted-by: Claude via Antigravity
This commit is contained in:
Richard Smith
2026-09-29 20:46:54 +00:00
committed by GitHub
parent 8c86876034
commit 5dae7b40b9
7 changed files with 8 additions and 4 deletions
@@ -71,6 +71,7 @@ export default function (hljs) {
'returned',
'then',
'type',
'typeof',
'_',
'unused',
'var',
+1 -1
View File
@@ -6,7 +6,7 @@
>>= <=> <<= ->? &= ^= := :? == => != >= >> <= <> << <- -= -> -- %= |= += ++ /=
*= ~= & @ ^ : = ! > < - % . | + ? / * ~ \
and as impls in like not or where
and as impls in like not or typeof where
// --- special-keywords
+1 -1
View File
@@ -9,7 +9,7 @@
<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="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>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

+1 -1
View File
@@ -463,7 +463,7 @@ THIS FILE IS AUTOGENERATED FROM carbon.tmLanguage.json. DO NOT EDIT.
</dict>
<dict>
<key>match</key>
<string>\b(and|as|impls|in|like|not|or|where)\b</string>
<string>\b(and|as|impls|in|like|not|or|typeof|where)\b</string>
<key>name</key>
<string>keyword.control.carbon</string>
</dict>
+1
View File
@@ -130,6 +130,7 @@
"template"
"then"
"type"
; "typeof"
"var"
"virtual"
"where"
+2
View File
@@ -56,6 +56,7 @@ syn keyword carbonKeywordSelf Self
syn keyword carbonKeywordAs as
syn keyword carbonKeywordTemplate template
syn keyword carbonKeywordStatic static
syn keyword carbonKeywordTypeOf typeof
syn keyword carbonKeywordExternal external
syn keyword carbonKeywordForAll forall
syn keyword carbonKeywordAPI api
@@ -99,6 +100,7 @@ hi def link carbonKeywordSelf carbonKeyword
hi def link carbonKeywordAs carbonKeyword
hi def link carbonKeywordTemplate carbonKeyword
hi def link carbonKeywordStatic carbonKeyword
hi def link carbonKeywordTypeOf carbonKeyword
hi def link carbonKeywordExternal carbonKeyword
hi def link carbonKeywordForAll carbonKeyword
hi def link carbonKeywordAPI Structure
+1 -1
View File
@@ -343,7 +343,7 @@
},
{
"name": "keyword.control.carbon",
"match": "\\b(and|as|impls|in|like|not|or|where)\\b"
"match": "\\b(and|as|impls|in|like|not|or|typeof|where)\\b"
},
{
"name": "keyword.other.carbon",