Skip to content

Commit 72e0ae2

Browse files
committed
[Tolk] Correctly handle import without ".tolk" extension
Also, output abs paths in error messages.
1 parent 1774c05 commit 72e0ae2

22 files changed

+131
-70
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import "imports/some-math"
2+
import "./imports/use-dicts.ext"
3+
4+
fun main() {
5+
prepareDict_3_30_4_40_5_x(4);
6+
return someAdd(1, 2);
7+
}
8+
9+
/**
10+
@testcase | 0 | | 3
11+
12+
@fif_codegen
13+
"""
14+
main() PROC:<{
15+
3 PUSHINT
16+
}>
17+
"""
18+
*/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
fun asdf() {
3+
var i: int = "";
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import "./some-storage"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
struct SomeStorage {}

tolk-tester/tests/invalid-symbol/err-2205.tolk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import "../imports/invalid-no-import.tolk";
33

44
/**
55
@compilation_should_fail
6-
@stderr ../imports/invalid-no-import.tolk:2:13
6+
@stderr tests/imports/invalid-no-import.tolk:2:13
77
@stderr Using a non-imported symbol `someAdd`
88
*/
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import "@stdlib/tvm-dicts"
2-
import "../imports/use-dicts-err.tolk"
2+
import "../imports/use-dicts-err"
33

44
/**
55
@compilation_should_fail
6-
@stderr ../imports/use-dicts-err.tolk:2:22
6+
@stderr tests/imports/use-dicts-err.tolk:2:22
77
@stderr Using a non-imported symbol `createEmptyDict`
8-
@stderr Forgot to import "@stdlib/tvm-dicts"?
8+
@stderr hint: forgot to import "@stdlib/tvm-dicts"?
99
*/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import "../imports/some-helpers"
2+
3+
fun usingNonImported() {
4+
var s: SomeStorage = {};
5+
}
6+
7+
/**
8+
@compilation_should_fail
9+
@stderr Using a non-imported symbol `SomeStorage`
10+
@stderr forgot to import "some-storage.tolk"?
11+
*/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import "../imports/./has-tinf-err"
2+
3+
/**
4+
@compilation_should_fail
5+
@stderr imports/has-tinf-err.tolk:3:18
6+
@stderr can not assign `slice` to variable of type `int`
7+
*/

tolk-tester/tests/logical-operators.tolk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "imports/use-dicts.tolk"
1+
import "imports/use-dicts.ext.tolk"
22

33
fun simpleAllConst() {
44
return (!0, !!0 & !false, !!!0, !1, !!1, !-1, !!-1, (!5 as int == 0) == !0, !0 == true);

0 commit comments

Comments
 (0)