aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-01-14 12:40:07 +0100
committerkdx <kikoodx@paranoici.org>2023-01-14 12:40:07 +0100
commiteaca074e5fee695fcf08a9b21687e3f01df107ae (patch)
tree1e4e6435c31c09096d828cf01a17496e7f868456
parentae70101ad3c97507f1ed73decd3572fc72aad55e (diff)
downloadsloth-eaca074e5fee695fcf08a9b21687e3f01df107ae.tar.gz
simplify
-rw-r--r--getln.c3
-rw-r--r--main.c1
-rw-r--r--sloth.c5
3 files changed, 2 insertions, 7 deletions
diff --git a/getln.c b/getln.c
index 1b994e9..74c981b 100644
--- a/getln.c
+++ b/getln.c
@@ -24,9 +24,6 @@ char *getln(FILE *stream)
}
memset(buf + size - 1024, 0, 1024);
getln_held = NULL;
- /* If input is a TTY, display a prompt. */
- if (isatty(fileno(stdin)))
- fputs("> ", stdout);
/* Read until either end of file or end of line. */
for (;;) {
if (fgets(buf + size - 1024, 1023, stream) == NULL)
diff --git a/main.c b/main.c
index ffb4516..ad9036c 100644
--- a/main.c
+++ b/main.c
@@ -14,7 +14,6 @@ int main(int argc, char **argv)
/* Read stdin line by line until exhaustion. */
char *line = NULL;
while ((line = getln(stdin)) != NULL) {
- printf("%s", line);
err = sloth_push(sloth, line[0]);
if (err != NULL) {
fprintf(stderr, "%s\n", err);
diff --git a/sloth.c b/sloth.c
index 7f76017..8314b79 100644
--- a/sloth.c
+++ b/sloth.c
@@ -40,8 +40,7 @@ SlothError sloth_push(Sloth *ctx, SlothByte v)
void sloth_inspect_stack(const Sloth *ctx)
{
- printf("size: %lu\n", ctx->stack_size);
- printf("capacity: %lu\n", ctx->stack_capacity);
+ printf("<%lu> ", ctx->stack_size);
for (size_t i = 0; i < ctx->stack_size; i++)
- printf("%08lx: %d\n", i, ctx->stack[i]);
+ printf("%d ", ctx->stack[i]);
}