From: Ian Jackson Date: Thu, 24 Oct 2019 14:10:55 +0000 (+0100) Subject: make-secnet-sites: Introduce copyout() in pline() X-Git-Tag: v0.5.0~20 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b840a97a298d84f35da6972de468fe8bc298a570;p=secnet.git make-secnet-sites: Introduce copyout() in pline() These are all the places where we simply copy the input line to our output. We are going to do something more complicated in a moment, so centralising this is useful. No functional change. Signed-off-by: Ian Jackson --- diff --git a/make-secnet-sites b/make-secnet-sites index cff283c..55c66cc 100755 --- a/make-secnet-sites +++ b/make-secnet-sites @@ -545,11 +545,12 @@ def pline(i,allow_include=False): w=list([Tainted(x) for x in w]) keyword=w[0] current=obstack[len(obstack)-1] + copyout=lambda: [i] if keyword=='end-definitions': keyword.raw_mark_ok() allow_defs=sitelevel.depth obstack=[root] - return [i] + return copyout() if keyword=='include': if not allow_include: complain("include not permitted here") @@ -591,7 +592,7 @@ def pline(i,allow_include=False): current.children[tname]=nl current=nl obstack.append(current) - return [i] + return copyout() if keyword.raw() not in current.allow_properties: complain("Property %s not allowed at %s level"% (keyword.raw(),current.type)) @@ -601,7 +602,7 @@ def pline(i,allow_include=False): return [] else: set_property(current,w) - return [i] + return copyout() complain("unknown keyword '%s'"%(keyword.raw()))