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

Multiline comments cause error in parsing #1

Closed
skyrod-vactai opened this issue Feb 26, 2022 · 5 comments · Fixed by #2
Closed

Multiline comments cause error in parsing #1

skyrod-vactai opened this issue Feb 26, 2022 · 5 comments · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@skyrod-vactai
Copy link
Contributor

This parses ok:

;; foo
 ;; bar

this doesn't:

;; foo
;; bar

The only difference is that in the first example, there's a space before the first semicolon on the 2nd line. Without that whitespace, the parser errors with Err(ParserErrorWithContext { context: [], row: 1, col: 2, error: UnexpectedCharacter(';') })

I looked at the unit tests and they don't cover this, the comment tests all have whitespace.

Here's a tiny reproducer:

extern crate edn_format;

fn main() {
    println!("{:?}", edn_format::parse_str(";; abc\n;; def \n\n ced"));
}
@bowbahdoe bowbahdoe self-assigned this Feb 27, 2022
@bowbahdoe bowbahdoe added the bug Something isn't working label Feb 27, 2022
@bowbahdoe
Copy link
Owner

Taking a look now

@bowbahdoe
Copy link
Owner

@skyrod-vactai This should be fixed now in 3.2.3. Let me know if you run into anything else + what you are using the library for (genuinely curious)

@skyrod-vactai
Copy link
Contributor Author

I'm developing a simple programming language (closely related to Joy). Its source code (and data, it's homoiconic) is a subset of edn (vectors, boolean, string, numbers, symbols, and one reader tag for base64 encoded bytes). I'm using your lib as the reader/writer. Thanks for making the lib and being so responsive to my bug report. I'm about to upgrade and try out the fix.

@skyrod-vactai
Copy link
Contributor Author

Fixed! Thanks!

@bowbahdoe
Copy link
Owner

bowbahdoe commented Mar 15, 2022

@skyrod-vactai As far as i am aware you are my only user, so if you have any issues/questions/feature requests or just want a rubber duck feel free to message me on whatever platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants