Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recomendation: Handle windows line endings in docstrings #354

Open
alexjgriffith opened this issue May 13, 2021 · 1 comment
Open

Recomendation: Handle windows line endings in docstrings #354

alexjgriffith opened this issue May 13, 2021 · 1 comment
Labels

Comments

@alexjgriffith
Copy link

I was testing out the feasibility of running non-precompiled fennel code on windows and ran into the following windows sepcific error.

(require :colour)
runtime error: ./colour.fnl:105: unfinished string near '"Convert HSL to RGB. '
stack traceback:
  [C]: in function 'assert'
  ./fennel:878: in function 'load-code'
  ./fennel:3838: in function ?
  [C]: in function 'chunk'
  ./fennel:432: in function ?
  [C]: in function 'xpcall'
  ./fennel:437: in function 'repl'
  ./fennel:4529: in function ?
  [C]: in ?

The error occurs in the docstring of a function.

(fn colour.hsl-to-rgb [hin s l a]
  "Convert HSL to RGB. 

Note A remains unchanged."
    (var [r g b] [0 0 0])
...

It can be fixed by removing all newlines from the docstring or changing the line endings from DOS to UNIX.

Would it be feasible to handle multiple types of line endings in the docstring parser? If not, perhaps a note on this limitation should be included in the documentation on docstrings?

@technomancy
Copy link
Collaborator

technomancy commented May 13, 2021 via email

jaawerth added a commit that referenced this issue Jun 3, 2021
Resolves #354 (on github)

This updates the doc special so that it checks if running in windows
(stupidly, by comparing the path separator  against "\\"), and
conditionally outputs the docstring with \n replaced by \r\n.

This also conditionally modifies the docstring test cases when run on
windows.
jaawerth added a commit that referenced this issue Jun 3, 2021
Resolves #354 (on github)

This updates the doc special so that it checks if running in windows
(stupidly, by comparing the path separator  against "\\"), and
conditionally outputs the docstring with \n replaced by \r\n.

This also conditionally modifies the docstring test cases when run on
windows.

Also, attempting to re-enable the circleci windows tests to see if
they're working again.
@technomancy technomancy added the bug label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants