aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-26 17:29:51 -0400
committerdan <[email protected]>2023-05-26 17:29:51 -0400
commit55d3248ea3e7f08d8f637602128b44556846d51c (patch)
treedb47271b914794fc0a2067c745c76d0a81a1f2f1
parent527287370e18d477b446a372ea1fd205893d1660 (diff)
downloadforth-55d3248ea3e7f08d8f637602128b44556846d51c.tar.gz
forth-55d3248ea3e7f08d8f637602128b44556846d51c.tar.bz2
forth-55d3248ea3e7f08d8f637602128b44556846d51c.zip
format: correct forth.c indentation
-rw-r--r--forth.c32
1 files 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) {