Add a "source reference" to the Rosie output
IF THIS PROPOSAL IS TO BE IMPLEMENTED AFTER VERSION 1.0, then the change in output format should be made in Version 1.0. (I.e. pos
should be replaced with src
, a table that contains pos
and nothing else. The other fields in src
can appear in Version 1.x.)
Design ideas:
- A source reference is a triple: name, line, position
- It indicates where a match was found (today there is only position which is in the
pos
field) - The caller to
librosie
should be able to setname
to be any string (default null and does not appear in Rosie output) - Rosie should increment the line counter each time
match
is called - The caller to
librosie
should be able to reset the line counter (to any reasonable integer) - The Rosie CLI should set name to the current input data file name (or null for stdin)
- The
-wholefile
flag of the CLI requires no special treatment (the line will be 1 for all matches) - The Rosie output format should be restructured, replacing
pos
withsrc
; thesrc
field is a table containing the source reference - When Rosie prints out a source reference for human consumption, it should follow the (de facto) standard format of name:line:position