-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enable relative imports * update per 1st review * remove symlink stuffs * fix cli run in make file * make resolving import path explicit * fix importDir
- Loading branch information
Ozan Hacıbekiroğlu
committed
May 22, 2020
1 parent
e059953
commit 4ed7576
Showing
10 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
export { | ||
fn: func(a) { | ||
two := import("two/two") | ||
return two.fn(a, "one") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env tengo | ||
|
||
os := import("os") | ||
one := import("one") | ||
fmt := import("fmt") | ||
text := import("text") | ||
expected := ["test", "one", "two", "three", "four", "five"] | ||
expected = text.join(expected, " ") | ||
if v := one.fn("test"); v != expected { | ||
fmt.printf("relative import test error:\n\texpected: %v\n\tgot : %v\n", | ||
expected, v) | ||
os.exit(1) | ||
} | ||
args := text.join(os.args(), " ") | ||
fmt.println("ok\t", args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { | ||
fn: func(a, b, c) { | ||
four := import("./two/four/four.tengo") | ||
return four.fn(a, b, c, "three") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export { | ||
fn: func(...args) { | ||
text := import("text") | ||
args = append(args, "five") | ||
return text.join(args, " ") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { | ||
fn: func(a, b, c, d) { | ||
five := import("../five/five") | ||
return five.fn(a, b, c, d, "four") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { | ||
fn: func(a, b) { | ||
three := import("../three") | ||
return three.fn(a, b, "two") | ||
} | ||
} |