title: LPAREN Syntax Error in Standard ML
body: <p>I'm having a continuous error pop when I try to run this program in ML:</p>
  
  <pre><code>fun find(s,file) =
      let fun findHelper(true, true, ch, w, file, acc, acc2) = TextIO.output(TextIO.stdOut, acc2^"\n")
      | findHelper(b1, b2, ch, w, file, acc) = ch = valOf(TextIO.input1(TextIO.file)) acc2^str(ch) 
      if ch = ""  then 
          if w = acc then b1 = true 
          else acc = "" 
      else if ch = "\n" then b2 = true
          else acc^str(ch)
  
  
  in 
      findHelper(false, false, "", s, file, "", "")
  end 
  </code></pre>
  
  <p>The error code is:</p>
  
  <pre><code>    project.sml:61.3 Error: syntax error: inserting  LPAREN
      project.sml:65.12 Error: syntax error: inserting  RPAREN
  </code></pre>
  
  <p>I've inserted a bunch of parenthesis to no avail and honestly, I don't even know why this error popped. The error is centering around the "if ch = "" then" , but there is no error for the other instance of ch, so I don't know why it error'd one and not the other. </p>