From dec0da32e4415f095b4f1754571af8f7f31dc8fc Mon Sep 17 00:00:00 2001 From: "Federico G. Schwindt" Date: Fri, 12 Feb 2016 10:48:18 +0000 Subject: [PATCH] Don't abort on unknown keywords by default Just warn unless --strict is used. This allows to use the same .vcc in 4.0 and 4.1. --- lib/libvcc/vmodtool.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py index 7662557ef4..bb29bd4e5a 100755 --- a/lib/libvcc/vmodtool.py +++ b/lib/libvcc/vmodtool.py @@ -791,7 +791,15 @@ def parse(self, vx): o = parse_func(self, pobj=vx[1].nam) vx[1].add_method(o) else: - raise FormatError("Unknown keyword: %s" % t.str, "") + if opts.strict: + raise FormatError("Unknown keyword: %s" % + t.str, "") + else: + print("WARNING: Unknown keyword: %s:" % + t.str, file=sys.stderr) + o = None + while len(self.tl) > 0: + self.get_token() assert len(self.tl) == 0 if o is None and len(self.l) > 0: