From 549732a20679236299c14e73c36c9a7d32290c48 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Tue, 19 May 2026 01:03:09 -0400 Subject: [PATCH 1/2] Add lazy keyword. --- src/languages/python.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/python.js b/src/languages/python.js index d1beb9605e..76abaa23e2 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -58,7 +58,7 @@ export default { }, }, 'keyword': - /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, + /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield|lazy)\b/, 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, 'boolean': /\b(?:False|None|True)\b/, @@ -67,4 +67,4 @@ export default { 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, 'punctuation': /[{}[\];(),.:]/, }, -}; +}; \ No newline at end of file From d09d9eba643d5ea917ba036275d1e21f4082d5dd Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Tue, 19 May 2026 01:05:09 -0400 Subject: [PATCH 2/2] Add a test case. --- tests/languages/python/keyword_feature.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/languages/python/keyword_feature.test b/tests/languages/python/keyword_feature.test index faf1dc04aa..9284e43a0f 100644 --- a/tests/languages/python/keyword_feature.test +++ b/tests/languages/python/keyword_feature.test @@ -9,7 +9,7 @@ pass print raise return try while with yield nonlocal and not or -match case _: +match case _: lazy ---------------------------------------------------- @@ -25,9 +25,9 @@ match case _: ["keyword", "try"], ["keyword", "while"], ["keyword", "with"], ["keyword", "yield"], ["keyword", "nonlocal"], ["keyword", "and"], ["keyword", "not"], ["keyword", "or"], - ["keyword", "match"], ["keyword", "case"], ["keyword", "_"], ["punctuation", ":"] + ["keyword", "match"], ["keyword", "case"], ["keyword", "_"], ["punctuation", ":"], ["keyword", "lazy"] ] ---------------------------------------------------- -Checks for all keywords. +Checks for all keywords. \ No newline at end of file