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

Skip over tab characters before comment delimiter #98

Merged
merged 1 commit into from
Dec 12, 2022

Conversation

Chocobo1
Copy link
Contributor

This is when "inline-comment" feature is enabled.

From https://stackoverflow.com/a/70432963

the semicolon needn't be the first character of the line; it can be preceded by space, tab or
vertical tab

This is when "inline-comment" feature is enabled.

From https://stackoverflow.com/a/70432963
>the semicolon needn't be the first character of the line; it can be preceded by space, tab or
>vertical tab
@Chocobo1
Copy link
Contributor Author

This extends the "inline-comment" feature and I find this idea neat and wouldn't get in the way of other functionalities.

@zonyitoo zonyitoo merged commit 641bb49 into zonyitoo:master Dec 12, 2022
@zonyitoo
Copy link
Owner

zonyitoo commented Dec 12, 2022

Wait a minute,

phone2 = 56789	 # tab + space before comment
phone3 = 43210 	# space + tab before comment

I think the value of phone2 should be 56789\t and phone3 should be 43210 .

parse_str_until "section name]"
parse_str_until "name "
parse_str_until "hello"
parse_str_until "gender "
parse_str_until "mail"
parse_str_until "address "
parse_str_until "web#url"
parse_str_until "phone "
parse_str_until "01234"
parse_str_until "phone2 "
parse_str_until "56789\t"
parse_str_until "phone3 "
parse_str_until "43210 "

Hmm, tailing spaces are trimmed:

let mval = val[..].trim().to_owned();

@Chocobo1 Chocobo1 deleted the tab branch December 12, 2022 09:32
@Chocobo1
Copy link
Contributor Author

I think the value of phone2 should be 56789\t and phone3 should be 43210 .

The user might use ' ' or '\t' for aligning comments so in this case it would be preferred to trim them.
However there is no formal spec for .ini format so this is in gray area...

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

Successfully merging this pull request may close these issues.

2 participants