diff options
author | dan <[email protected]> | 2023-05-26 17:29:51 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-05-26 17:29:51 -0400 |
commit | 55d3248ea3e7f08d8f637602128b44556846d51c (patch) | |
tree | db47271b914794fc0a2067c745c76d0a81a1f2f1 | |
parent | 527287370e18d477b446a372ea1fd205893d1660 (diff) | |
download | forth-55d3248ea3e7f08d8f637602128b44556846d51c.tar.gz forth-55d3248ea3e7f08d8f637602128b44556846d51c.tar.bz2 forth-55d3248ea3e7f08d8f637602128b44556846d51c.zip |
format: correct forth.c indentation
-rw-r--r-- | forth.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -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) { |