From 521b370f2bde9454b69d10e2d6b1be90f94790cd Mon Sep 17 00:00:00 2001 From: JGoutin Date: Mon, 27 Feb 2017 18:50:44 +0100 Subject: [PATCH] Missing Cython keywords --- spyder/utils/syntaxhighlighters.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spyder/utils/syntaxhighlighters.py b/spyder/utils/syntaxhighlighters.py index e171b7d6a2a..dfdcbb92d1d 100644 --- a/spyder/utils/syntaxhighlighters.py +++ b/spyder/utils/syntaxhighlighters.py @@ -551,13 +551,17 @@ def rehighlight(self): #============================================================================== # Cython syntax highlighter #============================================================================== -C_TYPES = 'bool char double enum float int long mutable short signed struct unsigned void' +C_TYPES = 'bool char double enum float int long mutable short signed struct unsigned void NULL' class CythonSH(PythonSH): """Cython Syntax Highlighter""" - ADDITIONAL_KEYWORDS = ["cdef", "ctypedef", "cpdef", "inline", "cimport", - "DEF"] - ADDITIONAL_BUILTINS = C_TYPES.split() + ADDITIONAL_KEYWORDS = [ + "cdef", "ctypedef", "cpdef", "inline", "cimport", "extern", + "include", "begin", "end", "by", "gil", "nogil", "const", "public", + "readonly", "fused ", "static", "api", "DEF", "IF", "ELIF", "ELSE"] + + ADDITIONAL_BUILTINS = C_TYPES.split() + [ + "array", "bint", "Py_ssize_t", "intern", "reload", "sizeof"] PROG = re.compile(make_python_patterns(ADDITIONAL_KEYWORDS, ADDITIONAL_BUILTINS), re.S) IDPROG = re.compile(r"\s+([\w\.]+)", re.S)