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

Allow ignore end-of-line inside delimiters #717

Merged
merged 4 commits into from
Oct 28, 2020
Merged

Allow ignore end-of-line inside delimiters #717

merged 4 commits into from
Oct 28, 2020

Conversation

casey
Copy link
Owner

@casey casey commented Oct 28, 2020

Modify the lexer to keep track of opening ({[ and closing ]}) delimiters.
When the lexer would emit an eol or indent outside of a recipe when there
is at least one open delimiter, emit a whitespace token instead.

This allows expressions to be split on multiple lines, like so:

x := if 'a' == 'b' {
  'x'
} else {
  'y'
}

This does not work inside of recipe body interpolations, although this
restriction might relaxed in the future.

- Test that weird indentation is ignored when contuinuing lines
- Check that it is possible to paren-delimited dependencies on multiple
  lines
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.

1 participant