entry = dest_scope.declare_cfunction(name, type, declarator.pos,
cname = cname, visibility = self.visibility, in_pxd = self.in_pxd,
api = self.api)
- entry.pxd_locals = self.pxd_locals
+ if entry is not None:
+ entry.pxd_locals = self.pxd_locals
else:
if self.in_pxd and self.visibility != 'extern':
error(self.pos,
import sys
from time import time
+import cython
+cython.declare(EncodedString=object, string_prefixes=object, raw_prefixes=object, IDENT=object)
+
from Cython import Plex, Utils
from Cython.Plex.Scanners import Scanner
from Cython.Plex.Errors import UnrecognizedInput
from Errors import CompileError, error
-from Lexicon import string_prefixes, raw_prefixes, make_lexicon
+from Lexicon import string_prefixes, raw_prefixes, make_lexicon, IDENT
from StringEncoding import EncodedString
d[word] = 1
return d
+cython.declare(resword_dict=object)
resword_dict = build_resword_dict()
#------------------------------------------------------------------
sy, systring = self.read()
except UnrecognizedInput:
self.error("Unrecognized character")
- if sy == 'IDENT':
+ if sy == IDENT:
if systring in resword_dict:
sy = systring
else:
self.expected(what, message)
def expect_keyword(self, what, message = None):
- if self.sy == 'IDENT' and self.systring == what:
+ if self.sy == IDENT and self.systring == what:
self.next()
else:
self.expected(what, message)