Skip to content

Forbid tabs as inline blanks #167

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

Merged
merged 2 commits into from
Aug 20, 2018
Merged

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Aug 17, 2018

Fix #165.

# Partial Error (tab is not a valid indent)
key04 =
This line is indented by 4 spaces,
whereas this line by 1 tab.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exhibits the same behavior as when a broken attribute is encountered. The body of the message up until the syntax error parses fine. Essentially, it's the same situation as:

key04 =
    This line is indented by 4 spaces,
junk here

@stasm stasm requested a review from Pike August 17, 2018 14:55
Copy link
Contributor

@Pike Pike left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the tab character back to text_char.

That also means that one of the testcases should actually pass.

@@ -0,0 +1,14 @@
# Error (tab after =)
key01 = Value 01
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a success.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the tab be trimmed from the value or kept verbatim?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it makes sense to only trim syntax whitespace. I'd keep it.

key01 = Value 01

# Error (tab before =)
key02 = Value 02
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This failing is right, as are the ones below.

@stasm
Copy link
Contributor Author

stasm commented Aug 20, 2018

Thanks, @Pike. I made the tab character a text_char and also changed the whitespace trimming logic to keep it as part of the value.

@stasm stasm requested a review from Pike August 20, 2018 07:41
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