Fix regression of commend-at-eof error

This commit is contained in:
2021-04-25 14:06:29 -06:00
parent 7005927248
commit 2f80b09f37
3 changed files with 16 additions and 1 deletions

View File

@@ -63,12 +63,13 @@ class Stream {
content = content.replace('\r', ''); content = content.replace('\r', '');
} }
this.content = content;
// Life is easier with a trailing newline // Life is easier with a trailing newline
if (content.charAt(content.length - 1) != "\n") if (content.charAt(content.length - 1) != "\n")
content += "\n"; content += "\n";
this.content = content;
line = 1; line = 1;
column = 1; column = 1;
absoluteChar = 0; absoluteChar = 0;

View File

@@ -0,0 +1,9 @@
package test.cases;
import utest.Assert;
import utest.Test;
import kiss.Prelude;
import kiss.List;
@:build(kiss.Kiss.build())
class CommentAtEndOfFileTestCase extends Test {}

View File

@@ -0,0 +1,5 @@
(defun myFun []
(deflocal something 5)
)
// This comment used to cause a hard-to-track-down error!