summaryrefslogtreecommitdiff
path: root/contrib/new-theory.awk
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-03-21 15:48:57 -0700
committerGitHub <noreply@github.com>2018-03-21 15:48:57 -0700
commitbdba2bf65eb2f68daa1a5e488c4e50f5dac1b312 (patch)
tree3f97efe21f089d3abb5d9a2b53c0c7ee63ba06bb /contrib/new-theory.awk
parent966960b424aa5901a03abbfaa1bcdac6e3ed90dc (diff)
Refactor mkoptions (#1631)
This commit refactors code generation for options. It uses a new configuration format for defining options (*.toml) and a new Python script mkoptions.py to generate the source code and option documentation. The option behavior did not change for most of the options, except that for bool --enable-/--disable- long options enable/disable was removed. E.g. --enable-miplib-trick and --disable-miplib-trick got changed to --miplib-trick and --no-miplib-trick. This commit fixes also an issues with set-option/get-option via the SMT2 interface. Before long options were only accessible if the name included the =ARG part.
Diffstat (limited to 'contrib/new-theory.awk')
-rwxr-xr-xcontrib/new-theory.awk18
1 files changed, 4 insertions, 14 deletions
diff --git a/contrib/new-theory.awk b/contrib/new-theory.awk
index 6c523f259..1adbb2f24 100755
--- a/contrib/new-theory.awk
+++ b/contrib/new-theory.awk
@@ -1,17 +1,7 @@
#!/bin/awk -v name=theory_new -f
#
-# The do nothing rule
-!/^OPTIONS_SRC_FILES = \\|^OPTIONS_TEMPS = \\|^OPTIONS_OPTIONS_FILES = \\|^OPTIONS_SEDS = \\|^OPTIONS_HEADS = \\|^OPTIONS_CPPS = \\/ {print$0}
-# Add the name to the correct locations.
-/^OPTIONS_SRC_FILES = \\/{print $0; printf "\t%s_options \\\n", name;}
-/^OPTIONS_TEMPS = \\/{print $0; printf "\t%s_options.tmp \\\n", name;}
-/^OPTIONS_OPTIONS_FILES = \\/{print $0; printf "\t%s_options.options \\\n", name;}
-/^OPTIONS_SEDS = \\/{print $0; printf "\t%s_options.sed \\\n", name;}
-/^OPTIONS_HEADS = \\/{print $0; printf "\t%s_options.h \\\n", name;}
-/^OPTIONS_CPPS = \\/{print $0; printf "\t%s_options.cpp \\\n", name;}
-# Add the rule for name_options.
-END{printf "%s_options:;\n", name}
-# Add the rules for name_options.tmp
-END{printf ".PHONY: %s_options.tmp\n", name}
-END{printf "%s_options.tmp:\n\techo \"$@\" \"$(@:.tmp=)\"\n\t$(AM_V_GEN)(cp \"@srcdir@/$(@:.tmp=)\" \"$@\" || true)\n", name}
+# Keep non-matching lines unchanged
+!/^OPTIONS_CONFIG_FILES = \\/ {print$0}
+# Add *_options.toml to OPTIONS_CONFIG_FILES
+/^OPTIONS_CONFIG_FILES = \\/{print $0; printf "\t%s_options.toml \\\n", name;}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback