fix issue where cat model.fermi | fermi led to infinite loop

This commit is contained in:
NunoSempere 2024-07-08 17:21:49 -04:00
parent 7ff3b2148e
commit 28fd4f69aa

3
f.go
View File

@ -364,6 +364,7 @@ replForLoop:
switch {
case strings.TrimSpace(new_line_trimmed) == "": /* Empty line case */
continue replForLoop
/* Parenthesis */
case len(words) == 2 && (words[0] == "*" || words[0] == "+" || words[0] == "-" || words[0] == "/") && words[1] == "(":
new_stack := runRepl(Stack{old_dist: INIT_DIST, vars: stack.vars}, reader)
@ -392,8 +393,6 @@ replForLoop:
fmt.Printf("%s ", words[1])
prettyPrintDist(stack.old_dist)
stack.old_dist = INIT_DIST
// fmt.Println()
// continue replForLoop
default:
op, new_dist, err := parseWordsIntoOpAndDist(words, stack.vars)
if err != nil {