From d9ac25402fa9ff918e1f1da4e3e0d97281e437c4 Mon Sep 17 00:00:00 2001 From: Patrice Clement Date: Thu, 16 Jul 2020 22:46:02 +0200 Subject: allow java-config to parse inverted conditions. ... aka exclamation marks. Patch courtesy of njsg on IRC. Signed-off-by: Patrice Clement --- src/java_config_2/VersionManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/java_config_2/VersionManager.py b/src/java_config_2/VersionManager.py index cb30e88..a876f02 100644 --- a/src/java_config_2/VersionManager.py +++ b/src/java_config_2/VersionManager.py @@ -110,7 +110,11 @@ class VersionManager: for token in tokens: if token[-1] == "?": - if token[:-1] not in useflags: + if token.startswith("!"): + skip = token[1:-1] in useflags + else: + skip = token[:-1] not in useflags + if skip: level = 0 while 1: token = next(tokens) -- cgit v1.2.3-65-gdbad