continue after import error, fix error order

This commit is contained in:
2026-02-24 22:25:16 -08:00
parent 6e7e123847
commit 4c5cd4dec0
4 changed files with 56 additions and 18 deletions

View File

@@ -1,2 +1,9 @@
*** Process tests/BadImport.newt
ERROR at tests/BadImport.newt:4:8--4:22: error reading tests/Does/Not/Exist.newt: Error: ENOENT: no such file or directory, open 'tests/Does/Not/Exist.newt'
module BadImport
ERROR at tests/BadImport.newt:4:8--4:22: Error in import Does.Not.Exist
-- Error should point to name here
import Does.Not.Exist
^^^^^^^^^^^^^^
ERROR at tests/BadImport.newt:1:1--1:1: Compile failed

View File

@@ -1,10 +1,10 @@
*** Process tests/ErrorDup.newt
module ErrorDup
ERROR at tests/ErrorDup.newt:9:7--9:10: Nat already declared
record Nat where
ERROR at tests/ErrorDup.newt:5:6--5:9: Nat already declared
data Nat = Z | S Nat
class Nat where
^^^
data Nat = Z | S Nat
^^^
ERROR at tests/ErrorDup.newt:7:8--7:11: Nat already declared
data Nat = Z | S Nat
@@ -12,10 +12,10 @@ ERROR at tests/ErrorDup.newt:7:8--7:11: Nat already declared
record Nat where
^^^
ERROR at tests/ErrorDup.newt:5:6--5:9: Nat already declared
data Nat = Z | S Nat
ERROR at tests/ErrorDup.newt:9:7--9:10: Nat already declared
record Nat where
data Nat = Z | S Nat
^^^
class Nat where
^^^
ERROR at tests/ErrorDup.newt:1:1--1:1: Compile failed

View File

@@ -1,2 +1,16 @@
*** Process tests/ImportError.newt
ERROR at tests/ImportError.newt:5:8--5:12: error reading tests/Blah.newt: Error: ENOENT: no such file or directory, open 'tests/Blah.newt'
module Prelude
module ImportError
ERROR at tests/ImportError.newt:5:8--5:12: Error in import Blah
-- test the FC are right and don't include next line
-- TODO continue on and hit the next one.
import Blah
^^^^
ERROR at tests/ImportError.newt:6:8--6:15: Error in import Foo.Bar
-- TODO continue on and hit the next one.
import Blah
import Foo.Bar
^^^^^^^
ERROR at tests/ImportError.newt:1:1--1:1: Compile failed