Skip to content

Commit

Permalink
Missing Cython keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin authored Feb 27, 2017
1 parent 8b2b222 commit 521b370
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spyder/utils/syntaxhighlighters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 521b370

Please sign in to comment.