Skip to content

Commit 8646b5b

Browse files
committed
Fix tagged? and add implementaiton for source-path
1 parent 738b398 commit 8646b5b

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

fnl/nfnl/header.fnl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(local {: autoload : define} (require :nfnl.module))
22
(local core (autoload :nfnl.core))
3+
(local str (autoload :nfnl.string))
34

45
(local M (define :nfnl.header))
56

@@ -11,9 +12,10 @@
1112

1213
(fn M.tagged? [s]
1314
"Is the line an nfnl tagged header line?"
14-
(core.string? (s:find tag 1 true)))
15+
(core.number? (s:find tag 1 true)))
1516

16-
(fn M.source-path []
17-
"")
17+
(fn M.source-path [s]
18+
(when (M.tagged? s)
19+
(core.last (str.split s "%s+"))))
1820

1921
M

lua/nfnl/header.lua

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)