Skip to content

Double counting of CRLF newline seq in metadata #1063

Closed
@ikappaki

Description

@ikappaki

Hi,

t appears that the CRLF newline sequence is being double counted when calculating the line number in the metadata.

To reproduce

  1. Open up the basilisp REPL, evaluate a string that defines a variable after a single CRLF sequence, and then retrieve the metadata.a. The :line number in the meta is 3, instead of 2
> basilisp repl
basilisp.user=> (load-string "\r\n(def crlf 123)")
#'basilisp.user/crlf

basilisp.user=> (meta #'crlf)
{:line 3 :col 0 :ns basilisp.user :end-col 14 :end-line 3 :file "<Load Input>" :name crlf}

For comparison, using a single newline character reports the correct line number:

basilisp.user=> (meta #'n)
{:line 2 :col 0 :ns basilisp.user :end-col 11 :end-line 2 :file "<Load Input>" :name n}

PR to follow.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:readerIssue pertaining to Basilisp reader moduleissue-type:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions