diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-03-05 21:13:43 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-03-05 21:13:43 -0800 |
commit | 45807db4c6f8524b770ff0ae8581400b6e140c53 (patch) | |
tree | 5edf3d3b16371d669c5c88803ebfeb0a9c21dcda | |
parent | 5789963289d9949bc4225f507374c3dc7e1d531d (diff) | |
download | txr-45807db4c6f8524b770ff0ae8581400b6e140c53.tar.gz txr-45807db4c6f8524b770ff0ae8581400b6e140c53.tar.bz2 txr-45807db4c6f8524b770ff0ae8581400b6e140c53.zip |
tags: fix off-by-one line numbers for hash bang.
* tags.tl (collect-tags): For hash-bang files, pop the dummy
blank line that we inserted at the head of the line
list to obtain 1-based numbering. If the parser starts working
ater the #! line, it means the second line is 1, which is the
same as zero-based numbering, so we can lose the dummy
entry and all is well.
-rwxr-xr-x | tags.tl | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -65,7 +65,8 @@ (stream (make-strlist-input-stream lines)) (*rec-source-loc* t)) (with-stream (stream (open-file path)) - (unless (starts-with "#!" (get-line stream)) + (if (starts-with "#!" (get-line stream)) + (pop lines) (seek-stream stream 0 :from-start)) (build (add (new file-tag |