summaryrefslogtreecommitdiff
path: root/tnslc/paths.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-12-12 16:25:02 -0500
committerKyle Gunger <kgunger12@gmail.com>2022-12-12 16:25:02 -0500
commitecf3e4075141163459200a2b2d05bd8b866c371d (patch)
treea36a0ba031087fb3c4913aa4115b5c2fba225cef /tnslc/paths.tnsl
parentb343dcdcb4e6b9297257dc066885aa530b8a04c1 (diff)
Module include syntax
Diffstat (limited to 'tnslc/paths.tnsl')
-rw-r--r--tnslc/paths.tnsl20
1 files changed, 20 insertions, 0 deletions
diff --git a/tnslc/paths.tnsl b/tnslc/paths.tnsl
index 1e8c705..1a97f08 100644
--- a/tnslc/paths.tnsl
+++ b/tnslc/paths.tnsl
@@ -38,6 +38,26 @@
;return tnsl.io.readFile(self.full_path())
;/
+ /; extension_is ({}charp chk) [bool]
+ ;{}charp ext = ""
+ ;int dot = -1
+ /; loop (int i = len (self.file) - 1; i > 0) [i = i - 1]
+ /; if (self.file{i} == '.')
+ ;dot = i
+ ;break
+ ;/
+ ;/
+
+ /; if (dot > 0)
+ ;dot++
+ /; loop (dot < len (self.file)) [dot++]
+ ;ext.append(self.file{dot})
+ ;/
+ ;/
+
+ ;return string_equate(chk, ext)
+ ;/
+
;/
/; split({}charp str, charp c) [{}{}charp]