From b840a97a298d84f35da6972de468fe8bc298a570 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 24 Oct 2019 15:10:55 +0100 Subject: [PATCH] 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 --- make-secnet-sites | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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())) -- 2.30.2