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

"ParsingError: Unsupported type of line" for line containing semicolon #16

Open
mcpiroman opened this issue Oct 11, 2021 · 2 comments
Open

Comments

@mcpiroman
Copy link

Line:

ABC 1.2.3;1

Gives ParsingError: Unsupported type of line: [7]"ABC 1.2.3;1"

I'd like to parse it literally, with no comment.
I can't add the section to dataSections because the name is dynamic. So maybe make dataSections: string[] | ((name: string) => boolean) 🤔

@Sdju
Copy link
Owner

Sdju commented Oct 14, 2021

Hello. Sorry, I don't clearly understand your idea.
I thought to add an option to pass a middleware. The parser calls the middleware before the ParsingError to give a possibility to solve it.
Middleware will be look smth like (line: string, currentSection: string | $Proto, currentIniObject: IniObject) => bool.

@mcpiroman
Copy link
Author

I mean to add an option to pass to a dataSections not only a predefined list of names but also a callback that would decide if given section is a data section.

Or an option which would allow having semicolons inside lines.

Or both.

Or, if the parser itself does not choke on such expressions, then the validation callback would also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants