MCPcopy Create free account
hub / github.com/Singular/Singular / ParseArgs

Function ParseArgs

ppcc/src/ppcc.cc:179–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void ParseArgs() {
180 if (ArgC <= 1) {
181 Error("no arguments");
182 }
183 Compiler = new Str(ArgV[1]);
184 for (int i = 2; i < ArgC; i++) {
185 char *p = ArgV[i];
186 if (p[0] == '-') {
187 i += ParseOpt(new Str(p), ArgV[i+1]);
188 } else {
189 Str *arg = new Str(p);
190 if (arg->ends_with(".c")) {
191 CInput->add(arg);
192 } else if (arg->ends_with(".cc") || arg->ends_with(".cpp")) {
193 CCInput->add(arg);
194 } else if (arg->ends_with(".o")) {
195 ObjInput->add(arg);
196 } else if (arg->ends_with(".s")) {
197 AsmInput->add(arg);
198 } else {
199 AddArg(ALL, arg);
200 }
201 }
202 }
203}
204
205Str *RunCPP() {
206 Str *input;

Callers 1

MainFunction · 0.85

Calls 5

ErrorFunction · 0.85
ParseOptFunction · 0.85
AddArgFunction · 0.85
ends_withMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected