From bb73c36f1226ac419f106277df66a05825a1b744 Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Sat, 13 May 2023 19:47:39 -0700 Subject: [PATCH] + added async/await and nonlocal keywords --- idapython.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idapython.cpp b/idapython.cpp index 1501af7..5617494 100644 --- a/idapython.cpp +++ b/idapython.cpp @@ -615,7 +615,7 @@ struct python_highlighter_t : public ida_syntax_highlighter_t add_keywords( "and|as|assert|break|class|continue|def|" "del|elif|else|except|exec|finally|" - "for|from|global|if|import|in|" + "for|from|global|nonlocal|if|import|in|" "is|lambda|not|or|pass|print|" "raise|return|try|while|with|yield|" "None|True|False",HF_KEYWORD1); @@ -628,6 +628,8 @@ struct python_highlighter_t : public ida_syntax_highlighter_t // Add new keywords (3.10+): int py_major = 0, py_minor= 0; qsscanf(Py_GetVersion(), "%d.%d", &py_major, &py_minor); + if ( py_major >= 3 && py_minor >= 5 ) + add_keywords("async|await", HF_KEYWORD1); if ( py_major >= 3 && py_minor >= 10 ) add_keywords("match|case", HF_KEYWORD1); }