summaryrefslogtreecommitdiff
path: root/unsorted/Parameter.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
commitd1f153d34b023d81768f6087f67dbfff714bafc9 (patch)
treea694d470a60655d0cda15a70791fbdb90a2398cf /unsorted/Parameter.c
parent775b6861666af36d317fb577cf489e2c6377f878 (diff)
downloadMWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.tar.gz
MWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.zip
let's commit all this before my VM blows up and nukes my work
Diffstat (limited to '')
-rw-r--r--unsorted/Parameter.c (renamed from Parameter.c)32
1 files changed, 16 insertions, 16 deletions
diff --git a/Parameter.c b/unsorted/Parameter.c
index 95bde45..b3c7367 100644
--- a/Parameter.c
+++ b/unsorted/Parameter.c
@@ -1,4 +1,4 @@
-#include "includes/mwcc_decomp.h"
+#include "parser.h"
char curparam[4096];
char *descparam = &curparam[0];
@@ -750,7 +750,7 @@ static int Param_Setting(SETTING_T *p, const char *pstr, int flags) {
strncpy(savevar, pstr, sizeof(savevar));
tok = Arg_PeekToken();
- if (tok && tok->val == ATK_4) {
+ if (tok && tok->val == ATK_EQUALS) {
Arg_UsedToken();
equals = 1;
if (!Param_GetArgument((PARAM_T *) p, &vstr, flags))
@@ -1007,22 +1007,22 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
ArgToken *tok;
subparse = (exec & PARAMPARSEFLAGS_4) != 0;
- nextOpt = !subparse ? ATK_1 : ATK_5;
- nextParam = !subparse ? ATK_5 : ATK_4;
- lastOpt = !subparse ? ATK_0 : ATK_1;
+ nextOpt = !subparse ? ATK_ARG_END : ATK_COMMA;
+ nextParam = !subparse ? ATK_COMMA : ATK_EQUALS;
+ lastOpt = !subparse ? ATK_END : ATK_ARG_END;
tok = Arg_PeekToken();
#line 1467
OPTION_ASSERT(tok);
if ((param->flags & PARAMFLAGS_3) == 0) {
- if (tok->val == nextParam || tok->val == ATK_4)
+ if (tok->val == nextParam || tok->val == ATK_EQUALS)
tok = Arg_UsedToken();
if (tok->val == nextOpt || tok->val == nextParam || tok->val == lastOpt) {
Param_Error(34);
return 0;
}
- if (tok->val != ATK_2) {
+ if (tok->val != ATK_ARG) {
Param_Error(57, "parameter", Arg_GetTokenName(tok));
return 0;
}
@@ -1032,12 +1032,12 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
if (param->flags & PARAMFLAGS_8) {
tok = Arg_PeekToken();
- if (tok->val == ATK_4)
+ if (tok->val == ATK_EQUALS)
Arg_UsedToken();
}
} else if (param->flags & PARAMFLAGS_1) {
*cparam = 0;
- if (tok->val == ATK_4 && !subparse) {
+ if (tok->val == ATK_EQUALS && !subparse) {
if (!(exec & PARAMPARSEFLAGS_40)) {
Param_Error(37);
return 0;
@@ -1049,7 +1049,7 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
*cparam = 0;
} else if (tok->val == nextParam) {
tok = Arg_UsedToken();
- if (tok->val == ATK_2) {
+ if (tok->val == ATK_ARG) {
Arg_GetTokenText(tok, curparam, sizeof(curparam), 1);
if ((param->flags & PARAMFLAGS_12) && Param_IsNonTextFile(curparam, !(exec & PARAMPARSEFLAGS_1))) {
*cparam = 0;
@@ -1060,17 +1060,17 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
} else {
*cparam = 0;
}
- } else if (tok->val == ATK_2 && !tok->text[0]) {
+ } else if (tok->val == ATK_ARG && !tok->text[0]) {
tok = Arg_UsedToken();
if (tok->val == nextParam)
Arg_UsedToken();
*cparam = 0;
- } else if ((exec & PARAMPARSEFLAGS_4) && tok->val != ATK_4) {
+ } else if ((exec & PARAMPARSEFLAGS_4) && tok->val != ATK_EQUALS) {
*cparam = 0;
} else {
- if (tok->val == ATK_4)
+ if (tok->val == ATK_EQUALS)
tok = Arg_UsedToken();
- if (tok->val == ATK_2) {
+ if (tok->val == ATK_ARG) {
Arg_GetTokenText(tok, curparam, sizeof(curparam), 1);
if ((param->flags & PARAMFLAGS_12) && Param_IsNonTextFile(curparam, !(exec & PARAMPARSEFLAGS_1))) {
*cparam = 0;
@@ -1089,9 +1089,9 @@ static int Param_GetArgument(PARAM_T *param, const char **cparam, int exec) {
if (pTool->TYPE == CWDROPINCOMPILERTYPE && (exec & PARAMPARSEFLAGS_2) && *cparam) {
if (!(exec & PARAMPARSEFLAGS_10)) {
if (subparse)
- Arg_AddToToolArgs(&linkargs, ATK_4, 0);
+ Arg_AddToToolArgs(&linkargs, ATK_EQUALS, 0);
else
- Arg_AddToToolArgs(&linkargs, ATK_5, 0);
+ Arg_AddToToolArgs(&linkargs, ATK_COMMA, 0);
}
Param_PushParam(*cparam);
Args_AddToToolArgs(&linkargs);