Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junolab/lnr.jl
Line numbering reader for Julia
https://github.com/junolab/lnr.jl
Last synced: 15 days ago
JSON representation
Line numbering reader for Julia
- Host: GitHub
- URL: https://github.com/junolab/lnr.jl
- Owner: JunoLab
- License: other
- Created: 2014-09-04T15:30:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T12:09:33.000Z (about 1 year ago)
- Last Synced: 2024-10-11T10:57:19.685Z (about 1 month ago)
- Language: Julia
- Size: 17.6 KB
- Stars: 4
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LNR
LNR.jl implements a `LineNumberingReader` type which transparently wraps any other reader (`::IO`). It's intended for working with hand written text where line and column information is significant, and provides functions for working with this information.
`LineNumberingReader`s can be created with either an IO object or a string as a parameter.
The `Cursor` type, which has the `line` and `column` fields, represents a position between two characters (and not the character itself). So `Cursor(n, m)` represents the position just before the `m`th character on line `n`. Comparisons are supported.
The `cursor` function gives the current position in the stream as a cursor. `seek` can be called as usual, but with a `Cursor` instead of an integer, to set the reader at any position in the file.
Other than that, standard IO functions are wrapped, so you can use a line reader as you would any other stream.