diff --git a/extra/ctags/etags/etags.factor b/extra/ctags/etags/etags.factor index 94928a263e..f2d7d7e174 100644 --- a/extra/ctags/etags/etags.factor +++ b/extra/ctags/etags/etags.factor @@ -28,16 +28,8 @@ IN: ctags.etags : ctag-hash ( seq -- hash ) H{ } clone swap [ swap ctag-add ] each ; -: line>bytes ( n seq -- bytes ) - nth length 1+ ; - -: lines>bytes ( n seq -- bytes ) - over zero? [ - line>bytes ] [ - [ - [ 1- ] dip lines>bytes - ] 2keep line>bytes + - ] if ; +: lines>bytes ( seq n -- bytes ) + head 0 [ length 1+ + ] reduce ; : file>lines ( resource -- lines ) ascii file-lines ; @@ -48,7 +40,7 @@ IN: ctags.etags 1 HEX: 7f % second dup number>string % 1 CHAR: , % - 2 - swap lines>bytes number>string % + 1- lines>bytes number>string % ] "" make ; : etag-entry ( alist -- alist array )