Remove is_chained, do generic check for double semicolon ending in the parser instead, add semicolons in the main chunk - every expression in the main chunk must be semicolon terminated except the last expression (which can be terminated with either ;, ;; or nothing) and expressions terminated with double semicolon.