update
This commit is contained in:
22
app.cpp
22
app.cpp
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "core.cpp"
|
||||
#include "core.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int statusCode = 0;
|
||||
@@ -7,14 +8,23 @@ int main(int argc, char **argv) {
|
||||
Arena *arena = arenaAlloc(Megabytes(64));
|
||||
list<string> args = getArgs(arena, argc, argv);
|
||||
|
||||
log(strSplit(arena, strlit("-"), strlit("hallo-world")));
|
||||
log(strSplit(arena, "-"_s, "hallo-world"_s));
|
||||
|
||||
while (true) {
|
||||
size_t arenaPos = arena->head;
|
||||
string line = PushString(arena, 128);
|
||||
fgets(line.str, (int)line.length, stdin);
|
||||
log(strSplit(arena, strlit("-"), line));
|
||||
arenaFreeFrom(arena, arenaPos);
|
||||
string line;
|
||||
list<string> split;
|
||||
|
||||
WithScratch(temp) {
|
||||
line = PushString(temp.arena, 128);
|
||||
fgets(line.str, (int)line.length, stdin);
|
||||
split = strSplit(temp.arena, "-"_s, line);
|
||||
}
|
||||
|
||||
if (line.str[0] == '\n' && line.str[1] == '\0') {
|
||||
break;
|
||||
} else {
|
||||
log(split);
|
||||
}
|
||||
}
|
||||
|
||||
return statusCode;
|
||||
|
||||
Reference in New Issue
Block a user