aboutsummaryrefslogtreecommitdiffstats
path: root/cms/resolver.pxd.in
blob: c78e4f4c18291354cada1c969a3668d758e54a77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from cms.cython_support cimport *

cdef enum:
	MACRO_STACK_SIZE	= 64
	MACRO_STACK_NAME_SIZE	= 16

cdef struct _StackElem:
	Py_UCS4 name[MACRO_STACK_NAME_SIZE]
	int64_t lineno

cdef class _IndexRef(object):
	cdef int64_t charOffset

cdef class _Anchor(object):
	cdef str name
	cdef str text
	cdef int64_t indent
	cdef _Bool noIndex

	cdef str makeUrl(self, CMSStatementResolver resolver)

cdef class _ArgParserRet(object):
	cdef int64_t cons
	cdef list arguments

cdef class _ResolverRet(object):
	cdef int64_t cons
	cdef str data

cdef class CMSStatementResolver(object):
	cdef public object cms
	cdef public dict variables
	cdef public object pageIdent
	cdef public uint64_t charCount
	cdef public list indexRefs
	cdef public list anchors

	cdef _StackElem __callStack[MACRO_STACK_SIZE]
	cdef int32_t __callStackLen

	cdef object __macro_arg_re
	cdef dict __handlers
	cdef str __escapedChars
	cdef str VARNAME_CHARS

	cdef str expandVariable(self, str name)

	cpdef str escape(self, str data)
	cpdef str unescape(self, str data)

	cdef _ResolverRet __do_compare(self, str d, int64_t dOffs, _Bool invert)
	cdef str __do_arith(self, object oper, list args)

	cdef _ArgParserRet __parseArguments(self, str d, int64_t dOffs, _Bool strip)
	cdef _ResolverRet __doMacro(self, str macroname, str d, int64_t dOffs)
	cdef _ResolverRet __expandRecStmts(self, str d, int64_t dOffs, str stopchars)
bues.ch cgit interface