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 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