From 55d3248ea3e7f08d8f637602128b44556846d51c Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 26 May 2023 17:29:51 -0400 Subject: format: correct forth.c indentation --- forth.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/forth.c b/forth.c index f5f629a..4c5d910 100644 --- a/forth.c +++ b/forth.c @@ -47,24 +47,24 @@ void exec(stack *s, char *word, int len, char* line, int* i) { } void eval(stack* s, int len, char* line) { - char word[WORD_LEN_LIMIT]; - int wordi = 0; - for (int i = 0; i < len; i++) { - if (notdelim(line[i]) && wordi < WORD_LEN_LIMIT - 1) { - word[wordi++] = line[i]; - } else { // end of word - if (wordi > 0) { // don't exec an empty string - word[wordi] = '\0'; - exec(s, word, len, line, &i); - } - // start new word - wordi = 0; - } - // end of input string - if (line[i] == '\0') { - return; + char word[WORD_LEN_LIMIT]; + int wordi = 0; + for (int i = 0; i < len; i++) { + if (notdelim(line[i]) && wordi < WORD_LEN_LIMIT - 1) { + word[wordi++] = line[i]; + } else { // end of word + if (wordi > 0) { // don't exec an empty string + word[wordi] = '\0'; + exec(s, word, len, line, &i); } + // start new word + wordi = 0; + } + // end of input string + if (line[i] == '\0') { + return; } + } } int main(int argc, char** argv) { -- cgit v1.2.3