From 0e67bdaa847c6d67497016db52e06af357f2e85c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 16 Sep 2020 23:34:30 +0200 Subject: treewide: implement strict assignment mode Signed-off-by: Jo-Philipp Wich --- main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 68b39c1..18db4a7 100644 --- a/main.c +++ b/main.c @@ -38,13 +38,14 @@ print_usage(char *app) { printf( "== Usage ==\n\n" - " # %s [-d] [-l] [-r] {-i | -s \"utpl script...\"}\n" + " # %s [-d] [-l] [-r] [-S] {-i | -s \"utpl script...\"}\n" " -h, --help Print this help\n" " -i file Specify an utpl script to parse\n" " -s \"utpl script...\" Specify an utpl code fragment to parse\n" " -d Instead of executing the script, dump the resulting AST as dot\n" " -l Do not strip leading block whitespace\n" - " -r Do not trim trailing block newlines\n", + " -r Do not trim trailing block newlines\n" + " -S Enable strict mode\n", app); } @@ -198,7 +199,7 @@ main(int argc, char **argv) state->lstrip_blocks = 1; state->trim_blocks = 1; - while ((opt = getopt(argc, argv, "dhlri:s:")) != -1) + while ((opt = getopt(argc, argv, "dhlrSi:s:")) != -1) { switch (opt) { case 'h': @@ -231,6 +232,10 @@ main(int argc, char **argv) case 's': source = optarg; break; + + case 'S': + state->strict_declarations = 1; + break; } } -- cgit v1.2.3