diff --git a/utils/highlightjs/highlightjs_carbon_lang.js b/utils/highlightjs/highlightjs_carbon_lang.js index 2c1b355bb031..3e15719f551b 100644 --- a/utils/highlightjs/highlightjs_carbon_lang.js +++ b/utils/highlightjs/highlightjs_carbon_lang.js @@ -71,6 +71,7 @@ export default function (hljs) { 'returned', 'then', 'type', + 'typeof', '_', 'unused', 'var', diff --git a/utils/textmate/Samples/keywords.carbon b/utils/textmate/Samples/keywords.carbon index ec8d30452388..40c04d5c9663 100644 --- a/utils/textmate/Samples/keywords.carbon +++ b/utils/textmate/Samples/keywords.carbon @@ -6,7 +6,7 @@ >>= <=> <<= ->? &= ^= := :? == => != >= >> <= <> << <- -= -> -- %= |= += ++ /= *= ~= & @ ^ : = ! > < - % . | + ? / * ~ \ -and as impls in like not or where +and as impls in like not or typeof where // --- special-keywords diff --git a/utils/textmate/Samples/keywords.svg b/utils/textmate/Samples/keywords.svg index 316139a8574e..16af23e8af4b 100644 --- a/utils/textmate/Samples/keywords.svg +++ b/utils/textmate/Samples/keywords.svg @@ -9,7 +9,7 @@ 6 7 >>= <=> <<= ->? &= ^= := :? == => != >= >> <= <> << <- -= -> -- %= |= += ++ /= 8 *= ~= & @ ^ : = ! > < - % . | + ? / * ~ \ - 9 and as impls in like not or where + 9 and as impls in like not or typeof where 10 11 // --- special-keywords 12 diff --git a/utils/textmate/Syntaxes/carbon.tmLanguage b/utils/textmate/Syntaxes/carbon.tmLanguage index d0142432ffc0..41b21a5ccdf5 100644 --- a/utils/textmate/Syntaxes/carbon.tmLanguage +++ b/utils/textmate/Syntaxes/carbon.tmLanguage @@ -463,7 +463,7 @@ THIS FILE IS AUTOGENERATED FROM carbon.tmLanguage.json. DO NOT EDIT. match - \b(and|as|impls|in|like|not|or|where)\b + \b(and|as|impls|in|like|not|or|typeof|where)\b name keyword.control.carbon diff --git a/utils/tree_sitter/queries/highlights.scm b/utils/tree_sitter/queries/highlights.scm index 8be9a4a10fd1..f04d17202b19 100644 --- a/utils/tree_sitter/queries/highlights.scm +++ b/utils/tree_sitter/queries/highlights.scm @@ -130,6 +130,7 @@ "template" "then" "type" + ; "typeof" "var" "virtual" "where" diff --git a/utils/vim/syntax/carbon.vim b/utils/vim/syntax/carbon.vim index 9df41690b2cc..99e80436f664 100644 --- a/utils/vim/syntax/carbon.vim +++ b/utils/vim/syntax/carbon.vim @@ -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 diff --git a/utils/vscode/carbon.tmLanguage.json b/utils/vscode/carbon.tmLanguage.json index f9cd17f047fd..34344a1a7687 100644 --- a/utils/vscode/carbon.tmLanguage.json +++ b/utils/vscode/carbon.tmLanguage.json @@ -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",