erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.69k stars 55 forks source link

Fix to trim unnecessary newline #129

Closed GreasySlug closed 2 years ago

GreasySlug commented 2 years ago

Fixes #63.

In the file input, code is split at newlines, but in the REPL evaluates each line, so newline is included. The extra newlines and whitespaces at the end of the line are trimmed.

Changes proposed in this PR: In REPL

1│ a = 2

   ^

to

1│ a = 2
   ^

@mtshiba

mtshiba commented 2 years ago

Thanks!