resolver.pxd.in 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. from cms.cython_support cimport *
  2. cdef enum:
  3. MACRO_STACK_SIZE = 64
  4. MACRO_STACK_NAME_SIZE = 32
  5. cdef struct _StackElem:
  6. int64_t lineno
  7. Py_UCS4 name[MACRO_STACK_NAME_SIZE]
  8. cdef class _IndexRef(object):
  9. cdef int64_t charOffset
  10. cdef class _Anchor(object):
  11. cdef str name
  12. cdef str text
  13. cdef int64_t indent
  14. cdef _Bool noIndex
  15. cdef str makeUrl(self, CMSStatementResolver resolver)
  16. cdef class _ArgParserRet(object):
  17. cdef int64_t cons
  18. cdef list arguments
  19. cdef class _ResolverRet(object):
  20. cdef int64_t cons
  21. cdef str data
  22. cdef class CMSStatementResolver(object):
  23. cdef public object cms
  24. cdef public dict variables
  25. cdef public object pageIdent
  26. cdef public uint64_t charCount
  27. cdef public list indexRefs
  28. cdef public list anchors
  29. cdef _StackElem __callStack[MACRO_STACK_SIZE]
  30. cdef uint16_t __callStackLen
  31. cdef list __macroArgs
  32. cdef dict __handlers
  33. cdef str __escapedChars
  34. cdef str VARNAME_CHARS
  35. cdef str expandVariable(self, str name)
  36. cpdef str escape(self, str data)
  37. cpdef str unescape(self, str data)
  38. cdef _ResolverRet __do_compare(self, str d, int64_t dOffs, _Bool invert)
  39. cdef str __do_arith(self, object oper, list args)
  40. cdef _ArgParserRet __parseArguments(self, str d, int64_t dOffs, _Bool strip)
  41. cdef _ResolverRet __doMacro(self, str macroname, str d, int64_t dOffs)
  42. cdef _ResolverRet __expandRecStmts(self, str d, int64_t dOffs, str stopchars)