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

Add support for more whitespace positions within expressions #327

Closed

Conversation

cipriancraciun
Copy link
Contributor

As reported in #315 at the moment whitespaces aren't allowed in many places where normal Rust would allow them.

This pull request adds support for whitespaces in:

  • in function calls: x ( 1 , 2 );
  • in path elements: module :: element;
  • in attributes: x . y . z;
  • in filter arguments: x| filter ( 1 , 2 );
  • before unary operators: ! false and - 42;
  • also allow more than a single whitespace;

Also change some tests to include whitespaces in various positions.

As noted in #315 at the moment there is a language ambiguity regarding bitwise or and filter application. As such at the moment the pipe character | should not be preceded by a space when wanting filter application, and must always be preceded when wanting bitwise or. (This is not a deficiency of the current patch.)

@djc
Copy link
Owner

djc commented May 25, 2020

Similar to #323, I'm okay with the code generator changes but let's only have a specific test that tests some subset of the code generator for whitespace sensitivity.

* in function calls: `x ( 1 , 2 )`;
* in path elements: `module :: element`;
* in attributes: `x . y . z`;
* in filter arguments: `x| filter ( 1 , 2 )`;
* before unary operators: `! false` and `- 42`;
* in grouped expressions: `( 1 + 2 )`;
* also allow more than a single whitespace;

Change some tests to include whitespaces in various positions.
@cipriancraciun cipriancraciun force-pushed the patches/upstream/allow-spaces branch 2 times, most recently from 6021e9c to 643bf3a Compare May 25, 2020 13:38
@djc
Copy link
Owner

djc commented Jun 30, 2020

Merged as e71e680 and af2fd0b. Thanks!

@djc djc closed this Jun 30, 2020
@cipriancraciun cipriancraciun deleted the patches/upstream/allow-spaces branch June 30, 2020 13:19
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