Home | History | Annotate | Download | only in tests

Lines Matching full:sexp

26 # We represent a sexp in Python using nested lists containing strings.
27 # So, for example, the sexp (constant float (1.000000)) is represented
32 def check_sexp(sexp):
33 """Verify that the argument is a proper sexp.
39 if isinstance(sexp, list):
40 for s in sexp:
42 elif not isinstance(sexp, basestring):
43 raise Exception('Not a sexp: {0!r}'.format(sexp))
45 def parse_sexp(sexp):
47 into a sexp represented as nested lists containing strings.
52 for match in sexp_token_regexp.finditer(sexp):
59 sexp = stack.pop()
60 stack[-1].append(sexp)
69 def sexp_to_string(sexp):
70 """Convert a sexp, represented as nested lists containing strings,
73 if isinstance(sexp, basestring):
74 return sexp
75 assert isinstance(sexp, list)
77 for s in sexp:
88 def sort_decls(sexp):
89 """Sort all toplevel variable declarations in sexp.
94 assert isinstance(sexp, list)
97 for s in sexp: